ScriptCraft icon indicating copy to clipboard operation
ScriptCraft copied to clipboard

Please help with MC 1.15.x bukkit build + scriptcraft

Open spustlik opened this issue 5 years ago • 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

spustlik avatar Feb 21 '20 09:02 spustlik

"jwulf" fixed this here: https://github.com/walterhiggins/ScriptCraft/commit/5650c495177df174ecb81d43f02959bd70a698ba Just edit the file in the .jar and you should be fine

ithan avatar Feb 21 '20 16:02 ithan

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

spustlik avatar Feb 21 '20 21:02 spustlik

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

spustlik avatar Feb 22 '20 09:02 spustlik

There is also a patched jar in this build: https://github.com/Magikcraft/MagikCraft/releases/tag/v.3.4.1-alpha.2

jwulf avatar Feb 22 '20 17:02 jwulf