From 72e44a1432f831bdbd42f1c8a574bf22e8b4a481 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Tue, 22 Sep 2020 12:20:12 +0800 Subject: Fix #409 and more Signed-off-by: shedaniel --- .../src/main/java/me/shedaniel/rei/api/TextRepresentable.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java') diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java index 96ca2c7af..b346ab822 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java @@ -26,10 +26,10 @@ package me.shedaniel.rei.api; import me.shedaniel.math.impl.PointHelper; import me.shedaniel.rei.api.widgets.Tooltip; import me.shedaniel.rei.utils.FormattingUtils; +import me.shedaniel.rei.utils.ImmutableLiteralText; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TextComponent; import org.jetbrains.annotations.NotNull; @Environment(EnvType.CLIENT) @@ -41,11 +41,11 @@ public interface TextRepresentable { if (tooltip != null && !tooltip.getText().isEmpty()) return tooltip.getText().get(0); } - return new TextComponent(""); + return ImmutableLiteralText.EMPTY; } @NotNull default Component asFormatStrippedText() { - return new TextComponent(FormattingUtils.stripFormatting(asFormattedText().getString())); + return new ImmutableLiteralText(FormattingUtils.stripFormatting(asFormattedText().getString())); } } -- cgit