add missing support for lang keys (and as such also text color) for missing things close #224

This commit is contained in:
Flemmli97 2023-03-10 23:09:54 +01:00
parent 82124199e1
commit 3ab4e66f6a
4 changed files with 7 additions and 3 deletions

View File

@ -135,11 +135,13 @@ public class LangManager {
this.defaultTranslation.put("screenGroupPlayers", "%1$s-Players");
this.defaultTranslation.put("screenRemoveMode", "Remove Mode: %1$s");
this.defaultTranslation.put("screenGlobalPerms", "Global-Permissions");
this.defaultTranslation.put("screenGroupName", "%s");
this.defaultTranslation.put("screenGroups", "Claim-Groups");
this.defaultTranslation.put("screenGroupPerms", "%1$s-Permissions");
this.defaultTranslation.put("screenPersonalGroups", "Personal-Groups");
this.defaultTranslation.put("screenPersonalPermissions", "Personal Permissions for %1$s");
this.defaultTranslation.put("screenPotions", "Claim Potions");
this.defaultTranslation.put("screenPotionText", "%s");
this.defaultTranslation.put("screenTitleEditor", "Claim messages");
this.defaultTranslation.put("screenTitleEditorSub", "Subclaim messages");
this.defaultTranslation.put("screenTextJson", "Right-Click to use JSON text. See MC Wiki for that.");

View File

@ -68,7 +68,7 @@ public class GroupScreenHandler extends ServerOnlyScreenHandler<Claim> {
int id = (i % 9) + row * 7 - 1;
if (id < groups.size()) {
ItemStack group = new ItemStack(Items.PAPER);
group.setHoverName(ServerScreenHelper.coloredGuiText(groups.get(id), ChatFormatting.DARK_BLUE));
group.setHoverName(ServerScreenHelper.coloredGuiText(String.format(ConfigHandler.langManager.get("screenGroupName"), groups.get(id)), ChatFormatting.DARK_BLUE));
inv.updateStack(i, group);
}
}

View File

@ -69,7 +69,7 @@ public class PersonalGroupScreenHandler extends ServerOnlyScreenHandler<Object>
int id = (i % 9) + row * 7 - 1;
if (id < groups.size()) {
ItemStack group = new ItemStack(Items.PAPER);
group.setHoverName(ServerScreenHelper.coloredGuiText(groups.get(id), ChatFormatting.DARK_BLUE));
group.setHoverName(ServerScreenHelper.coloredGuiText(String.format(ConfigHandler.langManager.get("screenGroupName"), groups.get(id)), ChatFormatting.DARK_BLUE));
inv.updateStack(i, group);
}
}

View File

@ -86,7 +86,9 @@ public class PotionEditScreenHandler extends ServerOnlyScreenHandler<Claim> {
Collection<MobEffectInstance> inst = Collections.singleton(new MobEffectInstance(effect, 0, potions.get(effect)));
effectStack.getOrCreateTag().putString("FlanEffect", CrossPlatformStuff.INSTANCE.registryStatusEffects().getIDFrom(effect).toString());
effectStack.getTag().putInt("CustomPotionColor", PotionUtils.getColor(inst));
effectStack.setHoverName(txt.setStyle(txt.getStyle().withItalic(false).applyFormat(ChatFormatting.DARK_BLUE)).append(ServerScreenHelper.coloredGuiText("-" + potions.get(effect), ChatFormatting.DARK_BLUE)));
txt.append(Component.literal("-" + potions.get(effect)));
Component comp = Component.translatable(ConfigHandler.langManager.get("screenPotionText"), txt).setStyle(txt.getStyle().withItalic(false).applyFormat(ChatFormatting.DARK_BLUE));
effectStack.setHoverName(comp);
inv.updateStack(i, effectStack);
}
}