1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-16 15:53:18 +00:00

Pass the original block in redstone propagation

notifyBlockOfStateChange and notifyNeighborsOfStateExcept expect the
block which caused the redstone update, rather than the neighbor block.

Fixes #393
This commit is contained in:
SquidDev 2017-08-01 21:04:48 +01:00
parent 88b1124204
commit a2da6d9601
3 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ public abstract class TileComputerBase extends TileGeneric
unload();
for( EnumFacing dir : EnumFacing.VALUES )
{
RedstoneUtil.propogateRedstoneOutput( getWorld(), getPos(), dir );
RedstoneUtil.propagateRedstoneOutput( getWorld(), getPos(), dir );
}
}
@ -380,7 +380,7 @@ public abstract class TileComputerBase extends TileGeneric
updateBlock();
for( EnumFacing dir : EnumFacing.VALUES )
{
RedstoneUtil.propogateRedstoneOutput( getWorld(), getPos(), dir );
RedstoneUtil.propagateRedstoneOutput( getWorld(), getPos(), dir );
}
}

View File

@ -141,7 +141,7 @@ public class TileTurtle extends TileComputerBase
// Just turn off any redstone we had on
for( EnumFacing dir : EnumFacing.VALUES )
{
RedstoneUtil.propogateRedstoneOutput( getWorld(), getPos(), dir );
RedstoneUtil.propagateRedstoneOutput( getWorld(), getPos(), dir );
}
}
}

View File

@ -68,9 +68,9 @@ public class RedstoneUtil
return 0;
}
public static void propogateRedstoneOutput( World world, BlockPos pos, EnumFacing side )
public static void propagateRedstoneOutput( World world, BlockPos pos, EnumFacing side )
{
// Propogate ordinary output
// Propagate ordinary output
IBlockState block = world.getBlockState( pos );
BlockPos neighbourPos = pos.offset( side );
IBlockState neighbour = world.getBlockState( neighbourPos );
@ -79,7 +79,7 @@ public class RedstoneUtil
world.neighborChanged( neighbourPos, block.getBlock(), pos );
if( neighbour.getBlock().isNormalCube( neighbour, world, neighbourPos ) )
{
world.notifyNeighborsOfStateExcept( neighbourPos, neighbour.getBlock(), side.getOpposite() );
world.notifyNeighborsOfStateExcept( neighbourPos, block.getBlock(), side.getOpposite() );
}
}
}