summaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorArticdive <articdive@gmail.com>2018-07-30 11:38:05 +0200
committermd_5 <git@md-5.net>2018-07-31 10:03:30 +1000
commit60d21bf6e59f555bdcb53cbf6b350e280be4e089 (patch)
tree9a77411d4e7852a44d37b26493755ea05b80158f /src/main/java/org
parentcf6548b4fd81f5be6a243eaf00da815c76611495 (diff)
downloadbukkit-60d21bf6e59f555bdcb53cbf6b350e280be4e089.tar
bukkit-60d21bf6e59f555bdcb53cbf6b350e280be4e089.tar.gz
bukkit-60d21bf6e59f555bdcb53cbf6b350e280be4e089.tar.lz
bukkit-60d21bf6e59f555bdcb53cbf6b350e280be4e089.tar.xz
bukkit-60d21bf6e59f555bdcb53cbf6b350e280be4e089.zip
SPIGOT-3917: Add EntityDropItemEvent
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/bukkit/event/entity/EntityDropItemEvent.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/entity/EntityDropItemEvent.java b/src/main/java/org/bukkit/event/entity/EntityDropItemEvent.java
new file mode 100644
index 00000000..943dea68
--- /dev/null
+++ b/src/main/java/org/bukkit/event/entity/EntityDropItemEvent.java
@@ -0,0 +1,49 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Item;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+
+/**
+ * Thrown when an entity creates an item drop.
+ */
+public class EntityDropItemEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList handlers = new HandlerList();
+ private final Item drop;
+ private boolean cancel = false;
+
+ public EntityDropItemEvent(final Entity entity, final Item drop) {
+ super(entity);
+ this.drop = drop;
+ }
+
+ /**
+ * Gets the Item created by the entity
+ *
+ * @return Item created by the entity
+ */
+ public Item getItemDrop() {
+ return drop;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return cancel;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancel = cancel;
+ }
+
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}