Skip to content

Commit f58a9cd

Browse files
authored
Changed shouldCheckWeakPower to work around bug (#1331)
1 parent 5d380d4 commit f58a9cd

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/main/java/gregtech/api/block/machines/BlockMachine.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPo
315315

316316
@Override
317317
public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
318-
return true;
318+
// The check in World::getRedstonePower in the vanilla code base is reversed. Setting this to false will
319+
// actually cause getWeakPower to be called, rather than prevent it.
320+
return false;
319321
}
320322

321323
@Override

src/main/java/gregtech/api/pipenet/block/BlockPipe.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPo
140140

141141
@Override
142142
public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
143-
return true;
143+
// The check in World::getRedstonePower in the vanilla code base is reversed. Setting this to false will
144+
// actually cause getWeakPower to be called, rather than prevent it.
145+
return false;
144146
}
145147

146148
@Override

0 commit comments

Comments
 (0)