Refactor code to be more efficient.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import java.util.ArrayList; // CraftBukkit
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
||||
@@ -173,13 +172,13 @@ public class BlockLeaves extends BlockTransparant {
|
||||
}
|
||||
|
||||
// CraftBukkit start - Calculate drops
|
||||
public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
public java.util.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) {
|
||||
this.a(world, i, j, k, new ItemStack(Block.LEAVES.id, 1, l & 3));
|
||||
return this.dropList;
|
||||
} else {
|
||||
return super.calculateDrops(world, entityhuman, i, j, k, l);
|
||||
}
|
||||
return this.dropList;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user