aboutsummaryrefslogtreecommitdiff
path: root/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-09-22 12:20:12 +0800
committershedaniel <daniel@shedaniel.me>2020-09-22 12:20:12 +0800
commit72e44a1432f831bdbd42f1c8a574bf22e8b4a481 (patch)
tree42ce881152e2dab8f4378612c45226ea9b0a773a /RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
parentb76420e3bd81886593587c295284b33e57b29cdf (diff)
downloadRoughlyEnoughItems-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/utils/ImmutableLiteralText.java')
-rw-r--r--RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
index a13aa6dd6..0da3d19f8 100644
--- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
+++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/utils/ImmutableLiteralText.java
@@ -34,7 +34,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
-public final class ImmutableLiteralText implements Component {
+public final class ImmutableLiteralText implements MutableComponent {
public static final ImmutableLiteralText EMPTY = new ImmutableLiteralText("");
private final String content;
private FormattedCharSequence orderedText;
@@ -60,7 +60,7 @@ public final class ImmutableLiteralText implements Component {
@Override
public MutableComponent plainCopy() {
- return new TextComponent(content);
+ return this;
}
@Override
@@ -85,4 +85,14 @@ public final class ImmutableLiteralText implements Component {
}
return orderedText;
}
+
+ @Override
+ public MutableComponent setStyle(Style style) {
+ return new TextComponent(content).withStyle(style);
+ }
+
+ @Override
+ public MutableComponent append(Component component) {
+ return new TextComponent(content).append(component);
+ }
}