Skip to content

Commit ed1cba2

Browse files
committed
chore: Simplify energy conduit redstone check.
1 parent 2105029 commit ed1cba2

File tree

1 file changed

+2
-17
lines changed
  • enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/type/energy

1 file changed

+2
-17
lines changed

enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/type/energy/EnergyConduit.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,8 @@ public Comparator<ConduitBlockConnection> getGeneralConnectionComparator() {
113113
return null;
114114
}
115115

116-
if (config.extractRedstoneControl() == RedstoneControl.NEVER_ACTIVE) {
117-
isMutable = false;
118-
} else if (config.extractRedstoneControl() != RedstoneControl.ALWAYS_ACTIVE) {
119-
boolean hasRedstone = node.hasRedstoneSignal(config.extractRedstoneChannel());
120-
if (!hasRedstone) {
121-
for (Direction direction : Direction.values()) {
122-
if (level.getSignal(node.pos().relative(direction), direction.getOpposite()) > 0) {
123-
hasRedstone = true;
124-
break;
125-
}
126-
}
127-
}
128-
129-
if (!hasRedstone) {
130-
isMutable = false;
131-
}
132-
}
116+
boolean hasRedstoneSignal = node.hasRedstoneSignal(config.extractRedstoneChannel());
117+
isMutable = config.extractRedstoneControl().isActive(hasRedstoneSignal);
133118
}
134119

135120
// noinspection unchecked

0 commit comments

Comments
 (0)