diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-15 01:23:52 +0100 |
commit | 5b2c774edc069f70d1fa9940d96bb0b8705bef7a (patch) | |
tree | 79d1800e7154bba7b5fca4f8c8373ee4376cca89 /src/main/java/net/minecraft/server/ItemHoe.java | |
parent | 54bcd1c1f36691a714234e5ca2f30a20b3ad2816 (diff) | |
download | craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.gz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.lz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.tar.xz craftbukkit-5b2c774edc069f70d1fa9940d96bb0b8705bef7a.zip |
Update for Minecraft 1.8
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemHoe.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemHoe.java | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/main/java/net/minecraft/server/ItemHoe.java b/src/main/java/net/minecraft/server/ItemHoe.java index 08854516..318fcd75 100644 --- a/src/main/java/net/minecraft/server/ItemHoe.java +++ b/src/main/java/net/minecraft/server/ItemHoe.java @@ -15,33 +15,37 @@ public class ItemHoe extends Item { } public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) { - int i1 = world.getTypeId(i, j, k); - int j1 = world.getTypeId(i, j + 1, k); - - if ((l == 0 || j1 != 0 || i1 != Block.GRASS.id) && i1 != Block.DIRT.id) { + if (!entityhuman.c(i, j, k)) { return false; } else { - Block block = Block.SOIL; + int i1 = world.getTypeId(i, j, k); + int j1 = world.getTypeId(i, j + 1, k); - world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F); - if (world.isStatic) { - return true; + if ((l == 0 || j1 != 0 || i1 != Block.GRASS.id) && i1 != Block.DIRT.id) { + return false; } else { - CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit + Block block = Block.SOIL; - world.setTypeId(i, j, k, block.id); + world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), block.stepSound.getName(), (block.stepSound.getVolume1() + 1.0F) / 2.0F, block.stepSound.getVolume2() * 0.8F); + if (world.isStatic) { + return true; + } else { + CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); // CraftBukkit - // CraftBukkit start - Hoes - blockface -1 for 'SELF' - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k, block); + world.setTypeId(i, j, k, block.id); - if (event.isCancelled() || !event.canBuild()) { - event.getBlockPlaced().setTypeId(blockState.getTypeId()); - return false; - } - // CraftBukkit end + // CraftBukkit start - Hoes - blockface -1 for 'SELF' + BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k, block); - itemstack.damage(1, entityhuman); - return true; + if (event.isCancelled() || !event.canBuild()) { + event.getBlockPlaced().setTypeId(blockState.getTypeId()); + return false; + } + // CraftBukkit end + + itemstack.damage(1, entityhuman); + return true; + } } } } |