Skip to content

Commit

Permalink
Fix merge issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
M0diis committed Feb 29, 2024
1 parent 87f31f2 commit 1848d3c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static boolean isTargetWithinRadius(
}

if (radius != -1 && source instanceof ChatUser) {
final Location targetLocation = targetChatUser.player().getLocation();
final Location sourceLocation = targetChatUser.player().getLocation();
final Location targetLocation = ((ChatUser) target).player().getLocation();

final World sourceWorld = sourceLocation.getWorld();
Expand All @@ -64,6 +64,9 @@ public static boolean isTargetWithinRadius(
return false;
}

final int relativeX = targetLocation.getBlockX() - sourceLocation.getBlockX();
final int relativeZ = targetLocation.getBlockZ() - sourceLocation.getBlockZ();

return relativeX*relativeX + relativeZ*relativeZ <= radius*radius;
}

Expand Down

0 comments on commit 1848d3c

Please sign in to comment.