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(){ public final void sendUpdate(){
if(!this.worldObj.isRemote){
NBTTagCompound compound = this.getSyncCompound(); NBTTagCompound compound = this.getSyncCompound();
if(compound != null){ 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)); 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,12 +356,14 @@ public abstract class TileEntityLaserRelay extends TileEntityBase{
public void updateEntity(){ public void updateEntity(){
super.updateEntity(); super.updateEntity();
if(!this.worldObj.isRemote){
if((this.isLeftWhitelist != this.lastLeftWhitelist || this.isRightWhitelist != this.lastRightWhitelist) && this.sendUpdateWithInterval()){ if((this.isLeftWhitelist != this.lastLeftWhitelist || this.isRightWhitelist != this.lastRightWhitelist) && this.sendUpdateWithInterval()){
this.lastLeftWhitelist = this.isLeftWhitelist; this.lastLeftWhitelist = this.isLeftWhitelist;
this.lastRightWhitelist = this.isRightWhitelist; this.lastRightWhitelist = this.isRightWhitelist;
} }
} }
} }
}
public static class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements IEnergyReceiver{ public static class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements IEnergyReceiver{