From f0886e3785a9a542996d9ed87ab1e9f5b8a2630d Mon Sep 17 00:00:00 2001 From: fuj1n Date: Fri, 12 Jul 2013 15:29:31 +1000 Subject: [PATCH 1/4] Made the block mimic the light value of the camo block. --- .../tinker/tconstruct/blocks/RedstoneMachine.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/tinker/tconstruct/blocks/RedstoneMachine.java b/mods/tinker/tconstruct/blocks/RedstoneMachine.java index 377293b1..1a5dcfa8 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneMachine.java +++ b/mods/tinker/tconstruct/blocks/RedstoneMachine.java @@ -34,6 +34,19 @@ public class RedstoneMachine extends InventoryBlock setStepSound(soundMetalFootstep); } + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) { + TileEntityLandmine te = (TileEntityLandmine) world.getBlockTileEntity(x, y, z); + + if(te != null){ + if(te.getStackInSlot(3) != null){ + return lightValue[te.getStackInSlot(1).itemID]; + } + } + + return super.getLightValue(world, x, y, z); + } + @Override public TileEntity createTileEntity (World world, int metadata) { @@ -197,7 +210,7 @@ public class RedstoneMachine extends InventoryBlock /* Redstone */ public boolean canConnectRedstone (IBlockAccess world, int x, int y, int z, int side) { - return false; + return true; } public void onNeighborBlockChange (World world, int x, int y, int z, int neighborBlockID) From 677227fefacb13153c8c443a6eb8c3e2ad0a3706 Mon Sep 17 00:00:00 2001 From: fuj1n Date: Fri, 12 Jul 2013 15:32:39 +1000 Subject: [PATCH 2/4] Made the block get updated on inventory change. --- mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java index 48faecf1..e21abcbf 100644 --- a/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java +++ b/mods/tinker/tconstruct/blocks/logic/DrawbridgeLogic.java @@ -354,4 +354,10 @@ public class DrawbridgeLogic extends InventoryLogic implements IFacingLogic, IAc { return extension != 0; } + + @Override + public void onInventoryChanged() { + super.onInventoryChanged(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } From 7abe5cef86e3cc87e2aa8b83750ac10baaccf91c Mon Sep 17 00:00:00 2001 From: fuj1n Date: Fri, 12 Jul 2013 15:41:40 +1000 Subject: [PATCH 3/4] Update RedstoneMachine.java --- mods/tinker/tconstruct/blocks/RedstoneMachine.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mods/tinker/tconstruct/blocks/RedstoneMachine.java b/mods/tinker/tconstruct/blocks/RedstoneMachine.java index 1a5dcfa8..894d7d06 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneMachine.java +++ b/mods/tinker/tconstruct/blocks/RedstoneMachine.java @@ -36,14 +36,15 @@ public class RedstoneMachine extends InventoryBlock @Override public int getLightValue(IBlockAccess world, int x, int y, int z) { - TileEntityLandmine te = (TileEntityLandmine) world.getBlockTileEntity(x, y, z); - - if(te != null){ - if(te.getStackInSlot(3) != null){ - return lightValue[te.getStackInSlot(1).itemID]; + if(world.getBlockMetadata(x, y, z) == 0){ + DrawbridgeLogic te = (DrawbridgeLogic) world.getBlockTileEntity(x, y, z); + + if(te != null){ + if(te.getStackInSlot(3) != null){ + return lightValue[te.getStackInSlot(1).itemID]; + } } } - return super.getLightValue(world, x, y, z); } From 3fa1f1354ab6da949d46a2ac4efbb1ac98de7d2c Mon Sep 17 00:00:00 2001 From: fuj1n Date: Fri, 12 Jul 2013 15:44:29 +1000 Subject: [PATCH 4/4] Update RedstoneMachine.java --- mods/tinker/tconstruct/blocks/RedstoneMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/tinker/tconstruct/blocks/RedstoneMachine.java b/mods/tinker/tconstruct/blocks/RedstoneMachine.java index 894d7d06..6b70ea5a 100644 --- a/mods/tinker/tconstruct/blocks/RedstoneMachine.java +++ b/mods/tinker/tconstruct/blocks/RedstoneMachine.java @@ -211,7 +211,7 @@ public class RedstoneMachine extends InventoryBlock /* Redstone */ public boolean canConnectRedstone (IBlockAccess world, int x, int y, int z, int side) { - return true; + return false; } public void onNeighborBlockChange (World world, int x, int y, int z, int neighborBlockID)