fixed a rare exception when modules calculate incorrect next nodes

closes #187
This commit is contained in:
Ell 2023-09-26 10:21:56 +02:00
parent f61178a098
commit f34c89f914

View file

@ -379,7 +379,7 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC
public int getNextNode(List<BlockPos> nodes, int index) {
return this.streamModules()
.map(m -> m.getRight().getCustomNextNode(m.getLeft(), this, nodes, index))
.filter(Objects::nonNull).findFirst().orElse(index);
.filter(m -> m != null && m >= 0).findFirst().orElse(index);
}
public List<ItemFilter> getFilters() {