fix wrong function call
This commit is contained in:
parent
384e511cf4
commit
00fe6f554e
@ -414,7 +414,7 @@ public class CommandClaim {
|
|||||||
} else {
|
} else {
|
||||||
OfflinePlayerData data = new OfflinePlayerData(server, of);
|
OfflinePlayerData data = new OfflinePlayerData(server, of);
|
||||||
context.getSource().sendFeedback(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBlocksFormat,
|
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);
|
context.getSource().sendFeedback(PermHelper.simpleColoredText(ConfigHandler.lang.listClaims, Formatting.GOLD), false);
|
||||||
|
@ -45,16 +45,6 @@ public class OfflinePlayerData implements IPlayerData {
|
|||||||
this.server = server;
|
this.server = server;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUsedClaimBlocks() {
|
|
||||||
int usedClaimsBlocks = 0;
|
|
||||||
for (ServerWorld world : this.server.getWorlds()) {
|
|
||||||
Collection<Claim> claims = ClaimStorage.get(world).allClaimsFromPlayer(this.owner);
|
|
||||||
if (claims != null)
|
|
||||||
usedClaimsBlocks += claims.stream().filter(claim -> !claim.isAdminClaim()).mapToInt(Claim::getPlane).sum();
|
|
||||||
}
|
|
||||||
return usedClaimsBlocks;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getClaimBlocks() {
|
public int getClaimBlocks() {
|
||||||
return this.claimBlocks;
|
return this.claimBlocks;
|
||||||
@ -67,6 +57,12 @@ public class OfflinePlayerData implements IPlayerData {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int usedClaimBlocks() {
|
public int usedClaimBlocks() {
|
||||||
return this.usedClaimBlocks();
|
int usedClaimsBlocks = 0;
|
||||||
|
for (ServerWorld world : this.server.getWorlds()) {
|
||||||
|
Collection<Claim> claims = ClaimStorage.get(world).allClaimsFromPlayer(this.owner);
|
||||||
|
if (claims != null)
|
||||||
|
usedClaimsBlocks += claims.stream().filter(claim -> !claim.isAdminClaim()).mapToInt(Claim::getPlane).sum();
|
||||||
|
}
|
||||||
|
return usedClaimsBlocks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user