mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-28 13:05:11 +01:00
d1732552b0
- Added PreTransactionEvent which can be cancelled - Fixed not placing B/S before prices - Updated Heroes
55 lines
1.2 KiB
Java
55 lines
1.2 KiB
Java
package com.Acrobot.ChestShop.Events;
|
|
|
|
import com.Acrobot.ChestShop.Shop.Shop;
|
|
import org.bukkit.entity.Player;
|
|
import org.bukkit.event.Cancellable;
|
|
import org.bukkit.event.Event;
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class PreTransactionEvent extends Event implements Cancellable {
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
private final Shop shop;
|
|
private final Player player;
|
|
private final TransactionEvent.Type transactionType;
|
|
|
|
private boolean isCancelled = false;
|
|
|
|
public PreTransactionEvent(Shop shop, Player player, TransactionEvent.Type type) {
|
|
this.shop = shop;
|
|
this.player = player;
|
|
this.transactionType = type;
|
|
}
|
|
|
|
public Shop getShop() {
|
|
return shop;
|
|
}
|
|
|
|
public Player getPlayer() {
|
|
return player;
|
|
}
|
|
|
|
public TransactionEvent.Type getTransactionType() {
|
|
return transactionType;
|
|
}
|
|
|
|
public boolean isCancelled() {
|
|
return isCancelled;
|
|
}
|
|
|
|
public void setCancelled(boolean b) {
|
|
this.isCancelled = b;
|
|
}
|
|
|
|
public HandlerList getHandlers() {
|
|
return handlers;
|
|
}
|
|
|
|
public static HandlerList getHandlerList() {
|
|
return handlers;
|
|
}
|
|
}
|