From c36b3da57331106c44f763cb6767210d74a030d0 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Tue, 20 Nov 2012 09:27:47 -0500 Subject: 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. --- src/main/java/net/minecraft/server/EntityAgeable.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/net/minecraft/server') diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java index e861d3b7..24d798b2 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java @@ -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 } } } -- cgit v1.2.3