fix more edge cases in redstone handling

This commit is contained in:
asiekierka 2014-10-29 21:05:47 +01:00
parent 10e789446b
commit 0e6a4efddf

View file

@ -662,8 +662,13 @@ public class BlockGenericPipe extends BlockBuildCraft {
for (int i = 0; i < ForgeDirection.VALID_DIRECTIONS.length; i++) {
ForgeDirection d = ForgeDirection.getOrientation(i);
pipe.container.redstoneInputSide[i] = Math.max(
world.getIndirectPowerLevelTo(x + d.offsetX, y + d.offsetY, z + d.offsetZ, i),
world.getIndirectPowerLevelTo(x + d.offsetX, y + d.offsetY - 1, z + d.offsetZ, i)
world.isBlockProvidingPowerTo(x + d.offsetX, y + d.offsetY, z + d.offsetZ, i),
Math.max(
world.getIndirectPowerLevelTo(x + d.offsetX, y + d.offsetY, z + d.offsetZ, i),
world.getBlock(x + d.offsetX, y + d.offsetY - 1, z + d.offsetZ).isNormalCube()
? world.getIndirectPowerLevelTo(x + d.offsetX, y + d.offsetY - 1, z + d.offsetZ, i)
: 0
)
);
if (pipe.container.redstoneInput < pipe.container.redstoneInputSide[i]) {
pipe.container.redstoneInput = pipe.container.redstoneInputSide[i];