Skip to content

Commit

Permalink
fix xor gate sync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jul 24, 2018
1 parent f98fb95 commit befd410
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ public SPacketUpdateTileEntity getUpdatePacket() {
@Override
public void handleUpdateTag(NBTTagCompound tag) {
readFromNBT(tag);
IBlockState state = world.getBlockState(pos);
getWorld().markAndNotifyBlock(pos, world.getChunk(pos), state, state, 1 | 2 | 16);
if (lastBooleanMode!=booleanMode) {
world.markBlockRangeForRenderUpdate(pos, pos);
lastBooleanMode = booleanMode;
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ public SPacketUpdateTileEntity getUpdatePacket() {
@Override
public void handleUpdateTag(NBTTagCompound tag) {
readFromNBT(tag);
IBlockState state = world.getBlockState(pos);
getWorld().markAndNotifyBlock(pos, world.getChunk(pos), state, state, 1 | 2 | 16);
if (lastBooleanMode!=booleanMode) {
world.markBlockRangeForRenderUpdate(pos, pos);
lastBooleanMode = booleanMode;
}
}

@Override
Expand All @@ -184,7 +186,7 @@ public void markDirty() {
if (!hasWorld() || getWorld().isRemote) return;

if (isActive()!=lastActive
||valLeft!=lastValLeft
|| valLeft!=lastValLeft
|| valRight!=lastValRight
|| booleanMode!=lastBooleanMode) { //Throttle updates - only send when something important changes

Expand Down Expand Up @@ -220,7 +222,7 @@ public void markDirty() {
lastActive = isActive();
lastValLeft = valLeft;
lastValRight = valRight;
booleanMode = lastBooleanMode;
lastBooleanMode = booleanMode;

}
}
Expand Down

0 comments on commit befd410

Please sign in to comment.