Please help with MC 1.15.x bukkit build + scriptcraft
spustlik opened this issue ยท 4 comments
Hi thanks for great plugin, please, can someone help me with this?
Time to time I build bukkit with new version of MC using BuildTools and it almost always worked fine.
But, when I used it with 1.15.1 in january, because server printed message that current version is outdated, buildtools created new version of 1.15.1, which cannot run scriptcraft (my only used plugin).
log:
[09:58:09] [Server thread/INFO]: Time elapsed: 385 ms
[09:58:09] [Server thread/INFO]: [scriptcraft] Enabling scriptcraft v3.4.0-2019-01-20
[09:58:09] [Server thread/ERROR]: [scriptcraft] No JavaScript Engine available. ScriptCraft will not work without Javascript.
[09:58:09] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
So i tried to compare both jars - it differs in many files, at the end I decompile main classes, and only difference is, that new version is NOT importing some packages:
//missing:
import java.util.Date;
import java.util.concurrent.TimeUnit;
import java.util.Calendar;
import java.text.SimpleDateFormat;
I am not java developer, I am using c#/javascript, so I dont know, how modules loading works in java, specially "extensions" for nashorn. Looking at sources in scriptcraft, new ScriptEngineManager(null).factory.getEngineByName("JavaScript") is returning null, searching stackoverflow it looks it is related to nashorn extensions, but I can be wrong.
Can someone please help me to solve this problem?
Thanks, Jan
"jwulf" fixed this here: 5650c49
Just edit the file in the .jar and you should be fine
Thank you, but as I wrote, I am not java dev. I know, that jar is in fact .zip archive, but there are compiled .class(es), not .java sources. So I am needed to compile it?
Thanks again...
Jan
There is also a patched jar in this build: https://github.com/Magikcraft/MagikCraft/releases/tag/v.3.4.1-alpha.2
Ok, so for others:
- download repository
- change current folder to (extracted) repo
- run {path_to_jdk}\bin\javac.exe src\main\java\bukkit\org\scriptcraftjs\bukkit\ScriptCraftPlugin.java -source 1.6 -target 1.6 -classpath lib/spigot-api-1.13.2-R0.1-SNAPSHOT-shaded.jar
- update ScriptCraftPlugin.java in .jar