SPIGOT-6093: Can't change ItemStack in EntityPickupItemEvent
By: Shane Bee <shanebolenback@me.com>
This commit is contained in:
@@ -11,16 +11,17 @@
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@
|
||||
@@ -401,7 +401,8 @@
|
||||
protected void b(EntityItem entityitem) {
|
||||
ItemStack itemstack = entityitem.getItemStack();
|
||||
|
||||
- if (this.canPickup(itemstack)) {
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, entityitem, itemstack.getCount() - 1, !this.canPickup(itemstack)).isCancelled()) { // CraftBukkit - call EntityPickupItemEvent
|
||||
+ itemstack = entityitem.getItemStack(); // CraftBukkit - update ItemStack from event
|
||||
int i = itemstack.getCount();
|
||||
|
||||
if (i > 1) {
|
||||
@@ -923,6 +923,11 @@
|
||||
@@ -923,6 +924,11 @@
|
||||
int i = (Integer) iblockdata.get(BlockSweetBerryBush.a);
|
||||
|
||||
iblockdata.set(BlockSweetBerryBush.a, 1);
|
||||
@@ -32,7 +33,7 @@
|
||||
int j = 1 + EntityFox.this.world.random.nextInt(2) + (i == 3 ? 1 : 0);
|
||||
ItemStack itemstack = EntityFox.this.getEquipment(EnumItemSlot.MAINHAND);
|
||||
|
||||
@@ -962,7 +967,7 @@
|
||||
@@ -962,7 +968,7 @@
|
||||
private int f;
|
||||
|
||||
public r() {
|
||||
@@ -41,7 +42,7 @@
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK));
|
||||
}
|
||||
|
||||
@@ -1014,7 +1019,7 @@
|
||||
@@ -1014,7 +1020,7 @@
|
||||
private int c;
|
||||
|
||||
public t() {
|
||||
@@ -50,7 +51,7 @@
|
||||
this.c = EntityFox.this.random.nextInt(140);
|
||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP));
|
||||
}
|
||||
@@ -1125,7 +1130,7 @@
|
||||
@@ -1125,7 +1131,7 @@
|
||||
private EntityLiving k;
|
||||
private int l;
|
||||
|
||||
@@ -59,7 +60,7 @@
|
||||
super(EntityFox.this, oclass, 10, flag, flag1, predicate);
|
||||
}
|
||||
|
||||
@@ -1205,6 +1210,14 @@
|
||||
@@ -1205,6 +1211,14 @@
|
||||
if (entityplayer1 != null && entityplayer != entityplayer1) {
|
||||
entityfox.b(entityplayer1.getUniqueID());
|
||||
}
|
||||
@@ -74,7 +75,7 @@
|
||||
|
||||
if (entityplayer2 != null) {
|
||||
entityplayer2.a(StatisticList.ANIMALS_BRED);
|
||||
@@ -1217,10 +1230,14 @@
|
||||
@@ -1217,10 +1231,14 @@
|
||||
this.partner.resetLove();
|
||||
entityfox.setAgeRaw(-24000);
|
||||
entityfox.setPositionRotation(this.animal.locX(), this.animal.locY(), this.animal.locZ(), 0.0F, 0.0F);
|
||||
|
||||
Reference in New Issue
Block a user