walterhiggins/ScriptCraft — pull request #154 by pvginkel (2014-09-07 07:15:59+00:00)
Title: Fixed class loader of the script engine.

The script engine didn't have the plugin class loader. Instead, it had the thread context class loader. The problem with this is that this prevents scripts from instantiating classes from other plugins to e.g. implement undo when WorldEdit is available. The thread context class loader is now set to the plugin class loader while instantiating the script engine which solves this issue.

The solution chosen isn't pretty but I've tried many other approaches (e.g. passing the class loader to the ScriptEngineManager constructor or calling the initApplicationClassLoader on ContextFactory), all of which should work, but none of then do. This is the only approach I found that works.