GangsX
  • GangsX
  • Overview
    • Features
    • Commands & Permissions
    • Placeholders
    • Changelogs
      • v1.3
      • v1.2
      • v1.1
  • Product Guides
    • Configuring The Plugin
  • Previews
    • config.yml
    • quests.yml
    • tournament.yml
    • locale.yml
  • API Usage
    • Developer API
    • Events
      • GangCreateEvent
      • GangDisbandEvent
      • GangPermissionUpdateEvent
      • GangShopPurchaseEvent
      • PlayerJoinGangEvent
      • PlayerLeaveGangEvent
Powered by GitBook
On this page
  1. API Usage
  2. Events

GangShopPurchaseEvent

/**
 * Represents an event that is fired when an item is purchased from the gang shop.
 *
 * Cancellable = true
 *
 * @author frxq
 * @since 1.0.0
 */
public class GangShopPurchaseEvent extends Event implements Cancellable {
    private final GangsX plugin;
    private final Player player;
    private final Gang gang;
    private final ItemStack item;
    private boolean cancelled;
    private final List<String> commands;
    private final String currency;
    private static final HandlerList handlers = new HandlerList();
    private final int cost;

    public GangShopPurchaseEvent(GangsX plugin, Player player, Gang gang, String currency, List<String> commands, ItemStack item, int cost) {
        this.plugin = plugin;
        this.player = player;
        this.gang = gang;
        this.currency = currency;
        this.commands = commands;
        this.item = item;
        this.cost = cost;
    }
    @Override
    public @NotNull HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

    @NotNull
    public Player getPlayer() {
        return player;
    }

    public Integer getCost() { return cost; }

    public boolean isCancelled() {
        return cancelled;
    }

    public String getCurrency() { return currency; }

    public ItemStack getPurchasedItem() {
        return item;
    }

    public void setCancelled(boolean cancel) {
        cancelled = cancel;
    }

    public List<String> getCommands() { return commands; }

    @NotNull
    public Gang getGang() {
        return gang;
    }
}

PreviousGangPermissionUpdateEventNextPlayerJoinGangEvent

Last updated 6 months ago