From f1d6df9a17869f6ef4e2f168f1b0b03d0c22d015 Mon Sep 17 00:00:00 2001 From: HaHaWTH Date: Wed, 20 Dec 2023 21:00:31 +0800 Subject: [PATCH] Fix LoginLocationFixListener --- pom.xml | 12 ++++++++++++ .../authme/listener/LoginLocationFixListener.java | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8c0a4545..33aba2e3 100644 --- a/pom.xml +++ b/pom.xml @@ -346,6 +346,10 @@ com.google.gson fr.xephi.authme.libs.com.google.gson + + + + @@ -865,6 +869,14 @@ + + + + + + + + org.tyrannyofheaven.bukkit diff --git a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java index 7bf410ee..13288367 100644 --- a/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java +++ b/src/main/java/fr/xephi/authme/listener/LoginLocationFixListener.java @@ -50,7 +50,7 @@ public class LoginLocationFixListener implements Listener { @EventHandler public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); - Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5); + Location JoinLocation = player.getLocation(); if (isFixPortalStuck) { if (!JoinLocation.getBlock().getType().equals(materialPortal) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(materialPortal)) { return; @@ -73,7 +73,8 @@ public class LoginLocationFixListener implements Listener { JoinBlock.breakNaturally(); } messages.send(player, MessageKey.LOCATION_FIX_PORTAL); - } else if (isFixGroundStuck) { + } + if (isFixGroundStuck) { Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType(); World world = player.getWorld(); int MaxHeight = world.getMaxHeight(); @@ -108,5 +109,6 @@ public class LoginLocationFixListener implements Listener { } } } + } }