summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
author2008Choco <hawkeboyz2@hotmail.com>2016-03-22 14:03:48 -0400
committermd_5 <git@md-5.net>2016-03-23 17:23:33 +1100
commit9a072ddc1f181a1eef3b1a5d306af21756f8211b (patch)
tree6e670a241995d7c8f2171f92967e678061e68f4b /nms-patches
parentc5d27c5f6fcaf184d7d9c913bb3ac463e354991e (diff)
downloadcraftbukkit-9a072ddc1f181a1eef3b1a5d306af21756f8211b.tar
craftbukkit-9a072ddc1f181a1eef3b1a5d306af21756f8211b.tar.gz
craftbukkit-9a072ddc1f181a1eef3b1a5d306af21756f8211b.tar.lz
craftbukkit-9a072ddc1f181a1eef3b1a5d306af21756f8211b.tar.xz
craftbukkit-9a072ddc1f181a1eef3b1a5d306af21756f8211b.zip
SPIGOT-1733: Add PlayerPickupArrowEvent
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityArrow.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/nms-patches/EntityArrow.patch b/nms-patches/EntityArrow.patch
index cfda50e8..f00b6b7f 100644
--- a/nms-patches/EntityArrow.patch
+++ b/nms-patches/EntityArrow.patch
@@ -7,7 +7,7 @@
+// CraftBukkit start
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
-+import org.bukkit.event.player.PlayerPickupItemEvent;
++import org.bukkit.event.player.PlayerPickupArrowEvent;
+// CraftBukkit end
+
public abstract class EntityArrow extends Entity implements IProjectile {
@@ -60,7 +60,7 @@
+ if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) {
+ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
+
-+ PlayerPickupItemEvent event = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), 0);
++ PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), (org.bukkit.entity.Arrow) this.getBukkitEntity());
+ // event.setCancelled(!entityhuman.canPickUpLoot); TODO
+ this.world.getServer().getPluginManager().callEvent(event);
+