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.
This commit is contained in:
2024-05-17 20:30:27 +02:00
parent 905aec8101
commit 97643d8ce0

View File

@@ -211,6 +211,10 @@ public class GateHandler {
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."));
return false;