Hello everyone!
Today I'm happy to introduce you my new API: MCEF, which enables modders to embed a web browser into their mods. It was initially created for my own mod (WebDisplays) but I decided to turn it into an open-source API so that other modders may also use JCEF while staying compatible with WebDisplays.
Example of uses:
- Make a nice HTML5+CSS3+JS user interface
- Show your wiki to help your players
- Show your server's online shop, etc...
WARNING: Right now only Windows is supported; I'll compile it for Linux as soon as possible. However I can't compile it for Mac; if you want to help, see the GitHub page.
You can get the source code from GitHub here: https://github.com/montoyo/mcef
Basically, you just need to go to the release page, download the latest API release, and put it into your "libs" directory of your project. Users will have to download the mod from this thread. To understand how it works, you may look at the net.montoyo.mcef.example package, which contains an example browser. If MCEF is an optional dependecy, you may use Forge's @Optional annotations.
Changelog:
0.6: Updated to a newer JCEF version; the "MCEF not closing java" issue SHOULD be fixed.
0.9: Fixed incompatibility with the new launcher. Available for 1.10.2 and 1.12.2
It should be working with local HTML pages yes. JCEF also has a feature which enables me to add custom scheme (like example://myfile.html). I could add a jar:// scheme and/or let modders add custom schemes. We'll see
This! Is future of Modding! You just brought the Modding Community a step closer to perfection
It's very interesting (nice work OP) but I don't agree lol... the perfect mod wouldn't require *any* in-game help and be completely immersive in it's teaching
Yep, using JavaScript you can send data from the game to the browser; like, for instance, the position of the player, the block he's currently looking at... etc...
Yep, using JavaScript you can send data from the game to the browser; like, for instance, the position of the player, the block he's currently looking at... etc...
Does it run in a new thread/runnable (i.e. not process-blocking) or should we handle threading ourselves?
Sorry, you didn't exactly answer my question. How do you provide the means for your API to run in the background, so that users code isn't stuck "waiting" for a response from a server? Do you implement a runnable and callback helper (like a proper API should), something else (e.g. implementation of a "service" type model), or just do nothing special and expect the users to implement it their own way?
Threading is not complicated lol it's basic Java...
Thread thread = new Thread(){
public void run(){
System.out.println("Thread Running");
}
}
thread.start();
Fair enough, you're using triggers and handle it like a "service" model Shame it's not threaded but oh well, I'm used to that kind of thing. One can always use threading themselves anyway.
Yes in fact i'm using the super-class pointer to handle metadata construction using the native threading bus model which is pretty complicated but basically it can send remote procedure calls via DBus with the C++ pure virtual classes it's very powerfull.
I'm indirectly using the high dynamic range shading model to render the web engine correctly without using any mutexes which is fair enough to proceed to a binary data decompilation and rewrite the thing in a faster VASM which can be directly interpreted by the arithmetic logic unit of the random access memory bus
Yes in fact i'm using the super-class pointer to handle metadata construction using the native threading bus model which is pretty complicated but basically it can send remote procedure calls via DBus with the C++ pure virtual classes it's very powerfull.
I'm indirectly using the high dynamic range shading model to render the web engine correctly without using any mutexes which is fair enough to proceed to a binary data decompilation and rewrite the thing in a faster VASM which can be directly interpreted by the arithmetic logic unit of the random access memory bus
First paragraph makes complete sense, sorry I don't realize this sooner.
Second paragraph sounds like Hollywood gibberish sounds fancy though.
Hello everyone!
Today I'm happy to introduce you my new API: MCEF, which enables modders to embed a web browser into their mods. It was initially created for my own mod (WebDisplays) but I decided to turn it into an open-source API so that other modders may also use JCEF while staying compatible with WebDisplays.
Example of uses:
- Make a nice HTML5+CSS3+JS user interface
- Show your wiki to help your players
- Show your server's online shop, etc...
WARNING: Right now only Windows is supported; I'll compile it for Linux as soon as possible. However I can't compile it for Mac; if you want to help, see the GitHub page.
YOU NEED MinecraftForge, which you can find here: https://files.minecraftforge.net
You can download all MCEF versions from here: https://montoyo.net/wd3/?modid=mcef
Just put it in your mods folder.
You can get the source code from GitHub here: https://github.com/montoyo/mcef
Basically, you just need to go to the release page, download the latest API release, and put it into your "libs" directory of your project. Users will have to download the mod from this thread. To understand how it works, you may look at the net.montoyo.mcef.example package, which contains an example browser. If MCEF is an optional dependecy, you may use Forge's @Optional annotations.
0.6: Updated to a newer JCEF version; the "MCEF not closing java" issue SHOULD be fixed.
0.9: Fixed incompatibility with the new launcher. Available for 1.10.2 and 1.12.2
It's very interesting (nice work OP) but I don't agree lol... the perfect mod wouldn't require *any* in-game help and be completely immersive in it's teaching
mod://modname/file.html => /assets/modname/html/file.html
Does it run in a new thread/runnable (i.e. not process-blocking) or should we handle threading ourselves?
https://github.com/montoyo/mcef/blob/master/java/net/montoyo/mcef/example/BrowserScreen.java
Sorry, you didn't exactly answer my question. How do you provide the means for your API to run in the background, so that users code isn't stuck "waiting" for a response from a server? Do you implement a runnable and callback helper (like a proper API should), something else (e.g. implementation of a "service" type model), or just do nothing special and expect the users to implement it their own way?
Threading is not complicated lol it's basic Java...
But in any cases, all MCEF functions are not blocking. Again, check out the examples i've made:
https://github.com/montoyo/mcef/blob/master/java/net/montoyo/mcef/example/ExampleMod.java
https://github.com/montoyo/mcef/blob/master/java/net/montoyo/mcef/example/BrowserScreen.java
Sorry for my bad english.
I'm indirectly using the high dynamic range shading model to render the web engine correctly without using any mutexes which is fair enough to proceed to a binary data decompilation and rewrite the thing in a faster VASM which can be directly interpreted by the arithmetic logic unit of the random access memory bus
First paragraph makes complete sense, sorry I don't realize this sooner.
Second paragraph sounds like Hollywood gibberish
Regardless, nice job!