Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this should fix dynmap related error reported on discord #41

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/main/java/com/craftaro/ultimateclaims/claim/Claim.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@
import org.bukkit.boss.BossBar;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;
import java.util.*;
xsmeths marked this conversation as resolved.
Show resolved Hide resolved
import java.util.concurrent.ThreadLocalRandom;

public class Claim {
Expand Down Expand Up @@ -91,7 +85,11 @@ public int getId() {
}

public ClaimedChunk getFirstClaimedChunk() {
return this.claimedRegions.iterator().next().getFirstClaimedChunk();
try {
return this.claimedRegions.iterator().next().getFirstClaimedChunk();
} catch (NoSuchElementException handled) {
return null;
}
xsmeths marked this conversation as resolved.
Show resolved Hide resolved
}

public String getName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public void refresh() {

if (this.plugin.getClaimManager() != null) {
for (Claim claim : this.plugin.getClaimManager().getRegisteredClaims()) {
if (Bukkit.getWorld(claim.getFirstClaimedChunk().getWorld()) == null) {
continue;
if (claim.getFirstClaimedChunk() != null && Bukkit.getWorld(claim.getFirstClaimedChunk().getWorld()) == null) {
SpraxDev marked this conversation as resolved.
Show resolved Hide resolved
continue;
}

if (claim.getCorners() != null) {
Expand Down
Loading