1
0
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:
SquidDev
2017-05-01 15:26:38 +01:00
parent 9b5f4a877c
commit 77d225d1fe
3 changed files with 38 additions and 12 deletions

View File

@@ -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;