fix relay fixes #3138
This commit is contained in:
@@ -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
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user