From 5208ad0b98cf8b5171396706be70db335c380fb0 Mon Sep 17 00:00:00 2001 From: SquidDev Date: Thu, 15 Feb 2018 17:56:08 +0000 Subject: [PATCH] Fix wireless modems suffocating entities As of #458, BlockPeripheral will act as a full/opaque block for some peripherals and a transparent one for others. However, some Block methods use the default state rather than the current one. This means modems report being a full block when they are not, leading to suffocating entities and lighting glitches. --- .../peripheral/common/BlockPeripheral.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java index 34ff51ee5..9c589eec2 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/common/BlockPeripheral.java @@ -638,4 +638,20 @@ public class BlockPeripheral extends BlockPeripheralBase { return isOpaqueCube( state ) ? BlockFaceShape.SOLID : BlockFaceShape.UNDEFINED; } + + @Override + @Deprecated + public boolean causesSuffocation(IBlockState state) + { + // This normally uses the default state + return blockMaterial.blocksMovement() && state.isOpaqueCube(); + } + + @Override + @Deprecated + public int getLightOpacity( IBlockState state ) + { + // This normally uses the default state + return isOpaqueCube( state ) ? 255 : 0; + } }