mirror of
https://github.com/GeyserExtensionists/GeyserModelEngine.git
synced 2025-12-19 15:09:18 +00:00
add a world check
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -125,7 +125,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.comphenix.protocol</groupId>
|
<groupId>com.comphenix.protocol</groupId>
|
||||||
<artifactId>ProtocolLib</artifactId>
|
<artifactId>ProtocolLib</artifactId>
|
||||||
<version>5.3.0-SNAPSHOT</version>
|
<version>5.3.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -329,10 +329,14 @@ public class EntityTask {
|
|||||||
if (GeyserModelEngine.getInstance().getJoinedPlayer() != null && GeyserModelEngine.getInstance().getJoinedPlayer().getIfPresent(player) != null) {
|
if (GeyserModelEngine.getInstance().getJoinedPlayer() != null && GeyserModelEngine.getInstance().getJoinedPlayer().getIfPresent(player) != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Location playerLocation = player.getLocation().clone();
|
Location playerLocation = player.getLocation().clone();
|
||||||
Location entityLocation = entity.getLocation().clone();
|
Location entityLocation = entity.getLocation().clone();
|
||||||
playerLocation.setY(0);
|
playerLocation.setY(0);
|
||||||
entityLocation.setY(0);
|
entityLocation.setY(0);
|
||||||
|
if (playerLocation.getWorld() != entityLocation.getWorld()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (playerLocation.distanceSquared(entityLocation) > player.getSendViewDistance() * player.getSendViewDistance() * 16) {
|
if (playerLocation.distanceSquared(entityLocation) > player.getSendViewDistance() * player.getSendViewDistance() * 16) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user