diff options
author | Morphan1 <morphanone@gmail.com> | 2015-06-26 05:54:41 -0400 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-07-12 19:48:59 +1000 |
commit | 3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b (patch) | |
tree | 9417186015a113eaaa077e786c7cede3612216e7 | |
parent | c31fcfe3a19c4ee597df75e750af1542ac020b92 (diff) | |
download | bukkit-3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b.tar bukkit-3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b.tar.gz bukkit-3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b.tar.lz bukkit-3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b.tar.xz bukkit-3e3e3430e2baf9d07bedad2dd2cc601d9bb7322b.zip |
Add ItemMergeEvent
-rw-r--r-- | src/main/java/org/bukkit/event/entity/ItemMergeEvent.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/ItemMergeEvent.java b/src/main/java/org/bukkit/event/entity/ItemMergeEvent.java new file mode 100644 index 00000000..dadf2210 --- /dev/null +++ b/src/main/java/org/bukkit/event/entity/ItemMergeEvent.java @@ -0,0 +1,50 @@ +package org.bukkit.event.entity; + +import org.bukkit.entity.Item; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; + +public class ItemMergeEvent extends EntityEvent implements Cancellable { + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final Item target; + + public ItemMergeEvent(Item item, Item target) { + super(item); + this.target = target; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancelled) { + this.cancelled = cancelled; + } + + @Override + public Item getEntity() { + return (Item) entity; + } + + /** + * Gets the Item entity the main Item is being merged into. + * + * @return The Item being merged with + */ + public Item getTarget() { + return target; + } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } +} |