summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/BlockLeaves.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/BlockLeaves.java')
-rw-r--r--src/main/java/net/minecraft/server/BlockLeaves.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/BlockLeaves.java b/src/main/java/net/minecraft/server/BlockLeaves.java
index 1f2590b6..3daf4193 100644
--- a/src/main/java/net/minecraft/server/BlockLeaves.java
+++ b/src/main/java/net/minecraft/server/BlockLeaves.java
@@ -1,5 +1,6 @@
package net.minecraft.server;
+import java.util.ArrayList; // CraftBukkit
import java.util.Random;
import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
@@ -161,12 +162,28 @@ public class BlockLeaves extends BlockTransparant {
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
entityhuman.a(StatisticList.C[this.id], 1);
+ /* CraftBukkit start - moved this line into calculateDrops
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
+ */
+ this.doActualDrop(world, entityhuman, i, j, k, l);
+ // CraftBukkit end
} else {
super.a(world, entityhuman, i, j, k, l);
}
}
+ // CraftBukkit start - Calculate drops
+ public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
+ if (!world.isStatic && entityhuman.T() != null && entityhuman.T().id == Item.SHEARS.id) {
+ super.dropList = new ArrayList<ItemStack>();
+ this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
+ return super.dropList;
+ } else {
+ return super.calculateDrops(world, entityhuman, i, j, k, l);
+ }
+ }
+ // CraftBukkit end
+
protected int getDropData(int i) {
return i & 3;
}