Skip to content

Commit

Permalink
1.25.2 - Fix ChunkLoadEvent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
moom0o committed Apr 9, 2022
1 parent 5c07247 commit 3769830
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.moomoo</groupId>
<artifactId>anarchyexploitfixes</artifactId>
<version>1.25.1.1</version>
<version>1.25.2</version>
<packaging>jar</packaging>

<name>AnarchyExploitFixes</name>
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/me/moomoo/anarchyexploitfixes/patches/Elytra.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ public void onChunkLoad(ChunkLoadEvent evt) {

if (evt.isNewChunk()) {
for (Player p : Bukkit.getOnlinePlayers()) {
Point p1 = new Point(evt.getChunk().getX(), evt.getChunk().getZ());
Point p2 = new Point(p.getLocation().getChunk().getX(), p.getLocation().getChunk().getZ());
Point p1 = new Point(evt.getChunk().getX() * 16, evt.getChunk().getZ() * 16);
Point p2 = new Point(p.getLocation().getBlockX(), p.getLocation().getBlockZ());

if (p1.distance(p2) < 100) {
if (p1.distance(p2) < 250) {
plugin.playersInNewChunks.add(p.getName());
if (config.getBoolean("ChunksCommand")) {
plugin.newChunks.merge(p.getUniqueId(), 1, Integer::sum);
Expand All @@ -187,10 +187,10 @@ public void onChunkLoad(ChunkLoadEvent evt) {
}
} else {
for (Player p : Bukkit.getOnlinePlayers()) {
Point p1 = new Point(evt.getChunk().getX(), evt.getChunk().getZ());
Point p2 = new Point(p.getLocation().getChunk().getX(), p.getLocation().getChunk().getZ());
Point p1 = new Point(evt.getChunk().getX() * 16, evt.getChunk().getZ() * 16);
Point p2 = new Point(p.getLocation().getBlockX(), p.getLocation().getBlockZ());

if (p1.distance(p2) < 100) {
if (p1.distance(p2) < 250) {
plugin.playersInNewChunks.remove(p.getName());
if (config.getBoolean("ChunksCommand")) {
plugin.oldChunks.merge(p.getUniqueId(), 1, Integer::sum);
Expand Down

0 comments on commit 3769830

Please sign in to comment.