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:
parent
43d68db349
commit
34cb75dfc3
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user