From 97643d8ce0142684707eea6687ce72cb4a6c6d7c Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 17 May 2024 20:30:27 +0200 Subject: [PATCH] Adds condition to require exactly one exit point Note that Legacy didn't have a check because the actual exits were calculated based on the bottom opening blocks in order to center a leaving player. A warning would instead be displayed upon teleportation when a player tried to teleport to a Stargate with no exit. --- .../knarcraft/stargate/portal/property/gate/GateHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java b/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java index 6218b75..1616a21 100644 --- a/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java +++ b/src/main/java/net/knarcraft/stargate/portal/property/gate/GateHandler.java @@ -210,6 +210,10 @@ public class GateHandler { Stargate.logSevere(String.format(failString, "Gates must have exactly 2 control points.")); return false; } + + if (gate.getLayout().getExit() == null) { + Stargate.logSevere(String.format(failString, "Gates must have one specified exit point")); + } if (checkMaterialPredicateFail(gate.getPortalButtonMaterials(), MaterialHelper::isButtonCompatible)) { Stargate.logSevere(String.format(failString, "Gate button must be a type of button."));