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/ItemFlintAndSteel.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/ItemFlintAndSteel.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemFlintAndSteel.java | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java index 97cfddaa..56646bbb 100644 --- a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java +++ b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java @@ -43,38 +43,42 @@ public class ItemFlintAndSteel extends Item { ++i; } - int i1 = world.getTypeId(i, j, k); - - if (i1 == 0) { - // CraftBukkit start - store the clicked block - org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k); - Player thePlayer = (Player) entityhuman.getBukkitEntity(); - - BlockIgniteEvent eventIgnite = new BlockIgniteEvent(blockClicked, BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, thePlayer); - world.getServer().getPluginManager().callEvent(eventIgnite); - - if (eventIgnite.isCancelled()) { - itemstack.damage(1, entityhuman); - return false; + if (!entityhuman.c(i, j, k)) { + return false; + } else { + int i1 = world.getTypeId(i, j, k); + + if (i1 == 0) { + // CraftBukkit start - store the clicked block + org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k); + Player thePlayer = (Player) entityhuman.getBukkitEntity(); + + BlockIgniteEvent eventIgnite = new BlockIgniteEvent(blockClicked, BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, thePlayer); + world.getServer().getPluginManager().callEvent(eventIgnite); + + if (eventIgnite.isCancelled()) { + itemstack.damage(1, entityhuman); + return false; + } + + CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); + // CraftBukkit end + + world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "fire.ignite", 1.0F, b.nextFloat() * 0.4F + 0.8F); + world.setTypeId(i, j, k, Block.FIRE.id); + + // CraftBukkit start + BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, Block.FIRE.id); + + if (placeEvent.isCancelled() || !placeEvent.canBuild()) { + placeEvent.getBlockPlaced().setTypeIdAndData(0, (byte) 0, false); + return false; + } + // CraftBukkit end } - CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j, k); - // CraftBukkit end - - world.makeSound((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D, "fire.ignite", 1.0F, b.nextFloat() * 0.4F + 0.8F); - world.setTypeId(i, j, k, Block.FIRE.id); - - // CraftBukkit start - BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ, Block.FIRE.id); - - if (placeEvent.isCancelled() || !placeEvent.canBuild()) { - placeEvent.getBlockPlaced().setTypeIdAndData(0, (byte) 0, false); - return false; - } - // CraftBukkit end + itemstack.damage(1, entityhuman); + return true; } - - itemstack.damage(1, entityhuman); - return true; } } |