Skip to content

Setup Plugin

blockout22 edited this page Feb 5, 2022 · 1 revision

Setup Plugin

Anything that is wrong, unclear or could be improved, feel free to open a pull request

Dependencies

Create a new maven project in your IDE and open up your pom.xml file, in your pom.xml file you are going to need a few requirements

First requirement is ImGui, later this will give us access to some classes we need such as 'ImString' 'ImBoolean' 'ImInt' etc...

<dependency>
    <groupId>io.github.spair</groupId>
    <artifactId>imgui-java-binding</artifactId>
    <version>1.86.0</version>
</dependency>

Our next requirement is pf4j which is used to load the plugin

<dependency>
    <groupId>org.pf4j</groupId>
    <artifactId>pf4j</artifactId>
    <version>3.6.0</version>
</dependency>

and finally you need to include visual scripting project to your plugin project, you can use the prebuilt jar in releases (you don't need all the jars just 'VisualScripting.jar') or you can clone the entire repo (repo is more updated)

Creating Plugin

Once your dependencies are setup we can now start setting up our plugin

Create a new class and have it extend 'Plugin' (org.pf4j.Plugin) nothing more will be used in this class it's only a requirement for pf4j to load plugins

before we can test our plugin we have one more step, we need to modify our MANIFEST.MF file, for pf4j to load your plugin you need to tell it where to find your plugin class and pf4j find that info using the MANIFEST.MF file. Inside your MANIFEST.MF file have the following:-

Manifest-Version: 1.0
Plugin-Class: YourPluginClass
Plugin-Id: SomeUniqueStringID
Plugin-Version: 0.0.1

and that's it compile your code without including dependencies and add it to the VisualScripting Plugin folder to test

Creating Plugins

Setup Plugin

Custom Node

Clone this wiki locally