SkytAsul / BeautyQuests

A quests plugin based on a simple-to-use graphical interface (Minecraft)
MIT License
155 stars 33 forks source link

Can't save a quest #248

Closed KikyoC closed 1 year ago

KikyoC commented 1 year ago

Describe the bug
I can't save a quest in the editor

Reproduction Steps to reproduce the behavior. (If not already explained above.)

Setup a quest

Screenshots, error messages


java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getName()" because "this.world" is null
        at org.bukkit.Location.serialize(Location.java:572) ~[patched_1.8.8.jar:git-PaperSpigot-445]
        at fr.skytasul.quests.utils.types.BQLocation.serialize(BQLocation.java:134) ~[?:?]
        at fr.skytasul.quests.stages.StageInteract.serialize(StageInteract.java:131) ~[?:?]
        at fr.skytasul.quests.api.stages.AbstractStage.save(AbstractStage.java:312) ~[?:?]
        at fr.skytasul.quests.structure.QuestBranch.save(QuestBranch.java:279) ~[?:?]
        at fr.skytasul.quests.structure.BranchesManager.lambda$save$1(BranchesManager.java:103) ~[?:?]
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) [?:?]
        at fr.skytasul.quests.structure.BranchesManager.save(BranchesManager.java:101) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.structure.Quest.save(Quest.java:491) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.structure.Quest.saveToFile(Quest.java:460) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.gui.creation.FinishGUI.finish(FinishGUI.java:221) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.gui.creation.FinishGUI.access$200(FinishGUI.java:41) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.gui.creation.FinishGUI$3.click(FinishGUI.java:139) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.gui.creation.FinishGUI.onClick(FinishGUI.java:162) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.gui.Inventories.onClick(Inventories.java:84) [beautyquests-0.20.0.jar:?]
        at fr.skytasul.quests.QuestsListener.onClick(QuestsListener.java:132) [beautyquests-0.20.0.jar:?]
        at jdk.internal.reflect.GeneratedMethodAccessor128.invoke(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:300) [patched_1.8.8.jar:git-PaperSpigot-445]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:517) [patched_1.8.8.jar:git-PaperSpigot-445]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:502) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:1657) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:31) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PacketPlayInWindowClick.a(SourceFile:9) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.8.8.jar:git-PaperSpigot-445]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
        at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:774) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched_1.8.8.jar:git-PaperSpigot-445]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched_1.8.8.jar:git-PaperSpigot-445]
        at java.lang.Thread.run(Thread.java:833) [?:?]
[17:15:50 WARN]: [BeautyQuests] An error occurred while saving quest 10```

**Software**
BeautyQuests version: 0.20
Game version: 1.8.8
Server version: 1.8..8
Server type (e.i. PaperSpigot): Paper
Are you using a protocol hack (like ViaVersion)?
Yes

**Additional context (optional)**

(FR: Si vous êtes plus facilement compréhensible en français, écrivez dans cette langue car il s'agit de ma langue natale)
SkytAsul commented 1 year ago

Gosh I hate 1.8. May I send you a JAR in private message so you can test it? My Discord ID is SkytAsul#1292.

SkytAsul commented 1 year ago

Fixed in https://github.com/SkytAsul/BeautyQuests/commit/1620cfd59c708ef63f5f6c27af1695d34ac3977b. Download 0.20.1 dev build.