small fixes

This commit is contained in:
Flemmli97 2022-02-02 16:29:29 +01:00
parent 75e47c6f0e
commit 75bab2d704
3 changed files with 6 additions and 4 deletions

View File

@ -550,7 +550,7 @@ public class Claim implements IPermissionContainer {
if (title != null && title.getContents().equals("$empty"))
title = null;
if (sub != null && sub.getContents().equals("$empty"))
title = null;
sub = null;
this.enterTitle = title;
this.enterSubtitle = sub;
this.setDirty(true);
@ -560,7 +560,7 @@ public class Claim implements IPermissionContainer {
if (title != null && title.getContents().equals("$empty"))
title = null;
if (sub != null && sub.getContents().equals("$empty"))
title = null;
sub = null;
this.leaveTitle = title;
this.leaveSubtitle = sub;
this.setDirty(true);

View File

@ -114,7 +114,7 @@ public class BuySellHandler {
return CommandCurrency.sellClaimBlocks(player, blocks, this.sellAmount, message);
}
case ITEM -> {
if (this.ingredient.getItems().length == 0) {
if (this.ingredient.isEmpty()) {
return false;
}
int amount = Mth.floor(blocks * this.sellAmount);

View File

@ -92,7 +92,7 @@ public class Config {
public boolean log;
public String lang = "default";
public String lang = "en_us";
public int configVersion = 4;
public int preConfigVersion;
@ -144,6 +144,7 @@ public class Config {
JsonObject obj = ConfigHandler.GSON.fromJson(reader, JsonObject.class);
reader.close();
this.preConfigVersion = ConfigHandler.fromJson(obj, "configVersion", 0);
this.lang = ConfigHandler.fromJson(obj, "lang", this.lang);
this.startingBlocks = ConfigHandler.fromJson(obj, "startingBlocks", this.startingBlocks);
this.maxClaimBlocks = ConfigHandler.fromJson(obj, "maxClaimBlocks", this.maxClaimBlocks);
this.ticksForNextBlock = ConfigHandler.fromJson(obj, "ticksForNextBlock", this.ticksForNextBlock);
@ -241,6 +242,7 @@ public class Config {
JsonObject obj = new JsonObject();
obj.addProperty("__comment", "For help with the config refer to https://github.com/Flemmli97/Flan/wiki/Config");
obj.addProperty("configVersion", this.configVersion);
obj.addProperty("lang", this.lang);
obj.addProperty("startingBlocks", this.startingBlocks);
obj.addProperty("maxClaimBlocks", this.maxClaimBlocks);
obj.addProperty("ticksForNextBlock", this.ticksForNextBlock);