Move FormattedText addition into a combined function
This commit is contained in:
2 files changed
+31
-18
No files matched your search
@@ -4,8 +4,6 @@ import carpet.script.exception.InternalExpressionException;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.text.BaseText;
|
||||
import net.minecraft.text.LiteralText;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -83,11 +81,7 @@ public abstract class Value implements Comparable<Value>, Cloneable
|
||||
String lstr = this.getString();
|
||||
if (o instanceof FormattedTextValue)
|
||||
{
|
||||
if (lstr == null)
|
||||
return ((FormattedTextValue) o).clone();
|
||||
BaseText newText = new LiteralText(lstr);
|
||||
newText.append(((FormattedTextValue) o).getText().shallowCopy());
|
||||
return new FormattedTextValue(newText);
|
||||
return FormattedTextValue.combine(this, o);
|
||||
}
|
||||
if (lstr == null) // null
|
||||
return new StringValue(o.getString());
|
||||
|
||||
Reference in new issue
Block a user