private void networkLogic(TileEntity that)
{
if (that instanceof INetworkProvider)
{
INetworkProvider thatN = (INetworkProvider) that;
if (this.getNetwork() != null && thatN.getNetwork() != null)
{
this.getNetwork().merge(thatN.getNetwork());
}
else if (this.getNetwork() == null && thatN.getNetwork() != null)
{
this.setNetwork(thatN.getNetwork());
}
else if (this.getNetwork() != null && thatN.getNetwork() == null)
{
thatN.setNetwork(this.getNetwork());
}
}
if (that instanceof IHiveNetworkMember)
{
IHiveNetworkMember thatN = (IHiveNetworkMember) that;
if (this.getHiveNetwork() != null && thatN.getHiveNetwork() != null)
{
this.getHiveNetwork().merge(thatN.getHiveNetwork());
}
else if (this.getHiveNetwork() == null && thatN.getHiveNetwork() != null)
{
this.setHiveNetwork(thatN.getHiveNetwork(), false);
}
else if (this.getHiveNetwork() != null && thatN.getHiveNetwork() == null)
{
thatN.setHiveNetwork(this.getHiveNetwork(), false);
}
}
}