diff options
author | feildmaster <admin@feildmaster.com> | 2012-03-23 06:08:54 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-23 07:18:20 -0400 |
commit | 40e096273576ec5f0f49490f3167095d8678cbd8 (patch) | |
tree | 8b322b89c49f47ac5156ee3968444683328c3634 /src/main/java/net/minecraft/server/Block.java | |
parent | ff22e4e3419b0bef85b6cf0e8cefe27711fc27ff (diff) | |
download | craftbukkit-40e096273576ec5f0f49490f3167095d8678cbd8.tar craftbukkit-40e096273576ec5f0f49490f3167095d8678cbd8.tar.gz craftbukkit-40e096273576ec5f0f49490f3167095d8678cbd8.tar.lz craftbukkit-40e096273576ec5f0f49490f3167095d8678cbd8.tar.xz craftbukkit-40e096273576ec5f0f49490f3167095d8678cbd8.zip |
Seriously fix natural drops. Fixes BUKKIT-1297 and fixes BUKKIT-1295
Diffstat (limited to 'src/main/java/net/minecraft/server/Block.java')
-rw-r--r-- | src/main/java/net/minecraft/server/Block.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java index d61be04c..805caf90 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -164,7 +164,7 @@ public class Block { public final Material material; public float frictionFactor; private String name; - protected ArrayList<ItemStack> dropList; // CraftBukkit + protected ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(); // CraftBukkit protected Block(int i, Material material) { this.bR = true; @@ -339,6 +339,7 @@ public class Block { public final void b(World world, int i, int j, int k, int l, int i1) { this.dropNaturally(world, i, j, k, l, 1.0F, i1); + this.doActualDrop(world, i, j, k); // CraftBukkit } public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) { @@ -360,15 +361,11 @@ public class Block { protected void a(World world, int i, int j, int k, ItemStack itemstack) { // CraftBukkit start - the logic of this function is moved into finishDrop - if (this.dropList != null) { - this.dropList.add(itemstack); - } else { - this.finishDrop(world, i, j, k, itemstack); - } + // This is such a hackish change it's rediculous. + this.dropList.add(itemstack); } public final void finishDrop(World world, int i, int j, int k, ItemStack itemstack) { - this.dropList = null; // CraftBukkit end if (!world.isStatic) { float f = 0.7F; @@ -542,13 +539,14 @@ public class Block { entityhuman.a(StatisticList.C[this.id], 1); entityhuman.c(0.025F); // CraftBukkit start - A way to separate statistics from the logic of determining what to drop - this.doActualDrop(world, entityhuman, i, j, k, l); + this.doActualDrop(world, i, j, k); } - public void doActualDrop(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - for (ItemStack stack : dropList) { + public void doActualDrop(World world, int i, int j, int k) { + for (ItemStack stack : this.dropList) { finishDrop(world, i, j, k, stack); } + this.dropList.clear(); } public void setDrops(ArrayList<ItemStack> drops) { @@ -556,7 +554,6 @@ public class Block { } public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) { - this.dropList = new ArrayList<ItemStack>(); // CraftBukkit end if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) { ItemStack itemstack = this.a_(l); |