SkriptLang / skript-reflect

Powerful reflection utilities for Skript.
MIT License
56 stars 19 forks source link

Severe Error: ch.njol.skript.config.Config ch.njol.skript.lang.parser.ParserInstance.getCurrentScript() #76

Closed ToxykAuBleu closed 7 months ago

ToxykAuBleu commented 7 months ago

Describe the bug I switched from Paper 1.19.2 to 1.20.2 recently with a script file containing 0 problem whatsoever. Then, on server start, when loading this same skript file, Skript thrown an servere error on console. I tested with reloading in game but I got the same error. This happened only when trying to loading a file containing imported class.

To reproduce I have a script file that contains stuff related to PlotSquarred plugin, see following snippet:

import:
    com.plotsquared.core.player.PlotPlayer
    com.plotsquared.core.plot.Plot
    com.plotsquared.core.plot.PlotId
    com.plotsquared.core.PlotAPI
    com.plotsquared.core.PlotSquared
    java.util.function.Consumer
    java.util.UUID

    com.plotsquared.core.plot.flag.implementations.WeatherFlag
    com.plotsquared.core.plot.flag.implementations.TimeFlag
    com.plotsquared.core.plot.flag.implementations.GamemodeFlag
    com.plotsquared.core.plot.flag.implementations.PlayerInteractFlag
    com.plotsquared.core.plot.flag.implementations.PvpFlag
    com.plotsquared.core.command.Biome

    com.plotsquared.core.events.PlotEvent
    com.plotsquared.core.events.PlotPlayerEvent
    com.plotsquared.core.events.PlayerEnterPlotEvent
    com.plotsquared.core.events.PlayerClaimPlotEvent
    com.plotsquared.core.events.PlayerAutoPlotEvent
    com.google.common.eventbus.Subscribe
    com.plotsquared.core.events.Result
       ...

on load:
    if {PlotListener} is set:
        PlotSquared.get().getEventDispatcher().unregisterListener({PlotListener})
    set {PlotListener} to new P2Listener()

Expected behavior Load correctly my skript file.

Server information

Additional context You can find here complete stack trace:

[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! [Skript] Severe Error:
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Something went horribly wrong with Skript.
[17:25:06 ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[17:25:06 ERROR]: #!#! It looks like you are using some plugin(s) that alter how Skript works (addons).
[17:25:06 ERROR]: #!#! Here is full list of them:
[17:25:06 ERROR]: #!#! skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders) skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect) skript-gui v1.3-alpha3 (https://githu
b.com/APickledWalrus/skript-gui) SkBee v2.18.3 (https://github.com/ShaneBeee/SkBee) skript-yaml v1.5 Hippo v1.0 skript-db v1.3.9
[17:25:06 ERROR]: #!#! We could not identify which of those are specially related, so this might also be Skript issue.
[17:25:06 ERROR]: #!#! You should try disabling those plugins one by one, trying to find which one causes it.
[17:25:06 ERROR]: #!#! If the error doesn't disappear even after disabling all listed plugins, it is probably Skript issue.
[17:25:06 ERROR]: #!#! In that case, you will be given instruction on how should you report it.
[17:25:06 ERROR]: #!#! On the other hand, if the error disappears when disabling some plugin, report it to author of that plugin.
[17:25:06 ERROR]: #!#! Only if the author tells you to do so, report it to Skript's issue tracker.
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Stack trace:
[17:25:06 ERROR]: #!#! java.lang.NoSuchMethodError: 'ch.njol.skript.config.Config ch.njol.skript.lang.parser.ParserInstance.getCurrentScript()'
[17:25:06 ERROR]: #!#!     at skript-reflect.jar//com.btk5h.skriptmirror.util.SkriptUtil.getCurrentScript(SkriptUtil.java:108)
[17:25:06 ERROR]: #!#!     at skript-reflect.jar//com.btk5h.skriptmirror.skript.custom.CustomImport$SectionImport.init(CustomImport.java:82)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.lang.SkriptEvent.init(SkriptEvent.java:97)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//org.skriptlang.skript.lang.structure.Structure.init(Structure.java:117)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:266)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.lang.SkriptParser.parseStatic(SkriptParser.java:204)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//org.skriptlang.skript.lang.structure.Structure.parse(Structure.java:184)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:654)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.lambda$loadScripts$3(ScriptLoader.java:501)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.lambda$makeFuture$2(ScriptLoader.java:422)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.makeFuture(ScriptLoader.java:438)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:500)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:457)
[17:25:06 ERROR]: #!#!     at Skript-2.7.jar//ch.njol.skript.Skript$1.run(Skript.java:812)
[17:25:06 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101)
[17:25:06 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480)
[17:25:06 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1097)
[17:25:06 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315)
[17:25:06 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:833)
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Version Information:
[17:25:06 ERROR]: #!#!   Skript: 2.7.1
[17:25:06 ERROR]: #!#!     Flavor: skriptlang-github
[17:25:06 ERROR]: #!#!     Date: 15:04:11.832253
[17:25:06 ERROR]: #!#!   Bukkit: 1.20.2-R0.1-SNAPSHOT
[17:25:06 ERROR]: #!#!   Minecraft: 1.20.2
[17:25:06 ERROR]: #!#!   Java: 17.0.7 (OpenJDK 64-Bit Server VM 17.0.7+7-Debian-1deb11u1)
[17:25:06 ERROR]: #!#!   OS: Linux amd64 5.10.0-24-amd64
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Server platform: Paper
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Current node: null
[17:25:06 ERROR]: #!#! Current item: null
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Thread: Server thread
[17:25:06 ERROR]: #!#!
[17:25:06 ERROR]: #!#! Language: english
[17:25:06 ERROR]: #!#! Link parse mode: DISABLED
ToxykAuBleu commented 7 months ago

This severe error isn't in fact related both Skript and skript-reflect.

OmegaWulf commented 4 months ago

This severe error isn't in fact related both Skript and skript-reflect.

What ended up being your problem? I'm looking at something similar. @ToxykAuBleu

ToxykAuBleu commented 4 months ago

This severe error isn't in fact related both Skript and skript-reflect.

What ended up being your problem? I'm looking at something similar. @ToxykAuBleu

@OmegaWulf My skript file used custom class written with Hippo addon, and at that time, it wasn't updated to the last version of Skript (2.7.1) and Skript-reflect. See this