DevNatan / inventory-framework

Minecraft Inventory API framework
MIT License
124 stars 23 forks source link

Component position is not set. A position for the component must be assigned via #withSlot(...) #647

Open ch4ika opened 8 months ago

ch4ika commented 8 months ago

Is there an existing issue for this?

🐛 Describe the bug

[07:32:44] [Server thread/ERROR]: Could not pass event InventoryClickEvent to PrimePlotAdditions v2.0
java.lang.IllegalStateException: Component position is not set. A position for the component must be assigned via #withSlot(...) in ComponentBuilder or programmatically before render
    at me.devnatan.inventoryframework.component.AbstractBukkitComponent.render(AbstractBukkitComponent.java:85) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.component.AbstractComponent.lambda$new$0(AbstractComponent.java:44) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.loop(PipelineContext.java:43) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.proceed(PipelineContext.java:53) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.execute(PipelineContext.java:59) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.Pipeline.execute(Pipeline.java:128) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformRenderContext.renderComponent(PlatformRenderContext.java:315) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.ContextFirstRenderInterceptor.intercept(ContextFirstRenderInterceptor.java:35) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.ContextFirstRenderInterceptor.intercept(ContextFirstRenderInterceptor.java:21) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.loop(PipelineContext.java:43) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.proceed(PipelineContext.java:53) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.execute(PipelineContext.java:59) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.Pipeline.execute(Pipeline.java:128) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformRenderContext.render(PlatformRenderContext.java:204) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.PlatformView.renderContext(PlatformView.java:303) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.ViewContextOpenInterceptor.finishOpen(ViewContextOpenInterceptor.java:63) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.ViewContextOpenInterceptor.intercept(ViewContextOpenInterceptor.java:37) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.ViewContextOpenInterceptor.intercept(ViewContextOpenInterceptor.java:17) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.loop(PipelineContext.java:43) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.proceed(PipelineContext.java:53) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.execute(PipelineContext.java:59) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.Pipeline.execute(Pipeline.java:128) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.PlatformView.open(PlatformView.java:82) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.PlatformView.navigateTo(PlatformView.java:144) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformConfinedContext.openForPlayer(PlatformConfinedContext.java:41) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformConfinedContext.openForPlayer(PlatformConfinedContext.java:29) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformRenderContext.openForPlayer(PlatformRenderContext.java:152) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.SlotContext.openForPlayer(SlotContext.java:162) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at de.primecodes.plotadditions.view.PlotView.onCreate(PlotView.java:82) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.component.PlatformComponent.clicked(PlatformComponent.java:96) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.component.AbstractComponent.lambda$new$2(AbstractComponent.java:46) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.loop(PipelineContext.java:43) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.proceed(PipelineContext.java:53) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.execute(PipelineContext.java:59) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.Pipeline.execute(Pipeline.java:128) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformRenderContext.clickComponent(PlatformRenderContext.java:278) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.SlotClickToComponentClickCallInterceptor.intercept(SlotClickToComponentClickCallInterceptor.java:20) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.SlotClickToComponentClickCallInterceptor.intercept(SlotClickToComponentClickCallInterceptor.java:8) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.loop(PipelineContext.java:43) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.proceed(PipelineContext.java:53) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.PipelineContext.execute(PipelineContext.java:59) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.pipeline.Pipeline.execute(Pipeline.java:128) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.context.PlatformRenderContext.simulateClick(PlatformRenderContext.java:199) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at me.devnatan.inventoryframework.IFInventoryListener.onInventoryClick(IFInventoryListener.java:40) ~[PrimePlotAdditions-2.0.0-SNAPSHOT.jar:?]
    at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:git-Paper-318]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.2.jar:git-Paper-318]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.2.jar:git-Paper-318]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
    at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:3108) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:58) ~[?:?]
    at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:23) ~[?:?]
    at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$0(PacketUtils.java:53) ~[?:?]
    at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
    at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
    at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1324) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
    at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1301) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1294) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
    at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1272) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1160) ~[paper-1.20.2.jar:git-Paper-318]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-318]
    at java.lang.Thread.run(Thread.java:840) ~[?:?]

✔️ Expected behavior

not fixed: https://github.com/DevNatan/inventory-framework/issues/644

👣 Steps to Reproduce

Open a new view by while have a openview: context.openForPlayer(PlotPlotsView.class);

💻 Platform

⭐ Server Version

1.20.2

📚 Library Version

Feb 13, 2024

✍️ Additional context

No response

DevNatan commented 7 months ago

Thx!! Working on it 🤙🏽