From c88c1788a07d5dafa9726d43035eacf1fae04714 Mon Sep 17 00:00:00 2001 From: Gibson Pilconis Date: Sat, 8 Jun 2024 10:17:02 -0400 Subject: [PATCH] fix versions before 1.16.1 --- .../essentials/spawn/EssentialsSpawnPlayerListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/EssentialsSpawn/src/main/java/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java b/EssentialsSpawn/src/main/java/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java index a0c5ca1f6a2..3d060fa4d16 100644 --- a/EssentialsSpawn/src/main/java/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java +++ b/EssentialsSpawn/src/main/java/com/earth2me/essentials/spawn/EssentialsSpawnPlayerListener.java @@ -48,7 +48,11 @@ void onPlayerRespawn(final PlayerRespawnEvent event) { (!VersionUtil.getServerBukkitVersion().isHigherThanOrEqualTo(VersionUtil.v1_16_1_R01) || (!event.isAnchorSpawn() || ess.getSettings().isRespawnAtAnchor()))) { // cannot nuke this sync load due to the event being sync so it would hand either way - respawnLocation = user.getBase().getRespawnLocation(); + try { + respawnLocation = user.getBase().getRespawnLocation(); + } catch (NoSuchMethodError e) { // For versions prior to 1.16. + respawnLocation = user.getBase().getBedSpawnLocation(); + } } if (respawnLocation != null) {