Skip to content

Commit

Permalink
fix: add proper world checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cerus committed Aug 16, 2024
1 parent 9cef0e9 commit 84ad5a1
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ of <a href="https://github.com/cerus/packet-maps">packet-maps</a>.</p>
• 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)
Expand All @@ -50,7 +50,7 @@ See [FAQ](#FAQ)
<dependency>
<groupId>dev.cerus.maps</groupId>
<artifactId>common</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
<scope>provided</scope> <!-- "provided" if the maps plugin is on the server, "compile" if not -->
</dependency>

Expand All @@ -59,7 +59,7 @@ See [FAQ](#FAQ)
<dependency>
<groupId>dev.cerus.maps</groupId>
<artifactId>plugin</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-16_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-17_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-18_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-18_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-19_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-19_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion bukkit-19_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-19_R3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-20_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-20_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-20_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-20_R2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-20_R3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-20_R3</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-20_R4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-20_R4</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bukkit-21_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>

<artifactId>bukkit-21_R1</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>parent</artifactId>
<groupId>dev.cerus.maps</groupId>
<version>3.8.6</version>
<version>3.8.7</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>dev.cerus.maps</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>3.8.6</version>
<version>3.8.7</version>
<modules>
<module>common</module>
<module>bukkit-16_R3</module>
Expand Down

0 comments on commit 84ad5a1

Please sign in to comment.