diff --git a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java index 8a249eb..2d8f781 100644 --- a/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java +++ b/common/src/main/java/io/github/flemmli97/flan/commands/CommandClaim.java @@ -414,7 +414,7 @@ public class CommandClaim { } else { OfflinePlayerData data = new OfflinePlayerData(server, of); context.getSource().sendFeedback(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat, - data.claimBlocks, data.additionalClaimBlocks, data.getUsedClaimBlocks()), Formatting.GOLD), false); + data.claimBlocks, data.additionalClaimBlocks, data.usedClaimBlocks()), Formatting.GOLD), false); } } context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.listClaims, Formatting.GOLD), false); diff --git a/common/src/main/java/io/github/flemmli97/flan/player/OfflinePlayerData.java b/common/src/main/java/io/github/flemmli97/flan/player/OfflinePlayerData.java index bdfdc26..cf7d245 100644 --- a/common/src/main/java/io/github/flemmli97/flan/player/OfflinePlayerData.java +++ b/common/src/main/java/io/github/flemmli97/flan/player/OfflinePlayerData.java @@ -45,16 +45,6 @@ public class OfflinePlayerData implements IPlayerData { this.server = server; } - public int getUsedClaimBlocks() { - int usedClaimsBlocks = 0; - for (ServerWorld world : this.server.getWorlds()) { - Collection claims = ClaimStorage.get(world).allClaimsFromPlayer(this.owner); - if (claims != null) - usedClaimsBlocks += claims.stream().filter(claim -> !claim.isAdminClaim()).mapToInt(Claim::getPlane).sum(); - } - return usedClaimsBlocks; - } - @Override public int getClaimBlocks() { return this.claimBlocks; @@ -67,6 +57,12 @@ public class OfflinePlayerData implements IPlayerData { @Override public int usedClaimBlocks() { - return this.usedClaimBlocks(); + int usedClaimsBlocks = 0; + for (ServerWorld world : this.server.getWorlds()) { + Collection claims = ClaimStorage.get(world).allClaimsFromPlayer(this.owner); + if (claims != null) + usedClaimsBlocks += claims.stream().filter(claim -> !claim.isAdminClaim()).mapToInt(Claim::getPlane).sum(); + } + return usedClaimsBlocks; } }