Can has json version of a scarpet value

This commit is contained in:
gnembon committed 2020-08-21 01:44:19 -03:00
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());
}
}