From 84ad5a16e70fdd3b399296c7ca5fc2dd53823a6b Mon Sep 17 00:00:00 2001 From: Cerus Date: Fri, 16 Aug 2024 17:33:13 +0200 Subject: [PATCH] fix: add proper world checks --- README.md | 6 +++--- bukkit-16_R3/pom.xml | 2 +- bukkit-17_R1/pom.xml | 2 +- bukkit-18_R1/pom.xml | 2 +- bukkit-18_R2/pom.xml | 2 +- bukkit-19_R1/pom.xml | 2 +- bukkit-19_R2/pom.xml | 2 +- bukkit-19_R3/pom.xml | 2 +- bukkit-20_R1/pom.xml | 2 +- bukkit-20_R2/pom.xml | 2 +- bukkit-20_R3/pom.xml | 2 +- bukkit-20_R4/pom.xml | 2 +- bukkit-21_R1/pom.xml | 2 +- common/pom.xml | 2 +- plugin/pom.xml | 2 +- .../java/dev/cerus/maps/plugin/listener/PlayerListener.java | 3 +++ .../java/dev/cerus/maps/version/VersionAdapterFactory.java | 2 +- pom.xml | 2 +- 18 files changed, 22 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 980f08c..3539eb9 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ of packet-maps.

• Advanced engine features like [alpha compositing](https://en.wikipedia.org/wiki/Alpha_compositing) ([Image](https://cerus.dev/img/maps_alpha_composition.png))\ • Efficient click handling\ -• Supports 1.16.5 - 1.21 +• Supports 1.16.5 - 1.21.1 **What is the point of the plugin module?**\ See [FAQ](#FAQ) @@ -50,7 +50,7 @@ See [FAQ](#FAQ) dev.cerus.maps common - 3.8.6 + 3.8.7 provided @@ -59,7 +59,7 @@ See [FAQ](#FAQ) dev.cerus.maps plugin - 3.8.6 + 3.8.7 provided diff --git a/bukkit-16_R3/pom.xml b/bukkit-16_R3/pom.xml index d35aed5..6f3713c 100644 --- a/bukkit-16_R3/pom.xml +++ b/bukkit-16_R3/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-17_R1/pom.xml b/bukkit-17_R1/pom.xml index ca743d4..e738f12 100644 --- a/bukkit-17_R1/pom.xml +++ b/bukkit-17_R1/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-18_R1/pom.xml b/bukkit-18_R1/pom.xml index 5564537..ffa1ffa 100644 --- a/bukkit-18_R1/pom.xml +++ b/bukkit-18_R1/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-18_R2/pom.xml b/bukkit-18_R2/pom.xml index 6533501..ad80871 100644 --- a/bukkit-18_R2/pom.xml +++ b/bukkit-18_R2/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-19_R1/pom.xml b/bukkit-19_R1/pom.xml index 2940ede..e38a979 100644 --- a/bukkit-19_R1/pom.xml +++ b/bukkit-19_R1/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-19_R2/pom.xml b/bukkit-19_R2/pom.xml index 7eb5698..764a056 100644 --- a/bukkit-19_R2/pom.xml +++ b/bukkit-19_R2/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/bukkit-19_R3/pom.xml b/bukkit-19_R3/pom.xml index e71d81d..8bf41b9 100644 --- a/bukkit-19_R3/pom.xml +++ b/bukkit-19_R3/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-19_R3 diff --git a/bukkit-20_R1/pom.xml b/bukkit-20_R1/pom.xml index 6caa7b2..f06624d 100644 --- a/bukkit-20_R1/pom.xml +++ b/bukkit-20_R1/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-20_R1 diff --git a/bukkit-20_R2/pom.xml b/bukkit-20_R2/pom.xml index 14a9362..54b6caf 100644 --- a/bukkit-20_R2/pom.xml +++ b/bukkit-20_R2/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-20_R2 diff --git a/bukkit-20_R3/pom.xml b/bukkit-20_R3/pom.xml index 73f4761..018f0ec 100644 --- a/bukkit-20_R3/pom.xml +++ b/bukkit-20_R3/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-20_R3 diff --git a/bukkit-20_R4/pom.xml b/bukkit-20_R4/pom.xml index 301a68b..75f08bf 100644 --- a/bukkit-20_R4/pom.xml +++ b/bukkit-20_R4/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-20_R4 diff --git a/bukkit-21_R1/pom.xml b/bukkit-21_R1/pom.xml index 0d002ff..b096a1f 100644 --- a/bukkit-21_R1/pom.xml +++ b/bukkit-21_R1/pom.xml @@ -6,7 +6,7 @@ dev.cerus.maps parent - 3.8.6 + 3.8.7 bukkit-21_R1 diff --git a/common/pom.xml b/common/pom.xml index dea754b..500c0f6 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/plugin/pom.xml b/plugin/pom.xml index d81e1d2..83b4136 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -5,7 +5,7 @@ parent dev.cerus.maps - 3.8.6 + 3.8.7 4.0.0 diff --git a/plugin/src/main/java/dev/cerus/maps/plugin/listener/PlayerListener.java b/plugin/src/main/java/dev/cerus/maps/plugin/listener/PlayerListener.java index 2223fb8..d90a488 100644 --- a/plugin/src/main/java/dev/cerus/maps/plugin/listener/PlayerListener.java +++ b/plugin/src/main/java/dev/cerus/maps/plugin/listener/PlayerListener.java @@ -55,6 +55,9 @@ private boolean call(final Player player, final boolean rightClick) { if (this.useTriangulation) { final Location playerLoc = player.getLocation(); for (final MapScreen screen : MapScreenRegistry.getScreens()) { + if (player.getWorld() != screen.getLocation().getWorld()) { + continue; + } final double dist = playerLoc.distanceSquared(screen.getLocation()); if (dist < MAX_DISTANCE_TO_SCREEN) { // Only run calculations for screens in range final Vec2 coords = ScreenTriangulation.triangulateScreenCoords(player, screen); diff --git a/plugin/src/main/java/dev/cerus/maps/version/VersionAdapterFactory.java b/plugin/src/main/java/dev/cerus/maps/version/VersionAdapterFactory.java index 3f396de..62c8555 100644 --- a/plugin/src/main/java/dev/cerus/maps/version/VersionAdapterFactory.java +++ b/plugin/src/main/java/dev/cerus/maps/version/VersionAdapterFactory.java @@ -24,7 +24,7 @@ public VersionAdapter makeAdapter() { case "1.20.2" -> new VersionAdapter20R2(); case "1.20.3", "1.20.4" -> new VersionAdapter20R3(); case "1.20.5", "1.20.6" -> new VersionAdapter20R4(); - case "1.21" -> new VersionAdapter21R1(); + case "1.21", "1.21.1" -> new VersionAdapter21R1(); default -> null; }; } diff --git a/pom.xml b/pom.xml index 42a7bc4..43f3ba1 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ dev.cerus.maps parent pom - 3.8.6 + 3.8.7 common bukkit-16_R3