Porting Java-based mods to Lua
#5
Hello, welcome to the forum.
Unfortunately this will not work. You may be able to create a simple Java VM from within Lua, but the proprietary server mods are not only about Java, they are about accessing functions within the Java server itself (that's why mods are generally not compatible with multiple minecraft versions and need to be updated). That is, the mod doesn't call just system.out.something(), but it also calls minecraft.client.gui.something, and there's just no way of making this work in MCS, simply because the underlying implementation is completely different.

Now, why your simple example didn't work - in Lua you need to first define anything before using it. Lua goes top-to-bottom when parsing your program. In your first attempt (which has the correct form), you were using function "initializejavavm" on line 6, but declaring it on line 8. If you first declared the function and then used it (just move line 6 down after line 15) the error would have gone away and it might have actually worked.
Still, as I said, mods are mostly about being dependent on Java server's API.
Reply
Thanks given by:


Messages In This Thread
Porting Java-based mods to Lua - by Atro - 01-13-2015, 01:22 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 02:46 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 02:59 PM
RE: Porting Java-based mods to Lua - by Howaner - 01-13-2015, 04:14 PM
RE: Porting Java-based mods to Lua - by xoft - 01-13-2015, 05:05 PM
RE: Porting Java-based mods to Lua - by Atro - 01-13-2015, 05:13 PM
RE: Porting Java-based mods to Lua - by xoft - 01-13-2015, 06:14 PM
RE: Porting Java-based mods to Lua - by Defkil - 02-20-2015, 03:03 AM
RE: Porting Java-based mods to Lua - by LO1ZB - 02-20-2015, 03:10 AM
RE: Porting Java-based mods to Lua - by worktycho - 02-20-2015, 03:57 AM



Users browsing this thread: 1 Guest(s)