diff options
author | Travis Watkins <amaranth@ubuntu.com> | 2013-03-16 08:05:03 -0500 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-16 08:05:03 -0500 |
commit | 4fa8c24e421856bd6eae01137bafacfc8673d1c8 (patch) | |
tree | b404de9f6506d8916813b743ac9935a2909bd953 /src/main/java/net/minecraft/server/BlockSapling.java | |
parent | d47849df8c4bee23ac85897a41537142ab81ab7b (diff) | |
download | craftbukkit-4fa8c24e421856bd6eae01137bafacfc8673d1c8.tar craftbukkit-4fa8c24e421856bd6eae01137bafacfc8673d1c8.tar.gz craftbukkit-4fa8c24e421856bd6eae01137bafacfc8673d1c8.tar.lz craftbukkit-4fa8c24e421856bd6eae01137bafacfc8673d1c8.tar.xz craftbukkit-4fa8c24e421856bd6eae01137bafacfc8673d1c8.zip |
Always consume bonemeal when used on a sapling. Fixes BUKKIT-3755
In Minecraft 1.5 saplings do not grow with a single use of bonemeal anymore.
Our code assumes they will and only takes away bonemeal from the player
when the tree grows successfully (not cancelled by a plugin). Instead we
now always remove a bonemeal even if a plugin is the reason a tree didn't
grow as this matches the vanilla logic more closely.
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockSapling.java')
-rw-r--r-- | src/main/java/net/minecraft/server/BlockSapling.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java index 42646300..56938cdc 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java @@ -116,7 +116,11 @@ public class BlockSapling extends BlockFlower { --itemstack.count; } } + } else if (bonemeal && itemstack != null) { + // We always consume bonemeal when trying to grow + --itemstack.count; } + if (!grownTree) { if (flag) { world.setTypeIdAndData(i + i1, j, k + j1, this.id, l, 4); |