From 8bd5a0cae3fa7989ca78d9486c5b20ccfdefdfc5 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 9 May 2020 13:07:05 +0200 Subject: [PATCH] fixed single-pipe networks crashing Closes #10 --- src/main/java/de/ellpeck/prettypipes/network/PipeItem.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/de/ellpeck/prettypipes/network/PipeItem.java b/src/main/java/de/ellpeck/prettypipes/network/PipeItem.java index 81786b9..bad0e35 100644 --- a/src/main/java/de/ellpeck/prettypipes/network/PipeItem.java +++ b/src/main/java/de/ellpeck/prettypipes/network/PipeItem.java @@ -246,6 +246,13 @@ public class PipeItem implements INBTSerializable, ILiquidContainer Graph graph = path.getGraph(); List ret = new ArrayList<>(); List nodes = path.getVertexList(); + if (nodes.size() == 1) { + // add the single pipe twice if there's only one + // this is a dirty hack but it works fine so eh + for (int i = 0; i < 2; i++) + ret.add(nodes.get(0)); + return ret; + } for (int i = 0; i < nodes.size() - 1; i++) { BlockPos first = nodes.get(i); BlockPos second = nodes.get(i + 1);