SPIGOT-1956: Don't deplete projectile item when event cancelled
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -30,13 +30,18 @@
|
||||
}
|
||||
|
||||
itemstack.damage(1, entityhuman);
|
||||
@@ -81,7 +96,10 @@
|
||||
@@ -81,7 +96,15 @@
|
||||
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
||||
}
|
||||
|
||||
- world.addEntity(entityarrow);
|
||||
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||
+ world.addEntity(entityarrow);
|
||||
+ if (!world.addEntity(entityarrow)) {
|
||||
+ if (entityhuman instanceof EntityPlayer) {
|
||||
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user