mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-10 07:45:05 -04:00
parent
f38de55699
commit
93d72aaa59
@ -36,7 +36,12 @@ trait Node extends ImmutableNode {
|
|||||||
if (network == null) Iterable.empty[ImmutableNode].toSeq
|
if (network == null) Iterable.empty[ImmutableNode].toSeq
|
||||||
else network.neighbors(this)
|
else network.neighbors(this)
|
||||||
|
|
||||||
def connect(node: ImmutableNode) = network.connect(this, node)
|
// a node should be added to a network before it can connect to a node
|
||||||
|
// but, sometimes other mods try to create nodes and connect them before
|
||||||
|
// the network is ready. we dont those things to crash here
|
||||||
|
// with typical nodes we are talking about components here
|
||||||
|
// which will be connected anyways when the network is created
|
||||||
|
def connect(node: ImmutableNode): Unit = if (network != null) network.connect(this, node)
|
||||||
|
|
||||||
def disconnect(node: ImmutableNode) =
|
def disconnect(node: ImmutableNode) =
|
||||||
if (network != null && isInSameNetwork(node)) network.disconnect(this, node)
|
if (network != null && isInSameNetwork(node)) network.disconnect(this, node)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user