Help with Mod Integration with CC:Twaked 1.12.2 & Returning Lua Tables #1553
-
Hey im working on a CC:T Integration for my mod (1.12.2) and i cant figure out how to return a complex objekt aka a lua table It is clear to my that the folowing would not work so i convertet the TestObj to a eqivalent LuaTable object but still comes up as nil. private static class TestObj{
public int a = 12;
public String b = "test";
public boolean c = true;
}
class Test implements IPeripheral
{
...
@Nullable
@Override
public Object[] callMethod(@Nonnull IComputerAccess iComputerAccess, @Nonnull ILuaContext iLuaContext, int i, @Nonnull Object[] objects)
throws LuaException, InterruptedException {
return new Object[]{ new TestObj(), new NulaTable() }; // both show up as nil in game
}
...
} Thanks in advance for any help :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can just return |
Beta Was this translation helpful? Give feedback.
-
Arrays and Arrays of HashMap<String, Object> also work |
Beta Was this translation helpful? Give feedback.
You can just return
HashMap<String, Object>
and it will be transformed to Lua table