Fixed a weird edge case due to differing locales

This commit is contained in:
Sollace 2023-01-13 00:47:22 +00:00
parent 71ca9614bb
commit fef8b05fea

View file

@ -1,9 +1,6 @@
package com.minelittlepony.unicopia.ability.magic.spell.trait; package com.minelittlepony.unicopia.ability.magic.spell.trait;
import java.util.Arrays; import java.util.*;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -68,8 +65,8 @@ public enum Trait {
private final Text obfuscatedTooltip; private final Text obfuscatedTooltip;
Trait(TraitGroup group) { Trait(TraitGroup group) {
this.id = Unicopia.id(name().toLowerCase()); this.id = Unicopia.id(name().toLowerCase(Locale.ROOT));
this.sprite = Unicopia.id("textures/gui/trait/" + name().toLowerCase() + ".png"); this.sprite = Unicopia.id("textures/gui/trait/" + name().toLowerCase(Locale.ROOT) + ".png");
this.group = group; this.group = group;
Formatting corruptionColor = getGroup().getCorruption() < -0.01F Formatting corruptionColor = getGroup().getCorruption() < -0.01F
@ -81,7 +78,7 @@ public enum Trait {
MutableText tooltipText = Text.translatable("gui.unicopia.trait.label", MutableText tooltipText = Text.translatable("gui.unicopia.trait.label",
Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".name") Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".name")
).formatted(Formatting.YELLOW) ).formatted(Formatting.YELLOW)
.append(Text.translatable("gui.unicopia.trait.group", getGroup().name().toLowerCase()).formatted(Formatting.ITALIC, Formatting.GRAY)) .append(Text.translatable("gui.unicopia.trait.group", getGroup().name().toLowerCase(Locale.ROOT)).formatted(Formatting.ITALIC, Formatting.GRAY))
.append(Text.literal("\n\n").formatted(Formatting.WHITE) .append(Text.literal("\n\n").formatted(Formatting.WHITE)
.append(Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".description").formatted(Formatting.GRAY)) .append(Text.translatable("trait." + getId().getNamespace() + "." + getId().getPath() + ".description").formatted(Formatting.GRAY))
.append("\n") .append("\n")