mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +01:00
SPIGOT-1733: Add PlayerPickupArrowEvent
This commit is contained in:
parent
c5d27c5f6f
commit
9a072ddc1f
1 changed files with 2 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
+// CraftBukkit start
|
+// CraftBukkit start
|
||||||
+import org.bukkit.entity.LivingEntity;
|
+import org.bukkit.entity.LivingEntity;
|
||||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
+import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
||||||
+import org.bukkit.event.player.PlayerPickupItemEvent;
|
+import org.bukkit.event.player.PlayerPickupArrowEvent;
|
||||||
+// CraftBukkit end
|
+// CraftBukkit end
|
||||||
+
|
+
|
||||||
public abstract class EntityArrow extends Entity implements IProjectile {
|
public abstract class EntityArrow extends Entity implements IProjectile {
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
+ if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) {
|
+ if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) {
|
||||||
+ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
|
+ 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
|
+ // event.setCancelled(!entityhuman.canPickUpLoot); TODO
|
||||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in a new issue