Skip to content

Commit

Permalink
Merge pull request #126 from KitCat962/fix-toJson
Browse files Browse the repository at this point in the history
Fix to json
  • Loading branch information
skyrina committed Dec 6, 2023
2 parents 80322d1 + 43a8e83 commit b8f412f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/src/main/java/org/figuramc/figura/utils/LuaUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.figuramc.figura.math.vector.FiguraVec3;
import org.figuramc.figura.math.vector.FiguraVec4;
import org.luaj.vm2.LuaError;
import org.luaj.vm2.LuaString;
import org.luaj.vm2.LuaTable;
import org.luaj.vm2.LuaValue;

Expand Down Expand Up @@ -195,9 +196,9 @@ public static int parseSlot(Object slot, Inventory inventory) {
public static JsonElement asJsonValue(LuaValue value) {
if (value.isnil()) return JsonNull.INSTANCE;
if (value.isboolean()) return new JsonPrimitive(value.checkboolean());
if (value instanceof LuaString s) return new JsonPrimitive(s.checkjstring());
if (value.isint()) return new JsonPrimitive(value.checkint());
if (value.isnumber()) return new JsonPrimitive(value.checkdouble());
if (value.isstring()) return new JsonPrimitive(value.checkjstring());
if (value.istable()) {
LuaTable table = value.checktable();

Expand Down

0 comments on commit b8f412f

Please sign in to comment.