Created
August 18, 2017 20:07
-
-
Save brcdev/cd22ffdd4ce5a1974f7c1e4cd7228740 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.brcdev.shopgui.api.event; | |
import net.brcdev.shopgui.shop.ShopItem; | |
import net.brcdev.shopgui.shop.ShopManager.ShopAction; | |
import org.bukkit.entity.Player; | |
import org.bukkit.event.Cancellable; | |
import org.bukkit.event.Event; | |
import org.bukkit.event.HandlerList; | |
public class ShopPreTransactionEvent extends Event implements Cancellable { | |
private static final HandlerList handlers = new HandlerList(); | |
private boolean cancelled; | |
private ShopAction shopAction; | |
private ShopItem shopItem; | |
private Player player; | |
private int amount; | |
private double price; | |
public ShopPreTransactionEvent(ShopAction shopAction, ShopItem shopItem, Player player, int amount, double price) { | |
this.shopAction = shopAction; | |
this.shopItem = shopItem; | |
this.player = player; | |
this.amount = amount; | |
this.price = price; | |
} | |
@Override | |
public boolean isCancelled() { | |
return cancelled; | |
} | |
@Override | |
public void setCancelled(boolean cancel) { | |
cancelled = cancel; | |
} | |
@Override | |
public HandlerList getHandlers() { | |
return handlers; | |
} | |
public static HandlerList getHandlerList() { | |
return handlers; | |
} | |
public ShopItem getShopItem() { | |
return shopItem; | |
} | |
public ShopAction getShopAction() { | |
return shopAction; | |
} | |
public Player getPlayer() { | |
return player; | |
} | |
public int getAmount() { | |
return amount; | |
} | |
public void setAmount(int amount) { | |
this.amount = amount; | |
} | |
public double getPrice() { | |
return price; | |
} | |
public void setPrice(double price) { | |
this.price = price; | |
} | |
} |
Is there a way to get the current item??
Use the getShopItem()
method for this. Please consider using the version from official API repo in future, this gist is deprecated and won't be updated anymore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to get the current item??