diff options
author | EvilSeph <evilseph@gmail.com> | 2012-11-20 09:27:47 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-11-20 19:37:00 -0500 |
commit | c36b3da57331106c44f763cb6767210d74a030d0 (patch) | |
tree | ff5c82242b416dfe63f9b9dc4eafbd21fff3ce8e /src/main/java/net/minecraft/server/EntityAgeable.java | |
parent | 5f5dd727b6892eae5504578876bb3673151efc5f (diff) | |
download | craftbukkit-c36b3da57331106c44f763cb6767210d74a030d0.tar craftbukkit-c36b3da57331106c44f763cb6767210d74a030d0.tar.gz craftbukkit-c36b3da57331106c44f763cb6767210d74a030d0.tar.lz craftbukkit-c36b3da57331106c44f763cb6767210d74a030d0.tar.xz craftbukkit-c36b3da57331106c44f763cb6767210d74a030d0.zip |
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.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityAgeable.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityAgeable.java | 6 |
1 files changed, 6 insertions, 0 deletions
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 } } } |