Fixes #2551: Prevent chunk rebuilds when drive is unchanged.

(cherry picked from commit d7d99c5e7e)
This commit is contained in:
yueh 2016-11-01 18:22:35 +08:00 committed by xsun2001
parent c5bf7f6be3
commit 61fcc75a72

View file

@ -204,13 +204,15 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
private void recalculateDisplay() private void recalculateDisplay()
{ {
final boolean currentActive = this.getProxy().isActive(); final boolean currentActive = this.getProxy().isActive();
int newState = this.state;
if( currentActive ) if( currentActive )
{ {
this.state |= 0x80000000; newState |= 0x80000000;
} }
else else
{ {
this.state &= ~0x80000000; newState &= ~0x80000000;
} }
if( this.wasActive != currentActive ) if( this.wasActive != currentActive )
@ -228,12 +230,12 @@ public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPrior
for( int x = 0; x < this.getCellCount(); x++ ) for( int x = 0; x < this.getCellCount(); x++ )
{ {
this.state |= ( this.getCellStatus( x ) << ( 3 * x ) ); newState |= ( this.getCellStatus( x ) << ( 3 * x ) );
} }
final int oldState = 0; if( newState != this.state )
if( oldState != this.state )
{ {
this.state = newState;
this.markForUpdate(); this.markForUpdate();
} }
} }