2012-06-08 15:28:36 +02:00
|
|
|
package com.Acrobot.ChestShop.Events;
|
|
|
|
|
|
|
|
import com.Acrobot.ChestShop.Containers.Container;
|
|
|
|
import org.bukkit.block.Sign;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.Event;
|
|
|
|
import org.bukkit.event.HandlerList;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
|
|
|
public class TransactionEvent extends Event {
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
|
|
|
private Container container;
|
|
|
|
private Sign sign;
|
|
|
|
|
|
|
|
private Player client;
|
|
|
|
private String owner;
|
|
|
|
|
|
|
|
private ItemStack item;
|
|
|
|
private int itemAmount;
|
|
|
|
private double price;
|
|
|
|
|
|
|
|
private Type transactionType;
|
|
|
|
|
2012-06-10 23:32:57 +02:00
|
|
|
public TransactionEvent(Type transactionType, Container container, Sign sign, Player client, String owner, ItemStack item, double price) {
|
2012-06-08 15:28:36 +02:00
|
|
|
this.container = container;
|
|
|
|
this.sign = sign;
|
|
|
|
|
|
|
|
this.client = client;
|
|
|
|
this.owner = owner;
|
|
|
|
|
|
|
|
this.item = item;
|
2012-06-10 23:32:57 +02:00
|
|
|
this.itemAmount = item.getAmount();
|
2012-06-08 15:28:36 +02:00
|
|
|
|
|
|
|
this.transactionType = transactionType;
|
|
|
|
this.price = price;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Type getTransactionType() {
|
|
|
|
return transactionType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Container getContainer() {
|
|
|
|
return container;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Sign getSign() {
|
|
|
|
return sign;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Player getClient() {
|
|
|
|
return client;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getOwner() {
|
|
|
|
return owner;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ItemStack getItem() {
|
|
|
|
return item;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getItemAmount() {
|
|
|
|
return itemAmount;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double getPrice() {
|
|
|
|
return price;
|
|
|
|
}
|
|
|
|
|
|
|
|
public HandlerList getHandlers() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static HandlerList getHandlerList() {
|
|
|
|
return handlers;
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum Type {
|
|
|
|
BUY,
|
|
|
|
SELL
|
|
|
|
}
|
|
|
|
}
|