Can has json version of a scarpet value
This commit is contained in:
1 parent
b48c52cce4
commit
e759a368b9
5 files changed
+57
-3
No files matched your search
@@ -1,6 +1,8 @@
|
||||
package carpet.script.value;
|
||||
|
||||
import carpet.script.exception.InternalExpressionException;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import net.minecraft.nbt.Tag;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
@@ -206,4 +208,9 @@ public abstract class Value implements Comparable<Value>, Cloneable
|
||||
}
|
||||
|
||||
public abstract Tag toTag(boolean force);
|
||||
|
||||
public JsonElement toJson()
|
||||
{
|
||||
return new JsonPrimitive(getString());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user