SPIGOT-6452: Call EntityPickupItemEvent for villagers
This commit is contained in:
parent
7c4adc61d0
commit
8a516e0bbb
@ -90,7 +90,25 @@
|
|||||||
this.fq();
|
this.fq();
|
||||||
this.die();
|
this.die();
|
||||||
} else {
|
} else {
|
||||||
@@ -903,7 +923,7 @@
|
@@ -791,9 +811,16 @@
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ ItemStack itemstack1 = inventorysubcontainer.a(itemstack);
|
||||||
|
+ if (CraftEventFactory.callEntityPickupItemEvent(this, entityitem, itemstack1.getCount(), false).isCancelled()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
|
this.a(entityitem);
|
||||||
|
this.receive(entityitem, itemstack.getCount());
|
||||||
|
- ItemStack itemstack1 = inventorysubcontainer.a(itemstack);
|
||||||
|
+ // ItemStack itemstack1 = inventorysubcontainer.a(itemstack); // CraftBukkit - moved up
|
||||||
|
|
||||||
|
if (itemstack1.isEmpty()) {
|
||||||
|
entityitem.die();
|
||||||
|
@@ -903,7 +930,7 @@
|
||||||
|
|
||||||
if (entityirongolem != null) {
|
if (entityirongolem != null) {
|
||||||
if (entityirongolem.a((GeneratorAccess) worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) worldserver)) {
|
if (entityirongolem.a((GeneratorAccess) worldserver, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) worldserver)) {
|
||||||
@ -99,7 +117,7 @@
|
|||||||
return entityirongolem;
|
return entityirongolem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -981,7 +1001,7 @@
|
@@ -981,7 +1008,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void entitySleep(BlockPosition blockposition) {
|
public void entitySleep(BlockPosition blockposition) {
|
||||||
super.entitySleep(blockposition);
|
super.entitySleep(blockposition);
|
||||||
@ -108,7 +126,7 @@
|
|||||||
this.bg.removeMemory(MemoryModuleType.WALK_TARGET);
|
this.bg.removeMemory(MemoryModuleType.WALK_TARGET);
|
||||||
this.bg.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
this.bg.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
|
||||||
}
|
}
|
||||||
@@ -989,7 +1009,7 @@
|
@@ -989,7 +1016,7 @@
|
||||||
@Override
|
@Override
|
||||||
public void entityWakeup() {
|
public void entityWakeup() {
|
||||||
super.entityWakeup();
|
super.entityWakeup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user