1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 11:10:29 +00:00

Fix various tile entities not syncing correctly

This ensures the tile state is sent and received when it changes. This
fixes turtles facing the wrong direction and computers not turning on.
This commit is contained in:
SquidDev 2017-05-01 15:13:42 +01:00
parent 43d68db349
commit 34cb75dfc3

View File

@ -65,9 +65,11 @@ public abstract class TileGeneric extends TileEntity
public final void updateBlock()
{
markDirty();
BlockPos pos = getPos();
IBlockState state = worldObj.getBlockState( pos );
worldObj.markBlockRangeForRenderUpdate( pos, pos );
worldObj.markChunkDirty( pos, this );
worldObj.notifyBlockUpdate( getPos(), state, state, 3 );
}
protected final void setBlockState( IBlockState newState )
@ -208,4 +210,19 @@ public abstract class TileGeneric extends TileEntity
}
}
}
@Override
public NBTTagCompound getUpdateTag ()
{
NBTTagCompound tag = super.getUpdateTag();
writeDescription( tag );
return tag;
}
@Override
public void handleUpdateTag (NBTTagCompound tag)
{
super.handleUpdateTag(tag);
readDescription( tag );
}
}