diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-02-23 02:37:56 +0000 |
commit | f759e0b60d3a575d31921c930e436af321b0e7e8 (patch) | |
tree | 4b1eb7ac01670854c686b1f6faa2f97ff337f7d7 /src/main/java/net/minecraft/server/ItemBlock.java | |
parent | a124bfdab59cc9a9d8369425027e61eccd1d62fb (diff) | |
download | craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.gz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.lz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.tar.xz craftbukkit-f759e0b60d3a575d31921c930e436af321b0e7e8.zip |
Update to Minecraft 1.3 beta
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemBlock.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemBlock.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 7c182e90..d16e1454 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -67,12 +67,12 @@ public class ItemBlock extends Item { /* We store the old data so we can undo it. Snow(78) and half-steps(44) are special in that they replace the block itself, * rather than the block touching the face we clicked on. */ - int typeId = blockClicked.getTypeId(); + int typeId = blockClicked.getTypeId(); org.bukkit.block.Block replacedBlock = blockClicked.getFace(faceClicked); if (typeId == Block.SNOW.id || (typeId == Block.STEP.id && itemstack.id == Block.STEP.id && faceClicked == BlockFace.UP)) replacedBlock = blockClicked; - + final BlockState replacedBlockState = new CraftBlockState(replacedBlock); // CraftBukkit end @@ -95,9 +95,13 @@ public class ItemBlock extends Item { org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack); Player thePlayer = (entityhuman ==null) ? null : (Player) entityhuman.getBukkitEntity(); - int distanceFromSpawn = (int) Math.max(Math.abs(i - world.spawnX), Math.abs(k - world.spawnZ)); + ChunkCoordinates chunkcoordinates = world.l(); + int spawnX = chunkcoordinates.a; + int spawnZ = chunkcoordinates.c; + + int distanceFromSpawn = (int) Math.max(Math.abs(i - spawnX), Math.abs(k - spawnZ)); - boolean canBuild = distanceFromSpawn > ((WorldServer) world).D.spawnProtection || thePlayer.isOp(); // CraftBukkit Configurable spawn protection start + boolean canBuild = distanceFromSpawn > ((WorldServer) world).x.spawnProtection || thePlayer.isOp(); // CraftBukkit Configurable spawn protection start BlockPlaceEvent event = new BlockPlaceEvent(eventType, placedBlock, replacedBlockState, blockClicked, itemInHand, thePlayer, canBuild); server.getPluginManager().callEvent(event); |