fix error trying to give modify players that never joined

This commit is contained in:
Flemmli97 2021-04-19 12:57:14 +02:00
parent e80e8f4a62
commit 3832a7268c

View File

@ -276,7 +276,7 @@ public class PlayerClaimData {
reader.close();
if (obj == null)
obj = new JsonObject();
int additionalBlocks = obj.get("AdditionalBlocks").getAsInt();
int additionalBlocks = ConfigHandler.fromJson(obj, "AdditionalBlocks", 0);
obj.addProperty("AdditionalBlocks", additionalBlocks + additionalClaimBlocks);
Flan.debug("Attempting to write following json data {} to file {}", obj, file.getName());
FileWriter writer = new FileWriter(file);
@ -287,6 +287,8 @@ public class PlayerClaimData {
}
}
private int calculateUsedClaimBlocks() {
int usedClaimsBlocks = 0;
for (ServerWorld world : this.player.getServer().getWorlds()) {