13
0
geforkt von Mirrors/Paper

SPIGOT-1733: Add PlayerPickupArrowEvent

Dieser Commit ist enthalten in:
2008Choco 2016-03-22 14:03:48 -04:00 committet von md_5
Ursprung c5d27c5f6f
Commit 9a072ddc1f

Datei anzeigen

@ -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);
+