From 530d175f2ba101f62e6de788152af61817eff531 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 1 Mar 2016 08:30:04 +1100 Subject: Add PrepareAnvilEvent. --- .../bukkit/event/inventory/PrepareAnvilEvent.java | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java (limited to 'src') diff --git a/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java new file mode 100644 index 00000000..ce496767 --- /dev/null +++ b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java @@ -0,0 +1,47 @@ +package org.bukkit.event.inventory; + +import org.bukkit.event.HandlerList; +import org.bukkit.inventory.AnvilInventory; +import org.bukkit.inventory.InventoryView; +import org.bukkit.inventory.ItemStack; + +/** + * Called when an item is put in a slot for repair by an anvil. + */ +public class PrepareAnvilEvent extends InventoryEvent { + + private static final HandlerList handlers = new HandlerList(); + private ItemStack result; + + public PrepareAnvilEvent(InventoryView inventory, ItemStack result) { + super(inventory); + this.result = result; + } + + @Override + public AnvilInventory getInventory() { + return (AnvilInventory) super.getInventory(); + } + + /** + * Get result item, may be null. + * + * @return result item + */ + public ItemStack getResult() { + return result; + } + + public void setResult(ItemStack result) { + this.result = result; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } +} -- cgit v1.2.3