An attempt to bring the support of my favorite language into my favorite cuboid game.
Notes:
- If built in x64 Release mode, for unknown reasons the plugin causes ClassiCube to stop responding during terrain generation, at least on my machine;
- Compatibility with x86 platform has not been tested at all.
- Clone ClassiCube repository, import the project into Visual Studio and build the solution;
- Right click on top "Solution 'ClassiCube' (1 of 1 project)" line, click Add -> New Project... -> select Dynamic-Link Library (C++);
- Assuming you have created the new library project under 'ClassiCube' solution, delete all automatically generated source and header files. Make sure you have selected Debug configuration and x64 platform;
- Navigate to Configuration Properties -> C/C++ -> All Options -> Precompiled Header -> select Not Using Precompiled Headers;
- Navigate to Configuration Properties -> Linker -> Input -> Additional Dependencies -> specify the path to
src/x64/Debug/ClassiCube.libfile; - Navigate to Configuration Properties -> C/C++ -> General -> Additional Include Directories -> specify the path to
%JAVA_HOME%/includeand%JAVA_HOME%/include/win32directories; - Import
ClassiCubeJavaLoader.cfile intoSource Files; - Select Build -> Build Solution, you should find the binary under
src/x64/Debug/folder; - Navigate to
ClassiCubeJavaLoaderBridgedirectory, rungradlew.bat buildcommand, the jarfile should be appear inClassiCubeJavaLoaderBridge/build/libsfolder (TODO document ability to write custom Java bridge by implementingccjl.Interfaceclass and changingJLMODmacro inClassiCubeJavaLoader.c); - Navigate to
ClassiCubeJavaLoaderBridgePlugindirectory, perform the same actions; - Make sure your game folder is designed in the following way:
ClassiCube/
├─ javaplugins/
│ ├─ ClassiCubeJavaLoaderBridgePlugin.jar
├─ plugins/
│ ├─ ClassiCubeJavaLoader.dll
├─ ClassiCube.exe
├─ ClassiCubeJavaLoaderBridge.jar
12. Launch ClassiCube and have fun!
- All 51 events, unfortunately without any parameters for those events which provide them;
- Partial re-implementation of
Chat.h; - Almost full implementation SchedulerTask API with limitations of
intervalparameter (TODO document them and the reasons, it is a quite funny thing).
TODO document, for now please check the example plugin located in ClassiCubeJavaLoaderBridgePlugin folder. Note the plugin.properties file under resources directory. Aside from the fields shown there, the loader also supports dependsOn parameter which you can use for enumerating plugin identifiers your work depends on (they will have a higher loading priority).
Example: dependsOn=Plugin1, Plugin2, ExamplePlugin
Use this project on your own risk, it may contain security issues. If you find one, please make sure to report it privately. One of the options could be my email: deewenddev(at)gmail(dot)com.
