2017-06-12 01:02:57 +00:00
|
|
|
From 92a2a2f1b72749139bbbb785746b546a3741474f Mon Sep 17 00:00:00 2001
|
2017-06-12 00:42:01 +00:00
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Fri, 5 May 2017 01:16:10 -0500
|
|
|
|
Subject: [PATCH] EntityPickupItemEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java b/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java
|
|
|
|
new file mode 100644
|
2017-06-12 01:02:57 +00:00
|
|
|
index 00000000..3d40b515
|
2017-06-12 00:42:01 +00:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java
|
2017-06-12 01:02:57 +00:00
|
|
|
@@ -0,0 +1,48 @@
|
2017-06-12 00:42:01 +00:00
|
|
|
+package org.bukkit.event.entity;
|
|
|
|
+
|
|
|
|
+import org.bukkit.entity.Item;
|
|
|
|
+import org.bukkit.entity.LivingEntity;
|
|
|
|
+import org.bukkit.event.Cancellable;
|
|
|
|
+import org.bukkit.event.HandlerList;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Thrown when an entity picks an item up from the ground
|
|
|
|
+ */
|
|
|
|
+public class EntityPickupItemEvent extends EntityEvent implements Cancellable {
|
|
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
|
|
+ private final Item item;
|
|
|
|
+ private boolean cancel = false;
|
|
|
|
+
|
|
|
|
+ public EntityPickupItemEvent(final LivingEntity entity, final Item item) {
|
|
|
|
+ super(entity);
|
|
|
|
+ this.item = item;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets the Item picked up by the entity.
|
|
|
|
+ *
|
|
|
|
+ * @return Item
|
|
|
|
+ */
|
|
|
|
+ public Item getItem() {
|
|
|
|
+ return item;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @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;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
--
|
2017-06-12 01:02:57 +00:00
|
|
|
2.13.1
|
2017-06-12 00:42:01 +00:00
|
|
|
|