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

Container queries crash if clickOnSlot is the first step #1749

Open
kristofbolyai opened this issue Jul 14, 2023 · 4 comments
Open

Container queries crash if clickOnSlot is the first step #1749

kristofbolyai opened this issue Jul 14, 2023 · 4 comments
Labels
All mod loaders bug Something isn't working confimed

Comments

@kristofbolyai
Copy link
Collaborator

kristofbolyai commented Jul 14, 2023

[20:32:24] [Render thread/ERROR] (wynntils) Exception thrown by com.wynntils.screens.questbook.WynntilsQuestBookScreen.init()
 java.lang.NullPointerException: Cannot invoke "com.wynntils.handlers.container.type.ContainerContent.containerId()" because "container" is null
	at com.wynntils.handlers.container.scriptedquery.QueryStep.lambda$clickOnSlot$3(QueryStep.java:46) ~[main/:?]
	at com.wynntils.handlers.container.scriptedquery.QueryStep.startStep(QueryStep.java:85) ~[main/:?]
	at com.wynntils.handlers.container.scriptedquery.ScriptedContainerQuery.startStep(ScriptedContainerQuery.java:51) ~[main/:?]
	at com.wynntils.handlers.container.scriptedquery.FixedQueryStep.startStep(FixedQueryStep.java:23) ~[main/:?]
	at com.wynntils.handlers.container.scriptedquery.ScriptedContainerQuery.startStep(ScriptedContainerQuery.java:51) ~[main/:?]
	at com.wynntils.handlers.container.ContainerQueryHandler.runQuery(ContainerQueryHandler.java:73) ~[main/:?]
	at com.wynntils.handlers.container.scriptedquery.ScriptedContainerQuery.executeQuery(ScriptedContainerQuery.java:46) ~[main/:?]
	at com.wynntils.models.content.ContentBookQueries.queryContentBook(ContentBookQueries.java:140) ~[main/:?]
	at com.wynntils.models.content.ContentModel.scanContentBook(ContentModel.java:237) ~[main/:?]
	at com.wynntils.models.quests.QuestModel.rescanQuestBook(QuestModel.java:61) ~[main/:?]
	at com.wynntils.screens.questbook.WynntilsQuestBookScreen.doInit(WynntilsQuestBookScreen.java:77) ~[main/:?]
	at com.wynntils.screens.base.WynntilsScreen.init(WynntilsScreen.java:37) ~[main/:?]
	at net.minecraft.client.gui.screens.Screen.init(Screen.java:427) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.setScreen(Minecraft.java:1079) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at com.wynntils.screens.base.WynntilsMenuScreenBase.openBook(WynntilsMenuScreenBase.java:32) ~[main/:?]
	at com.wynntils.features.ui.WynntilsContentBookFeature.tryCancelQuestBookOpen(WynntilsContentBookFeature.java:123) ~[main/:?]
	at com.wynntils.features.ui.WynntilsContentBookFeature.onUseItem(WynntilsContentBookFeature.java:97) ~[main/:?]
	at com.wynntils.features.ui.__WynntilsContentBookFeature_onUseItem_UseItemEvent.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:73) ~[eventbus-6.0.5.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar:?]
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar:?]
	at com.wynntils.core.events.EventBusWrapper.post(EventBusWrapper.java:54) ~[main/:?]
	at com.wynntils.core.WynntilsMod.postEvent(WynntilsMod.java:69) ~[main/:?]
	at com.wynntils.core.events.MixinHelper.post(MixinHelper.java:21) ~[main/:?]
	at net.minecraft.client.multiplayer.MultiPlayerGameMode.handler$zbp000$wynntils$useItemPre(MultiPlayerGameMode.java:661) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.multiplayer.MultiPlayerGameMode.useItem(MultiPlayerGameMode.java) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.startUseItem(Minecraft.java:1819) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.handleKeybinds(Minecraft.java:2053) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.tick(Minecraft.java:1880) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:1180) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:801) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:237) ~[minecraft-merged-project-@fabric-1.19.4-loom.mappings.1_19_4.layered+hash.529533973-v2.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.21.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) ~[dev-launch-injector-0.2.1+build.8.jar:?]
	at dev.architectury.transformer.TransformerRuntime.main(TransformerRuntime.java:219) ~[architectury-transformer-5.2.76-runtime.jar:?]
@kristofbolyai
Copy link
Collaborator Author

Happened while I am working on a better way to open the quest book.

@magicus
Copy link
Member

magicus commented Jul 14, 2023

Yeah... you can't really do that. There is no previous container, so we pass in null. (This too is documented ;-))

What was your intention? To work with an existing open container?

@kristofbolyai
Copy link
Collaborator Author

I sent a patch containing what was trying to make the queries more stable...

@magicus
Copy link
Member

magicus commented Jul 14, 2023

Ah, I see. Yeah, your patch was good, but the clickOnSlot method in the scripted query assumes you will receive a ContainerContent object from a preceding container query operation. This, however, is not documented. :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All mod loaders bug Something isn't working confimed
Projects
None yet
Development

No branches or pull requests

2 participants