diff --git a/tconstruct/blocks/RedstoneMachine.java b/tconstruct/blocks/RedstoneMachine.java index 22860981..be18ac02 100644 --- a/tconstruct/blocks/RedstoneMachine.java +++ b/tconstruct/blocks/RedstoneMachine.java @@ -56,7 +56,7 @@ public class RedstoneMachine extends InventoryBlock } return super.getLightValue(world, x, y, z); } - + @Override @SideOnly(Side.CLIENT) public int colorMultiplier (IBlockAccess world, int x, int y, int z) @@ -72,7 +72,7 @@ public class RedstoneMachine extends InventoryBlock return Block.blocksList[stack.itemID].colorMultiplier(world, x, y, z); } } - + return 0xffffff; } diff --git a/tconstruct/blocks/logic/DrawbridgeLogic.java b/tconstruct/blocks/logic/DrawbridgeLogic.java index 1544b2c8..06d4ce77 100644 --- a/tconstruct/blocks/logic/DrawbridgeLogic.java +++ b/tconstruct/blocks/logic/DrawbridgeLogic.java @@ -34,6 +34,7 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { super(2); } + @Override public void setWorldObj (World par1World) { @@ -110,14 +111,14 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc } } } - + /* 0 = Up * 1 = Right * 2 = Down * 3 = Left * 4 = Center, neutral */ - public void setPlacementDirection(byte keycode) + public void setPlacementDirection (byte keycode) { if (keycode == 4) { @@ -128,13 +129,20 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { switch (keycode) { - case 0: fakePlayer.rotationYaw = 0; break; - case 1: fakePlayer.rotationYaw = 90; break; - case 2: fakePlayer.rotationYaw = 180; break; - case 3: fakePlayer.rotationYaw = 270; break; + case 0: + fakePlayer.rotationYaw = 0; + break; + case 1: + fakePlayer.rotationYaw = 90; + break; + case 2: + fakePlayer.rotationYaw = 180; + break; + case 3: + fakePlayer.rotationYaw = 270; + break; } - - + if (this.direction == 0) fakePlayer.rotationPitch = -90; else @@ -145,7 +153,7 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc if (keycode % 2 == 0) { fakePlayer.rotationYaw = mapDirection() * 90; - + if (keycode == 0) fakePlayer.rotationPitch = 90; else @@ -154,25 +162,25 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc else { fakePlayer.rotationPitch = 0; - + int facing = mapDirection(); if (keycode == 1) facing += 1; else facing -= 1; - + if (facing >= 4) facing = 0; if (facing < 0) facing = 3; - + fakePlayer.rotationYaw = facing * 90; } - } + } placementDirection = keycode; } - - int mapDirection() + + int mapDirection () { if (this.direction == 2) //North return 0; @@ -180,14 +188,9 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc return 1; if (this.direction == 3) //South return 2; - + return 3; //West } - - public byte getFacingDirection() - { - return placementDirection; - } public byte getPlacementDirection () { diff --git a/tconstruct/items/blocks/GlassBlockItem.java b/tconstruct/items/blocks/GlassBlockItem.java index 1d5cbca7..f3525efd 100644 --- a/tconstruct/items/blocks/GlassBlockItem.java +++ b/tconstruct/items/blocks/GlassBlockItem.java @@ -51,6 +51,24 @@ public class GlassBlockItem extends ItemBlock if (camo != null) list.add("Camoflauge: " + camo.getDisplayName()); } + + if (stack.getTagCompound().hasKey("Placement")) + { + String string = getDirectionString(stack.getTagCompound().getByte("Placement")); + list.add("Placement Direction: " + string); + } } } + + String getDirectionString(byte key) + { + if (key == 0) + return ("Up"); + if (key == 1) + return ("Right"); + if (key == 2) + return ("Down"); + + return "Left"; + } }