From 3e971c3dfd8cceb503e2e9625457f546c07f0b4f Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Fri, 13 Oct 2023 19:38:46 +0800 Subject: [PATCH] Fix LoginLocationFixListener throws error on legacy versions --- .../fr/xephi/authme/listener/LoginLocationFixListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java index 067a7672..ab090208 100644 --- a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java +++ b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java @@ -24,9 +24,10 @@ public class LoginLocationFixListener implements Listener{ public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); if (!authmeApi.isRegistered(player.getName()) || !authmeApi.isAuthenticated(player)) { + Material material = Material.getMaterial("PORTAL") != null || Material.getMaterial("PORTAL_BLOCK") != null ? Material.LEGACY_PORTAL : Material.getMaterial("NETHER_PORTAL") != null ? Material.NETHER_PORTAL : null; Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5); if (AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) { - if (!JoinLocation.getBlock().getType().equals(Material.NETHER_PORTAL) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(Material.NETHER_PORTAL)) { + if (!JoinLocation.getBlock().getType().equals(material) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(material)) { return; } Block JoinBlock = JoinLocation.getBlock();