1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +00:00

Prevent wired modems dropping on block change

Fixes #303
This commit is contained in:
SquidDev 2019-10-01 20:06:38 +01:00
parent 81f85361d5
commit d342a1f368
2 changed files with 2 additions and 3 deletions

View File

@ -210,7 +210,7 @@ public boolean isValidPosition( BlockState state, IWorldReader world, BlockPos p
BlockPos offsetPos = pos.offset( facing ); BlockPos offsetPos = pos.offset( facing );
BlockState offsetState = world.getBlockState( offsetPos ); BlockState offsetState = world.getBlockState( offsetPos );
return Block.hasSolidSide( offsetState, world, offsetPos, facing.getOpposite() ); return hasSolidSide( offsetState, world, offsetPos, facing.getOpposite() );
} }
@Nullable @Nullable

View File

@ -201,8 +201,7 @@ private Direction getDirection()
public void onNeighbourChange( @Nonnull BlockPos neighbour ) public void onNeighbourChange( @Nonnull BlockPos neighbour )
{ {
Direction dir = getDirection(); Direction dir = getDirection();
if( neighbour.equals( getPos().offset( dir ) ) && hasModem() if( neighbour.equals( getPos().offset( dir ) ) && hasModem() && !getBlockState().isValidPosition( getWorld(), getPos() ) )
&& getBlockState().isValidPosition( world, pos ) )
{ {
if( hasCable() ) if( hasCable() )
{ {