diff --git a/src/main/java/com/simibubi/create/content/contraptions/IDisplayAssemblyExceptions.java b/src/main/java/com/simibubi/create/content/contraptions/IDisplayAssemblyExceptions.java index 983f67c37..c157ed192 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/IDisplayAssemblyExceptions.java +++ b/src/main/java/com/simibubi/create/content/contraptions/IDisplayAssemblyExceptions.java @@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions; import java.util.Arrays; import java.util.List; -import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation; import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.item.TooltipHelper.Palette; import com.simibubi.create.foundation.utility.Components; @@ -28,7 +27,7 @@ public interface IDisplayAssemblyExceptions { String text = e.component.getString(); Arrays.stream(text.split("\n")) .forEach(l -> TooltipHelper.cutStringTextComponent(l, Palette.GRAY_AND_WHITE) - .forEach(c -> Lang.text(c.getString()).forGoggles(tooltip))); + .forEach(c -> Lang.builder().add(c).forGoggles(tooltip))); return true; } diff --git a/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java b/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java index 0f8d746db..c6b2753db 100644 --- a/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java +++ b/src/main/java/com/simibubi/create/content/fluids/tank/BoilerData.java @@ -11,7 +11,6 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.Create; import com.simibubi.create.content.decoration.steamWhistle.WhistleBlock; import com.simibubi.create.content.decoration.steamWhistle.WhistleBlockEntity; -import com.simibubi.create.content.equipment.goggles.IHaveGoggleInformation; import com.simibubi.create.content.kinetics.BlockStressValues; import com.simibubi.create.content.kinetics.steamEngine.SteamEngineBlock; import com.simibubi.create.foundation.advancement.AdvancementBehaviour; @@ -151,9 +150,9 @@ public class BoilerData { Lang.translate("boiler.status", getHeatLevelTextComponent().withStyle(ChatFormatting.GREEN)) .forGoggles(tooltip); - Lang.text(getSizeComponent(true, false).getString()).forGoggles(tooltip, 1); - Lang.text(getWaterComponent(true, false).getString()).forGoggles(tooltip, 1); - Lang.text(getHeatComponent(true, false).getString()).forGoggles(tooltip, 1); + Lang.builder().add(getSizeComponent(true, false)).forGoggles(tooltip, 1); + Lang.builder().add(getWaterComponent(true, false)).forGoggles(tooltip, 1); + Lang.builder().add(getHeatComponent(true, false)).forGoggles(tooltip, 1); if (attachedEngines == 0) return true; diff --git a/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java index 1d2f4e217..a46a2f410 100644 --- a/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java +++ b/src/main/java/com/simibubi/create/foundation/item/TooltipHelper.java @@ -32,7 +32,7 @@ public class TooltipHelper { Component hint = Lang.translateDirect(hintKey); List cutComponent = cutTextComponent(hint, Palette.GRAY_AND_WHITE); for (Component component : cutComponent) - Lang.text(component.getString()).forGoggles(tooltip); + Lang.builder().add(component).forGoggles(tooltip); } public static String makeProgressBar(int length, int filledLength) { diff --git a/src/main/java/com/simibubi/create/foundation/utility/LangBuilder.java b/src/main/java/com/simibubi/create/foundation/utility/LangBuilder.java index 161f52dd4..ff67e62a3 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/LangBuilder.java +++ b/src/main/java/com/simibubi/create/foundation/utility/LangBuilder.java @@ -2,8 +2,6 @@ package com.simibubi.create.foundation.utility; import java.util.List; -import com.simibubi.create.compat.Mods; - import joptsimple.internal.Strings; import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; @@ -96,6 +94,19 @@ public class LangBuilder { return this; } + /** + * Appends a component + * + * @param component the component to append + * @return this builder + */ + public LangBuilder add(Component component) { + if (component instanceof MutableComponent mutableComponent) + return add(mutableComponent); + else + return add(component.copy()); + } + // /**