diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-09-22 12:20:12 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-09-22 12:20:12 +0800 |
| commit | 72e44a1432f831bdbd42f1c8a574bf22e8b4a481 (patch) | |
| tree | 42ce881152e2dab8f4378612c45226ea9b0a773a /RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java | |
| parent | b76420e3bd81886593587c295284b33e57b29cdf (diff) | |
| download | RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.gz RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.tar.bz2 RoughlyEnoughItems-72e44a1432f831bdbd42f1c8a574bf22e8b4a481.zip | |
Fix #409 and more
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java')
| -rw-r--r-- | RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/TextRepresentable.java | 6 |
1 files changed, 3 insertions, 3 deletions
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())); } } |
