some more screen langs

This commit is contained in:
Flemmli97 2020-12-11 16:33:24 +01:00
parent 2cce314d8e
commit 1f3ee19951
2 changed files with 6 additions and 3 deletions

View File

@ -77,6 +77,9 @@ public class LangConfig {
public String claimGroupPerms = " Permissions: %s";
public String claimGroupPlayers = " Players: %s";
public String screenEnableText = "Enabled: %s";
public String screenUneditable = "Non Editable!";
public LangConfig(MinecraftServer server) {
File configDir = FabricLoader.getInstance().getConfigDir().resolve("flan").toFile();
//server.getSavePath(WorldSavePath.ROOT).resolve("config/claimConfigs").toFile();

View File

@ -33,10 +33,10 @@ public class ServerScreenHelper {
lore.add(StringTag.of(Text.Serializer.toJson(trans)));
Boolean global = ConfigHandler.config.getGlobal(claim.getWorld(), perm);
if (!claim.isAdminClaim() && global != null) {
Text text = new LiteralText("Non Editable.").setStyle(Style.EMPTY.withFormatting(Formatting.DARK_RED));
Text text = new LiteralText(ConfigHandler.lang.screenUneditable).setStyle(Style.EMPTY.withFormatting(Formatting.DARK_RED));
lore.add(StringTag.of(Text.Serializer.toJson(text)));
String permFlag = global.toString();
Text text2 = new LiteralText("Enabled: " + permFlag).setStyle(Style.EMPTY.withFormatting(permFlag.equals("true") ? Formatting.GREEN : Formatting.RED));
Text text2 = new LiteralText(String.format(ConfigHandler.lang.screenEnableText, permFlag)).setStyle(Style.EMPTY.withFormatting(permFlag.equals("true") ? Formatting.GREEN : Formatting.RED));
lore.add(StringTag.of(Text.Serializer.toJson(text2)));
} else {
String permFlag;
@ -69,7 +69,7 @@ public class ServerScreenHelper {
break;
}
}
Text text = new LiteralText("Enabled: " + permFlag).setStyle(Style.EMPTY.withFormatting(permFlag.equals("true") ? Formatting.GREEN : Formatting.RED));
Text text = new LiteralText(String.format(ConfigHandler.lang.screenEnableText, permFlag)).setStyle(Style.EMPTY.withFormatting(permFlag.equals("true") ? Formatting.GREEN : Formatting.RED));
lore.add(StringTag.of(Text.Serializer.toJson(text)));
}
stack.getOrCreateSubTag("display").put("Lore", lore);