fix relay fixes #3138

This commit is contained in:
Darkere
2021-11-22 18:50:37 +01:00
parent 88bddb9b94
commit fb95d566de
3 changed files with 14 additions and 2 deletions

View File

@@ -96,11 +96,18 @@ public interface INetworkNode {
* @param direction the direction * @param direction the direction
* @return whether a network signal can be conducted in the given direction. * @return whether a network signal can be conducted in the given direction.
*/ */
default boolean canConduct(Direction direction) { default boolean canConduct(Direction direction) {
return true; return true;
} }
/**
* @param direction the direction
* @return whether the network node can receiver network connections from this side
*/
default boolean canReceive(Direction direction) {
return canConduct(direction);
}
/** /**
* @param owner the owner * @param owner the owner
*/ */

View File

@@ -238,7 +238,7 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor {
if (oppositeNode == null) { if (oppositeNode == null) {
continue; continue;
} }
if (canConduct(facing) && oppositeNode.canConduct(facing.getOpposite())) { if (canConduct(facing) && oppositeNode.canReceive(facing.getOpposite())) {
operator.apply(world, pos.offset(facing), facing.getOpposite()); operator.apply(world, pos.offset(facing), facing.getOpposite());
} }
} }

View File

@@ -41,6 +41,11 @@ public class RelayNetworkNode extends NetworkNode {
return canUpdate(); return canUpdate();
} }
@Override
public boolean canReceive(Direction direction) {
return true;
}
@Override @Override
public boolean shouldRebuildGraphOnChange() { public boolean shouldRebuildGraphOnChange() {
return true; return true;