mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 07:13:28 +01:00
Make tile entity updating not send null packets causing console spam
This commit is contained in:
parent
3ad6b1c7cb
commit
dcd41a016a
2 changed files with 7 additions and 4 deletions
|
@ -35,9 +35,9 @@ public class PacketUpdateTileEntity implements IMessage{
|
|||
|
||||
}
|
||||
|
||||
public PacketUpdateTileEntity(TileEntityBase tile){
|
||||
this.compound = tile.getSyncCompound();
|
||||
this.pos = tile.getPos();
|
||||
public PacketUpdateTileEntity(NBTTagCompound compound, BlockPos pos){
|
||||
this.compound = compound;
|
||||
this.pos = pos;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -176,6 +176,9 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{
|
|||
}
|
||||
|
||||
public final void sendUpdate(){
|
||||
PacketHandler.theNetwork.sendToAllAround(new PacketUpdateTileEntity(this), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 64));
|
||||
NBTTagCompound compound = this.getSyncCompound();
|
||||
if(compound != null){
|
||||
PacketHandler.theNetwork.sendToAllAround(new PacketUpdateTileEntity(compound, this.getPos()), new NetworkRegistry.TargetPoint(this.worldObj.provider.getDimension(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), 64));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue