This project is abandoned, in favor of continuing with Bensku's Skript. It is not known if this project is a viable alternative. Try at your own risk.
SoftPlugin is a Spigot plugin. It is a thin loader; at runtime, it compiles Java source files and then loads a specific boot class. Whilst the server is running, the source files can be changed and the plugin reloaded without restarting the server.
This plugin tries to have these benefits of scripting plugins (e.g. Skript, ScriptCraft):
- Rapid development; no need to build and deploy a jar
- Rapid prototyping; new features or ideas can be quickly tried
- Quick changes and fixes; IDE not needed to make changes, just a text editor and reload
By compiling Java sources into classes, it could use these benefits:
- Java language; strict-typing, static analysis, clearer code constructs, etc.
- Native use of Spigot API; no need to wait for intermediate plugin to update
- Access to existing libraries and other plugins
- (Paper)Spigot 1.9.2 or later
- Server needs to be running on JDK 8 or later
This plugin compiles, loads and executes Java source files it is given. These are executed with zero security protection or considerations. They are executed in the same context and privilege level as the server itself. Potentially, any SoftPlugin "scripts" can destroy the server or the system it is running on.
Use Java source files with SoftPlugin at your own risk. Don't give SoftPlugin files you are unfamiliar with.
- Upload a built JAR of SoftPlugin to the
plugins
directory of your server - Restart server once
- Check
plugins/SoftPlugin/config.yml
and change settings to taste - In the created
source
directory, create or place Java source files in typical layout. e.g, a file for classsoftplugin.Main
should be insource/softplugin/Main.java
- Execute
/softplugin-reload
in the server
/softplugin-reload
(or/spr
) - does the following:- Reloads SoftPlugin's configuration options
- Unloads any currently loaded classes
- Discard any compiled classes in the cache
- Compiles the source files
- Loads and executes the main class defined in the config
softplugin.reload
- Allows use of/softplugin-reload
. Granted to op and console.
For instructions and screenshots on how to. . .
- Compile this plugin from scratch
- Build a JAR of this plugin
- Debug this plugin on a server
- Enable debug logging levels such as
FINE
andFINER
. . .please follow the linked guide on this Google document.