From 2c5dd11c62fdac5a5841318411fd09b54606e3cd Mon Sep 17 00:00:00 2001 From: FeepingCreature Date: Sun, 16 Jan 2011 06:59:51 +0800 Subject: [PATCH] Cleared up spawn distance calculation. --- src/main/java/net/minecraft/server/ItemBlock.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index 4581d23efe..f7da7c163d 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -71,12 +71,7 @@ public class ItemBlock extends Item { CraftItemStack itemInHand = new CraftItemStack(itemstack); CraftPlayer thePlayer = new CraftPlayer(((WorldServer) world).getServer(), (EntityPlayerMP) entityplayer); - int xFromSpawn = (int) MathHelper.e(i - world.m); - int distanceFromSpawn = (int) MathHelper.e(k - world.o); - - if (xFromSpawn > distanceFromSpawn) { - distanceFromSpawn = xFromSpawn; - } + int distanceFromSpawn = (int) Math.max(Math.abs(i - world.m), Math.abs(k - world.o)); // CraftBukkit hardcoded Spawn distance for now boolean canBuild = distanceFromSpawn > 16 || thePlayer.isOp();