From f759e0b60d3a575d31921c930e436af321b0e7e8 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Wed, 23 Feb 2011 02:37:56 +0000 Subject: Update to Minecraft 1.3 beta --- src/main/java/net/minecraft/server/ItemBlock.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/net/minecraft/server/ItemBlock.java') 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); -- cgit v1.2.3