public void JoinNetwork(MechanicalNetwork network) { this.network = network; network.Join(this); if (network == null) { NetworkId = 0; } else { NetworkId = network.networkId; } }
public virtual void JoinNetwork(MechanicalNetwork network) { if (this.network != null && this.network != network) { LeaveNetwork(); } if (this.network == null) { this.network = network; network?.Join(this); } if (network == null) { NetworkId = 0; } else { NetworkId = network.networkId; } Blockentity.MarkDirty(); }