Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help with MC 1.15.x bukkit build + scriptcraft #436

Open
spustlik opened this issue Feb 21, 2020 · 4 comments
Open

Please help with MC 1.15.x bukkit build + scriptcraft #436

spustlik opened this issue Feb 21, 2020 · 4 comments

Comments

@spustlik
Copy link

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

@ithan
Copy link

ithan commented Feb 21, 2020

"jwulf" fixed this here: 5650c49
Just edit the file in the .jar and you should be fine

@spustlik
Copy link
Author

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 spustlik changed the title Plese help with MC 1.15.x bukkit build + scriptcraft Please help with MC 1.15.x bukkit build + scriptcraft Feb 21, 2020
@spustlik
Copy link
Author

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

@jwulf
Copy link
Contributor

jwulf commented Feb 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants