Fixed a massive console spam issue of Whitelisted Item Laser Relays trying to sync client->client

This commit is contained in:
Ellpeck 2016-05-13 16:58:16 +02:00
parent dcd41a016a
commit 41027a07c2
2 changed files with 10 additions and 6 deletions

View file

@ -176,9 +176,11 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{
}
public final void sendUpdate(){
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));
if(!this.worldObj.isRemote){
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));
}
}
}
}

View file

@ -356,9 +356,11 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{
public void updateEntity(){
super.updateEntity();
if((this.isLeftWhitelist != this.lastLeftWhitelist || this.isRightWhitelist != this.lastRightWhitelist) && this.sendUpdateWithInterval()){
this.lastLeftWhitelist = this.isLeftWhitelist;
this.lastRightWhitelist = this.isRightWhitelist;
if(!this.worldObj.isRemote){
if((this.isLeftWhitelist != this.lastLeftWhitelist || this.isRightWhitelist != this.lastRightWhitelist) && this.sendUpdateWithInterval()){
this.lastLeftWhitelist = this.isLeftWhitelist;
this.lastRightWhitelist = this.isRightWhitelist;
}
}
}
}