mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 00:38:35 +01:00
Fix a Crash on Server with the Laser Relay /derp
This commit is contained in:
parent
c753104586
commit
ae584fce2f
1 changed files with 10 additions and 6 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue