Merge branch 'mc1.18/dev' into mc1.19/dev

This commit is contained in:
simibubi 2024-08-07 20:17:32 +02:00
commit 9d1e4883bc
4 changed files with 18 additions and 9 deletions

View file

@ -3,7 +3,6 @@ package com.simibubi.create.content.contraptions;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; 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;
import com.simibubi.create.foundation.item.TooltipHelper.Palette; import com.simibubi.create.foundation.item.TooltipHelper.Palette;
import com.simibubi.create.foundation.utility.Components; import com.simibubi.create.foundation.utility.Components;
@ -28,7 +27,7 @@ public interface IDisplayAssemblyExceptions {
String text = e.component.getString(); String text = e.component.getString();
Arrays.stream(text.split("\n")) Arrays.stream(text.split("\n"))
.forEach(l -> TooltipHelper.cutStringTextComponent(l, Palette.GRAY_AND_WHITE) .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; return true;
} }

View file

@ -11,7 +11,6 @@ import com.simibubi.create.AllBlocks;
import com.simibubi.create.Create; import com.simibubi.create.Create;
import com.simibubi.create.content.decoration.steamWhistle.WhistleBlock; import com.simibubi.create.content.decoration.steamWhistle.WhistleBlock;
import com.simibubi.create.content.decoration.steamWhistle.WhistleBlockEntity; 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.BlockStressValues;
import com.simibubi.create.content.kinetics.steamEngine.SteamEngineBlock; import com.simibubi.create.content.kinetics.steamEngine.SteamEngineBlock;
import com.simibubi.create.foundation.advancement.AdvancementBehaviour; import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
@ -151,9 +150,9 @@ public class BoilerData {
Lang.translate("boiler.status", getHeatLevelTextComponent().withStyle(ChatFormatting.GREEN)) Lang.translate("boiler.status", getHeatLevelTextComponent().withStyle(ChatFormatting.GREEN))
.forGoggles(tooltip); .forGoggles(tooltip);
Lang.text(getSizeComponent(true, false).getString()).forGoggles(tooltip, 1); Lang.builder().add(getSizeComponent(true, false)).forGoggles(tooltip, 1);
Lang.text(getWaterComponent(true, false).getString()).forGoggles(tooltip, 1); Lang.builder().add(getWaterComponent(true, false)).forGoggles(tooltip, 1);
Lang.text(getHeatComponent(true, false).getString()).forGoggles(tooltip, 1); Lang.builder().add(getHeatComponent(true, false)).forGoggles(tooltip, 1);
if (attachedEngines == 0) if (attachedEngines == 0)
return true; return true;

View file

@ -32,7 +32,7 @@ public class TooltipHelper {
Component hint = Lang.translateDirect(hintKey); Component hint = Lang.translateDirect(hintKey);
List<Component> cutComponent = cutTextComponent(hint, Palette.GRAY_AND_WHITE); List<Component> cutComponent = cutTextComponent(hint, Palette.GRAY_AND_WHITE);
for (Component component : cutComponent) for (Component component : cutComponent)
Lang.text(component.getString()).forGoggles(tooltip); Lang.builder().add(component).forGoggles(tooltip);
} }
public static String makeProgressBar(int length, int filledLength) { public static String makeProgressBar(int length, int filledLength) {

View file

@ -2,8 +2,6 @@ package com.simibubi.create.foundation.utility;
import java.util.List; import java.util.List;
import com.simibubi.create.compat.Mods;
import joptsimple.internal.Strings; import joptsimple.internal.Strings;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -96,6 +94,19 @@ public class LangBuilder {
return this; 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());
}
// //
/** /**