Fix infinite 'breeding' with MonsterEggs. Fixes BUKKIT-2997
If the player is not in Creative (i.e. does not have the ability to instantly build) we need to decrement the MonsterEgg item stack when used on a breedable parent mob.
This commit is contained in:
@@ -22,6 +22,12 @@ public abstract class EntityAgeable extends EntityCreature {
|
||||
entityageable.setAge(-24000);
|
||||
entityageable.setPositionRotation(this.locX, this.locY, this.locZ, 0.0F, 0.0F);
|
||||
this.world.addEntity(entityageable);
|
||||
|
||||
// CraftBukkit start
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack.count--;
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user