Replies: 1 comment
-
I've also created RuntimeSkriptAddonPatcher, which is easier to use as it's just a plugin you can put on your server. See the README for instructions on how to use it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Due to a recent update to the internal workings of Skript, many addons need updating, otherwise some of their syntaxes won't work on the latest Skript version. The change causing this, is PR #3924, which introduces parallel script loading. Skript had to be changed internally for this system to work, and a lot of addons could break in the process of this change.
If you see a big error in console, with the phrase
java.lang.NoSuchFieldError: currentScript
,java.lang.NoSuchFieldError: currentSections
,java.lang.NoSuchFieldError: currentLoops
orjava.lang.NoSuchFieldError: hasDelayBefore
, this is probably why.Affected addons
The addons below have been (partially) broken by this update, and will need to be updated. If an addon you use is not in this list, it might still be affected. I've checked all addons that are available on SkriptTools.net, so if an addon you use is on that site, but not in this list, then this update probably didn't break it.
Do note that addons on this list will probably still work, but some syntaxes of the addons can be broken.
What users can do to fix this
You should report this issue to the addon author. Unfortunately, not all addons are still maintained. For that reason, SkriptAddonPatcher has been created. This tool patches addons so that they work with the new system. The instructions on how to use it, can be found on the GitHub page of the patcher tool. You can also use this tool if the addon hasn't updated yet, but you do want to start using the new Skript update.
Another tool that can be used is RuntimeSkriptAddonPatcher, which is based on SkriptAddonPatcher, but as a plugin. This plugin is easier to use then the tool, see the README for instructions on how to use the plugin.
What addon developers can do to fix this
If you want to check if your addon needs to be updated, you can use the patcher tool, which shows if your addon needs to be updated, and it shows which classes have to be updated. The tool checks if your addon use any of the following fields:
ch.njol.skript.ScriptLoader#currentScript
ch.njol.skript.ScriptLoader#currentSections
ch.njol.skript.ScriptLoader#currentLoops
ch.njol.skript.ScriptLoader#hasDelayBefore
Usages of these fields can be replaced with getters and setters in the
ScriptLoader
class:getCurrentScript
/setCurrentScript
getCurrentSections
/setCurrentSections
getCurrentLoops
/setCurrentLoops
getHasDelayBefore
/setHasDelayBefore
Once you have replaced the field usages with these getters and setters, it should work again, so if you want to quickly update the addon to make it work, you can stop here.
You will notice that these methods you just used are deprecated, and so are a lot of other methods in
ScriptLoader
, such asisCurrentEvent(Class<? extends Event>)
. All of these methods have been moved to theParserInstance
class, and are no longer static. To get anParserInstance
object, useParserInstance.get()
, using this you can call your methods as you would previously on theScriptLoader
class.Because
ParserInstance.get()
is rather long, the methodgetParser()
is available in all syntax element classes, for example seeExprMe
Beta Was this translation helpful? Give feedback.
All reactions