Skip to content

Commit 6ff5580

Browse files
authored
Merge pull request DevotedMC#35 from Protonull/pearl-loc-fix
Fix ep showall locations
2 parents 384dc81 + 93b4b86 commit 6ff5580

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

paper/src/main/java/com/devotedmc/ExilePearl/command/CmdShowAllPearls.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ public void perform() {
7676
final Location pearlLocation = pearl.getLocation();
7777
final boolean isPlayerBanned = isBanStickEnabled
7878
&& BanHandler.isPlayerBanned(pearl.getPlayerId());
79-
final boolean showLocation = WorldUtils.blockDistance(
80-
senderLocation, pearlLocation, true) <= pearlExclusionRadius;
79+
80+
final int distanceToPearl = WorldUtils.blockDistance(senderLocation, pearlLocation, true);
81+
// distance is -1 if the pearl is in a different world
82+
final boolean showLocation = distanceToPearl != -1 && distanceToPearl <= pearlExclusionRadius;
8183

8284
CompletableFuture<ItemStack> itemReadyFuture = new CompletableFuture<>();
8385
final ItemStack item = isPlayerBanned

0 commit comments

Comments
 (0)