From 24415dabcedc65c680afe1bb1ce546238f6838bd Mon Sep 17 00:00:00 2001 From: zimzaza4 Date: Thu, 14 Nov 2024 08:01:14 +0800 Subject: [PATCH] add a world check --- pom.xml | 2 +- src/main/java/re/imc/geysermodelengine/model/EntityTask.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e80c745..f1cf533 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ com.comphenix.protocol ProtocolLib - 5.3.0-SNAPSHOT + 5.3.0 provided diff --git a/src/main/java/re/imc/geysermodelengine/model/EntityTask.java b/src/main/java/re/imc/geysermodelengine/model/EntityTask.java index a265aed..51b8d80 100644 --- a/src/main/java/re/imc/geysermodelengine/model/EntityTask.java +++ b/src/main/java/re/imc/geysermodelengine/model/EntityTask.java @@ -329,10 +329,14 @@ public class EntityTask { if (GeyserModelEngine.getInstance().getJoinedPlayer() != null && GeyserModelEngine.getInstance().getJoinedPlayer().getIfPresent(player) != null) { return false; } + Location playerLocation = player.getLocation().clone(); Location entityLocation = entity.getLocation().clone(); playerLocation.setY(0); entityLocation.setY(0); + if (playerLocation.getWorld() != entityLocation.getWorld()) { + return false; + } if (playerLocation.distanceSquared(entityLocation) > player.getSendViewDistance() * player.getSendViewDistance() * 16) { return false; }