diff options
author | md_5 <git@md-5.net> | 2016-03-01 08:30:04 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-03-01 08:30:04 +1100 |
commit | 530d175f2ba101f62e6de788152af61817eff531 (patch) | |
tree | 1c85e0ae0aedeb1d103bd9030beda8d31003cfeb /src | |
parent | a5be7e19c2d5ba08d2df9f1190990b826e197f63 (diff) | |
download | bukkit-530d175f2ba101f62e6de788152af61817eff531.tar bukkit-530d175f2ba101f62e6de788152af61817eff531.tar.gz bukkit-530d175f2ba101f62e6de788152af61817eff531.tar.lz bukkit-530d175f2ba101f62e6de788152af61817eff531.tar.xz bukkit-530d175f2ba101f62e6de788152af61817eff531.zip |
Add PrepareAnvilEvent.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java | 47 |
1 files changed, 47 insertions, 0 deletions
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; + } +} |