diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemHoe.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemHoe.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main/java/net/minecraft/server/ItemHoe.java b/src/main/java/net/minecraft/server/ItemHoe.java index 4d216e83..67c63d55 100644 --- a/src/main/java/net/minecraft/server/ItemHoe.java +++ b/src/main/java/net/minecraft/server/ItemHoe.java @@ -4,8 +4,7 @@ public class ItemHoe extends Item { protected EnumToolMaterial a; - public ItemHoe(int i, EnumToolMaterial enumtoolmaterial) { - super(i); + public ItemHoe(EnumToolMaterial enumtoolmaterial) { this.a = enumtoolmaterial; this.maxStackSize = 1; this.setMaxDurability(enumtoolmaterial.a()); @@ -17,23 +16,21 @@ public class ItemHoe extends Item { if (!entityhuman.a(i, j, k, l, itemstack)) { return false; } else { - int i1 = world.getTypeId(i, j, k); - int j1 = world.getTypeId(i, j + 1, k); + Block block = world.getType(i, j, k); - if (l != 0 && j1 == 0 && (i1 == Block.GRASS.id || i1 == Block.DIRT.id)) { - Block block = Block.SOIL; + if (l != 0 && world.getType(i, j + 1, k).getMaterial() == Material.AIR && (block == Blocks.GRASS || block == Blocks.DIRT)) { + Block block1 = Blocks.SOIL; - world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getStepSound(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F); + world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block1.stepSound.getStepSound(), (block1.stepSound.getVolume1() + 1.0F) / 2.0F, block1.stepSound.getVolume2() * 0.8F); if (world.isStatic) { return true; } else { // CraftBukkit start - Hoes - blockface -1 for 'SELF' - // world.setTypeIdUpdate(i, j, k, block.id); - if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, block.id, 0, clickedX, clickedY, clickedZ)) { + // world.setTypeUpdate(i, j, k, block1); + if (!ItemBlock.processBlockPlace(world, entityhuman, null, i, j, k, block1, 0, clickedX, clickedY, clickedZ)) { return false; } // CraftBukkit end - itemstack.damage(1, entityhuman); return true; } @@ -43,7 +40,7 @@ public class ItemHoe extends Item { } } - public String g() { + public String i() { return this.a.toString(); } } |