From 62c0d71e1448a93129d011ac29f98aefaf4d6f65 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 22 Nov 2024 17:54:17 -0800 Subject: [PATCH] Prevent an error throw with UNKNOWN Relates to https://github.com/BentoBoxWorld/Boxed/issues/101 --- .../listeners/teleports/PlayerTeleportListener.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/listeners/teleports/PlayerTeleportListener.java b/src/main/java/world/bentobox/bentobox/listeners/teleports/PlayerTeleportListener.java index b461e942e..c764d0012 100644 --- a/src/main/java/world/bentobox/bentobox/listeners/teleports/PlayerTeleportListener.java +++ b/src/main/java/world/bentobox/bentobox/listeners/teleports/PlayerTeleportListener.java @@ -78,7 +78,13 @@ public class PlayerTeleportListener extends AbstractTeleportListener implements { case NETHER_PORTAL -> this.portalProcess(event, World.Environment.NETHER); case END_PORTAL, END_GATEWAY -> this.portalProcess(event, World.Environment.THE_END); - default -> throw new IllegalArgumentException("Unexpected value: " + event.getCause()); + default -> { // Do nothing, ignore + + } + /* + * Other potential reasons: CHORUS_FRUIT , COMMAND, DISMOUNT, + * ENDER_PEARL, EXIT_BED, PLUGIN, SPECTATE , UNKNOWN + */ } }