mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-07 00:42:59 +00:00
Listen to correct block update
We now listen to neighborChanged instead of onNeighborChange. This means computers correctly detect redstone updates. However, this leads to issues when moving turtles, so we defer the block update until the turtle has finished moving.
This commit is contained in:
@@ -505,7 +505,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
}
|
||||
|
||||
// Create a new turtle
|
||||
if( world.isBlockLoaded( pos ) && world.setBlockState( pos, oldBlock.getDefaultState(), 3 ) )
|
||||
if( world.isBlockLoaded( pos ) && world.setBlockState( pos, oldBlock.getDefaultState(), 0 ) )
|
||||
{
|
||||
Block block = world.getBlockState( pos ).getBlock();
|
||||
if( block == oldBlock )
|
||||
@@ -525,6 +525,7 @@ public class TurtleBrain implements ITurtleAccess
|
||||
oldWorld.setBlockToAir( oldPos );
|
||||
|
||||
// Make sure everybody knows about it
|
||||
newTurtle.updateBlock();
|
||||
newTurtle.updateInput();
|
||||
newTurtle.updateOutput();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user