diff options
author | feildmaster <admin@feildmaster.com> | 2012-12-01 00:22:01 -0600 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2012-12-01 01:14:25 -0600 |
commit | c596093c310c04f2522015ea1cb31ff90c83c95a (patch) | |
tree | ba67bbeb7fae4dc8611ebe775ec94191c179f5d8 /src/main/java | |
parent | 3404318bc54f9e1c502107cb60036a733e224971 (diff) | |
download | craftbukkit-c596093c310c04f2522015ea1cb31ff90c83c95a.tar craftbukkit-c596093c310c04f2522015ea1cb31ff90c83c95a.tar.gz craftbukkit-c596093c310c04f2522015ea1cb31ff90c83c95a.tar.lz craftbukkit-c596093c310c04f2522015ea1cb31ff90c83c95a.tar.xz craftbukkit-c596093c310c04f2522015ea1cb31ff90c83c95a.zip |
[BREAKING] Update BlockFace directions. Fixes BUKKIT-1567, BUKKIT-3069
The answer is 42
Diffstat (limited to 'src/main/java')
6 files changed, 31 insertions, 31 deletions
diff --git a/src/main/java/net/minecraft/server/BlockFlowing.java b/src/main/java/net/minecraft/server/BlockFlowing.java index 7a2cea99..1aacf9f9 100644 --- a/src/main/java/net/minecraft/server/BlockFlowing.java +++ b/src/main/java/net/minecraft/server/BlockFlowing.java @@ -134,7 +134,7 @@ public class BlockFlowing extends BlockFluids { } // CraftBukkit start - all four cardinal directions. Do not change the order! - BlockFace[] faces = new BlockFace[] { BlockFace.NORTH, BlockFace.SOUTH, BlockFace.EAST, BlockFace.WEST }; + BlockFace[] faces = new BlockFace[] { BlockFace.WEST, BlockFace.EAST, BlockFace.SOUTH, BlockFace.NORTH }; int index = 0; for (BlockFace currentFace : faces) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index 50d4834c..f14a8335 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -634,13 +634,13 @@ public abstract class Entity { org.bukkit.block.Block block = this.world.getWorld().getBlockAt(MathHelper.floor(this.locX), MathHelper.floor(this.locY - (double) this.height), MathHelper.floor(this.locZ)); if (d6 > d0) { - block = block.getRelative(BlockFace.SOUTH); + block = block.getRelative(BlockFace.EAST); } else if (d6 < d0) { - block = block.getRelative(BlockFace.NORTH); - } else if (d8 > d2) { block = block.getRelative(BlockFace.WEST); + } else if (d8 > d2) { + block = block.getRelative(BlockFace.NORTH); } else if (d8 < d2) { - block = block.getRelative(BlockFace.EAST); + block = block.getRelative(BlockFace.SOUTH); } VehicleBlockCollisionEvent event = new VehicleBlockCollisionEvent(vehicle, block); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java index 9a96e535..7de0de5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java @@ -18,7 +18,7 @@ public class CraftEffect { datavalue = ((Material) data).getId(); break; case SMOKE: - switch((BlockFace)data) { + switch((BlockFace) data) { // TODO: Verify (Where did these values come from...?) case SOUTH_EAST: datavalue = 0; break; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 79ae6d1b..f66aa0ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -952,17 +952,17 @@ public class CraftWorld implements World { } int dir; switch (face) { - case EAST: + case SOUTH: default: dir = 0; break; - case NORTH: + case WEST: dir = 1; break; - case WEST: + case NORTH: dir = 2; break; - case SOUTH: + case EAST: dir = 3; break; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 7f7a7fc5..a5c0bed8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -174,7 +174,7 @@ public class CraftBlock implements Block { } /** - * Notch uses a 0-5 to mean DOWN, UP, EAST, WEST, NORTH, SOUTH + * Notch uses a 0-5 to mean DOWN, UP, NORTH, SOUTH, WEST, EAST * in that order all over. This method is convenience to convert for us. * * @return BlockFace the BlockFace represented by this number @@ -186,13 +186,13 @@ public class CraftBlock implements Block { case 1: return BlockFace.UP; case 2: - return BlockFace.EAST; + return BlockFace.NORTH; case 3: - return BlockFace.WEST; + return BlockFace.SOUTH; case 4: - return BlockFace.NORTH; + return BlockFace.WEST; case 5: - return BlockFace.SOUTH; + return BlockFace.EAST; default: return BlockFace.SELF; } @@ -204,13 +204,13 @@ public class CraftBlock implements Block { return 0; case UP: return 1; - case EAST: + case NORTH: return 2; - case WEST: + case SOUTH: return 3; - case NORTH: + case WEST: return 4; - case SOUTH: + case EAST: return 5; default: return 7; // Good as anything here, but technically invalid @@ -312,10 +312,10 @@ public class CraftBlock implements Block { net.minecraft.server.World world = chunk.getHandle().world; if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.isBlockFacePowered(x, y - 1, z, 0)) power = wire.getPower(world, x, y - 1, z, power); if ((face == BlockFace.UP || face == BlockFace.SELF) && world.isBlockFacePowered(x, y + 1, z, 1)) power = wire.getPower(world, x, y + 1, z, power); - if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.isBlockFacePowered(x, y, z - 1, 2)) power = wire.getPower(world, x, y, z - 1, power); - if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.isBlockFacePowered(x, y, z + 1, 3)) power = wire.getPower(world, x, y, z + 1, power); - if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.isBlockFacePowered(x - 1, y, z, 4)) power = wire.getPower(world, x - 1, y, z, power); - if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.isBlockFacePowered(x + 1, y, z, 5)) power = wire.getPower(world, x + 1, y, z, power); + if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.isBlockFacePowered(x + 1, y, z, 2)) power = wire.getPower(world, x + 1, y, z, power); + if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.isBlockFacePowered(x - 1, y, z, 3)) power = wire.getPower(world, x - 1, y, z, power); + if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.isBlockFacePowered(x, y, z - 1, 4)) power = wire.getPower(world, x, y, z - 1, power); + if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.isBlockFacePowered(x, y, z + 1, 5)) power = wire.getPower(world, x, y, z - 1, power); return power > 0 ? power : (face == BlockFace.SELF ? isBlockIndirectlyPowered() : isBlockFaceIndirectlyPowered(face)) ? 15 : 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java index e2279e20..e51dddbd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHanging.java @@ -28,17 +28,17 @@ public class CraftHanging extends CraftEntity implements Hanging { hanging.y = block.getY(); hanging.z = block.getZ(); switch (face) { - case EAST: + case SOUTH: default: getHandle().setDirection(0); break; - case NORTH: + case WEST: getHandle().setDirection(1); break; - case WEST: + case NORTH: getHandle().setDirection(2); break; - case SOUTH: + case EAST: getHandle().setDirection(3); break; } @@ -57,13 +57,13 @@ public class CraftHanging extends CraftEntity implements Hanging { switch (this.getHandle().direction) { case 0: default: - return BlockFace.EAST; + return BlockFace.SOUTH; case 1: - return BlockFace.NORTH; - case 2: return BlockFace.WEST; + case 2: + return BlockFace.NORTH; case 3: - return BlockFace.SOUTH; + return BlockFace.EAST; } } |