summaryrefslogtreecommitdiffstats
path: root/src/main/java/net
diff options
context:
space:
mode:
authorFeepingCreature <default_357-line@yahoo.de>2011-01-16 06:59:51 +0800
committerDinner Bone <dinnerbone@dinnerbone.com>2011-01-20 08:58:08 +0800
commit2c5dd11c62fdac5a5841318411fd09b54606e3cd (patch)
treea9bc55a74a0366dbe45e68ab5ec3a8ed5e7ea3e5 /src/main/java/net
parent0e821e60c9412e5d0d84f8d32de46e7a3de6c837 (diff)
downloadcraftbukkit-2c5dd11c62fdac5a5841318411fd09b54606e3cd.tar
craftbukkit-2c5dd11c62fdac5a5841318411fd09b54606e3cd.tar.gz
craftbukkit-2c5dd11c62fdac5a5841318411fd09b54606e3cd.tar.lz
craftbukkit-2c5dd11c62fdac5a5841318411fd09b54606e3cd.tar.xz
craftbukkit-2c5dd11c62fdac5a5841318411fd09b54606e3cd.zip
Cleared up spawn distance calculation.
Diffstat (limited to 'src/main/java/net')
-rw-r--r--src/main/java/net/minecraft/server/ItemBlock.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
index 4581d23e..f7da7c16 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();