angelsl / jxpl Goto Github PK
View Code? Open in Web Editor NEWthe javax.script Plugin Loader for Bukkit
the javax.script Plugin Loader for Bukkit
Is it possible to make a script'sdepend: [ "SomePlugin" ]
work when that plugin is a Java plugin? Every time I try, I get an UnknownDependencyException. I'm using a few functions to overcome this in the meantime by waiting for the depend to load, but it's not an ideal solution.
It seems evaluating the return value of helper.getFileContents() is failing, both via helper.importScript() and eval() from within the script. I got it to work by replacing the importScript method with this:
public boolean includeScript(File f) { try { ((ScriptEngine) ScriptPlugin.this.sEngine).eval(new FileReader(f)); return true; } catch (Throwable t) { // do something with the exception please! return false; } }
I assume the new changes to event registration, listeners, etc. are causing issues. Attempting to disable jxpl via stop
or reload
causes it to stall and eat CPU.
Server thread stacktrace during stall:
Server thread [RUNNABLE] CPU time: 12:52
org.angelsl.bukkit.jxpl.Utils.getFieldHelper(Object, String)
org.angelsl.bukkit.jxpl.ScriptPlugin.deregisterListeners()
org.angelsl.bukkit.jxpl.ScriptPlugin.onDisable()
org.angelsl.bukkit.jxpl.ScriptLoader.disablePlugin(Plugin)
org.bukkit.plugin.SimplePluginManager.disablePlugin(Plugin)
org.angelsl.bukkit.jxpl.JxplPlugin.onDisable()
org.bukkit.plugin.java.JavaPlugin.setEnabled(boolean)
org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(Plugin)
org.bukkit.plugin.SimplePluginManager.disablePlugin(Plugin)
org.bukkit.plugin.SimplePluginManager.disablePlugins()
org.bukkit.plugin.SimplePluginManager.clearPlugins()
org.bukkit.craftbukkit.CraftServer.reload()
org.bukkit.Bukkit.reload()
org.bukkit.command.defaults.ReloadCommand.execute(CommandSender, String, String[])
org.bukkit.command.SimpleCommandMap.dispatch(CommandSender, String)
org.bukkit.craftbukkit.CraftServer.dispatchCommand(CommandSender, String)
org.bukkit.craftbukkit.CraftServer.dispatchCommand(CommandSender, ServerCommand)
net.minecraft.server.MinecraftServer.b()
net.minecraft.server.MinecraftServer.w()
net.minecraft.server.MinecraftServer.run()
net.minecraft.server.ThreadServerApplication.run()
Any plans to update jxpl under Bukkit's new event system?
Hi ...
This project is very useful ...
I've used the basic version that supports rhino1.7R3 ... the jar is correctly generated but is missed the folder /META-INF/services/javax.script.ScriptEngineFactory
is it the right behaviour?
There is a bug that occurs when you issue a "reload" command to the server, which causes all plugins to reload. Doing this causes any script plugins that are loaded to be loaded multiple times.
For example, if you issue "reload" in the console 5 times, you will see:
2011-02-25 23:20:33 [INFO] Initialising jxpl...
2011-02-25 23:20:33 [INFO] Adding file extension ".js" for scripting engine "Mozilla Rhino".
2011-02-25 23:20:33 [INFO] Loaded script MOTD.js
2011-02-25 23:20:33 [INFO] Loaded script MOTD.js
2011-02-25 23:20:33 [INFO] Loaded script MOTD.js
2011-02-25 23:20:33 [INFO] Loaded script MOTD.js
2011-02-25 23:20:33 [INFO] Loaded script MOTD.js
It appears that the script plugins are being loaded multiple times, however as near as we can tell, the onEnable for each plugin is only being called once.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.