[Bleeding] Fixed item duping in certain occasions. Fixes BUKKIT-1310
This commit is contained in:
@@ -164,7 +164,7 @@ public class Block {
|
||||
public final Material material;
|
||||
public float frictionFactor;
|
||||
private String name;
|
||||
protected ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(); // CraftBukkit
|
||||
public ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(1); // CraftBukkit
|
||||
|
||||
protected Block(int i, Material material) {
|
||||
this.bR = true;
|
||||
@@ -338,6 +338,7 @@ public class Block {
|
||||
}
|
||||
|
||||
public final void b(World world, int i, int j, int k, int l, int i1) {
|
||||
this.dropList.clear(); // CraftBukkit
|
||||
this.dropNaturally(world, i, j, k, l, 1.0F, i1);
|
||||
this.doActualDrop(world, i, j, k); // CraftBukkit
|
||||
}
|
||||
@@ -549,10 +550,6 @@ public class Block {
|
||||
this.dropList.clear();
|
||||
}
|
||||
|
||||
public void setDrops(ArrayList<ItemStack> drops) {
|
||||
this.dropList = drops;
|
||||
}
|
||||
|
||||
public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
// CraftBukkit end
|
||||
if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
|
||||
|
||||
@@ -300,9 +300,8 @@ public class BlockVine extends Block {
|
||||
// CraftBukkit start - Calculate drops
|
||||
public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
if (!world.isStatic && entityhuman.U() != null && entityhuman.U().id == Item.SHEARS.id) {
|
||||
super.dropList = new ArrayList<ItemStack>();
|
||||
this.a(world, i, j, k, new ItemStack(Block.VINE, 1, 0));
|
||||
return super.dropList;
|
||||
return this.dropList;
|
||||
} else {
|
||||
return super.calculateDrops(world, entityhuman, i, j, k, l);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user