mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 12:43:52 -07:00
Refactor code to be more efficient.
This commit is contained in:
@@ -164,7 +164,7 @@ public class Block {
|
||||
public final Material material;
|
||||
public float frictionFactor;
|
||||
private String name;
|
||||
public ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(1); // CraftBukkit
|
||||
public final ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(1); // CraftBukkit
|
||||
|
||||
protected Block(int i, Material material) {
|
||||
this.bR = true;
|
||||
@@ -362,7 +362,7 @@ 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
|
||||
// This is such a hackish change it's rediculous.
|
||||
// This is such a hackish change it's ridiculous.
|
||||
this.dropList.add(itemstack);
|
||||
}
|
||||
|
||||
@@ -550,6 +550,7 @@ public class Block {
|
||||
this.dropList.clear();
|
||||
}
|
||||
|
||||
// Blocks that have different drops in certain situations need to override this. IE: Sheers on BlockLeaves
|
||||
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)) {
|
||||
@@ -563,7 +564,8 @@ public class Block {
|
||||
|
||||
this.dropNaturally(world, i, j, k, l, 1.0F, i1); // CraftBukkit
|
||||
}
|
||||
return this.dropList; // CraftBukkit
|
||||
|
||||
return this.dropList;
|
||||
}
|
||||
|
||||
protected boolean h() {
|
||||
|
Reference in New Issue
Block a user