From ae584fce2f059886c49d5d42aa18b2d7a94fbeae Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 31 Oct 2015 14:42:51 +0100 Subject: [PATCH] Fix a Crash on Server with the Laser Relay /derp --- .../tile/TileEntityLaserRelay.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java index 59c23d9ce..eb2a6f761 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityLaserRelay.java @@ -87,14 +87,18 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ - NBTTagCompound compound = pkt.func_148857_g(); + if(pkt != null){ + NBTTagCompound compound = pkt.func_148857_g(); - LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(new WorldPos(this.worldObj, this.xCoord, this.yCoord, this.zCoord)); + if(compound != null){ + LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(new WorldPos(this.worldObj, this.xCoord, this.yCoord, this.zCoord)); - NBTTagList list = compound.getTagList("Connections", 10); - for(int i = 0; i < list.tagCount(); i++){ - LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); - LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); + NBTTagList list = compound.getTagList("Connections", 10); + for(int i = 0; i < list.tagCount(); i++){ + LaserRelayConnectionHandler.ConnectionPair pair = LaserRelayConnectionHandler.ConnectionPair.readFromNBT(list.getCompoundTagAt(i)); + LaserRelayConnectionHandler.getInstance().addConnection(pair.firstRelay, pair.secondRelay); + } + } } }