add error message

This commit is contained in:
destro174 2022-02-24 19:18:36 +01:00
parent 2587b26eb2
commit 04a035091c

View File

@ -741,15 +741,17 @@ public class Claim
new Location(this.greaterBoundaryCorner.getWorld(), this.greaterBoundaryCorner.getBlockX() + howNear, this.greaterBoundaryCorner.getBlockY(), this.greaterBoundaryCorner.getBlockZ() + howNear),
null, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), null);
if(!claim.contains(location, false, true)) return true;
// if(!claim.contains(location, false, true)) return true;
Set<Claim> claims = GriefPrevention.instance.dataStore.getNearbyClaims(location);
for (Claim claim2 : claims) {
if(!claim2.overlaps(claim)) continue;
Supplier<String> canClaimTrust = claim2.checkPermission(player, ClaimPermission.Claim, null);
if (canClaimTrust == null) continue;
player.sendMiniMessage("<red>You can't claim this close to " + claim2.getOwnerName() + " their claim.", null); // TODO MINIMESSAG + CONFIG
return false;
}
return false;
return true;
}
}