From c33fc73f3ae2cc8737e70a755fa5364b73d9a44f Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 12 Aug 2022 20:50:48 +0200 Subject: [PATCH] Discomportulated - Potential fix for spout ponder crash with other mods installed - Fixed train navigation not behaving correctly near portals --- .../components/structureMovement/Contraption.java | 2 +- .../content/contraptions/fluids/actors/SpoutTileEntity.java | 2 ++ .../create/content/logistics/trains/entity/Navigation.java | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index ae1c164be..592fe6307 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -1022,7 +1022,7 @@ public abstract class Contraption { .isEmpty() && !blockState.getCollisionShape(world, targetPos) .isEmpty())) { - if (targetPos.getY() == 0) + if (targetPos.getY() == world.getMinBuildHeight()) targetPos = targetPos.above(); world.levelEvent(2001, targetPos, Block.getId(state)); Block.dropResources(state, world, targetPos, null); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java index db8ce23ba..56525f5f5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java @@ -76,6 +76,8 @@ public class SpoutTileEntity extends SmartTileEntity implements IHaveGoggleInfor protected ProcessingResult onItemReceived(TransportedItemStack transported, TransportedItemStackHandlerBehaviour handler) { + if (handler.tileEntity.isVirtual()) + return PASS; if (!FillingBySpout.canItemBeFilled(level, transported.stack)) return PASS; if (tank.isEmpty()) diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java index dfba07f87..5c2d68d6a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/entity/Navigation.java @@ -644,9 +644,13 @@ public class Navigation { List> validTargets = new ArrayList<>(); Map connectionsFrom = graph.getConnectionsFrom(node2); - for (Entry connection : connectionsFrom.entrySet()) + for (Entry connection : connectionsFrom.entrySet()) { + TrackNode newNode = connection.getKey(); + if (newNode == node1) + continue; if (edge.canTravelTo(connection.getValue())) validTargets.add(connection); + } if (validTargets.isEmpty()) continue;