When rendering a (layout) item with .withItem(), and setting an onClick handler with .onClick(click -> {}), closing the inventory with click.closeForPlayer() throws an exception with the message:
Container is not available in the current context: some.package.inventoryframework.context.SlotClickContext
at some.package.inventoryframework.context.PlatformContext.getContainerOrThrow(PlatformContext.java:111)
I'm not sure if this is because of layouts, but I wouldn't assume so.
✔️ Expected behavior
The inventory should close normally.
👣 Steps to Reproduce
Compile the latest version of inventory-framework from github, and include it in your project
Create a View
In onInit() define a Layout for the View
In onFirstRender(RenderContext render), render an item in the Layout with
Is there an existing issue for this?
🐛 Describe the bug
When rendering a (layout) item with
.withItem()
, and setting anonClick
handler with.onClick(click -> {})
, closing the inventory withclick.closeForPlayer()
throws an exception with the message:I'm not sure if this is because of layouts, but I wouldn't assume so.
✔️ Expected behavior
The inventory should close normally.
👣 Steps to Reproduce
View
onInit()
define aLayout
for theView
onFirstRender(RenderContext render)
, render an item in theLayout
withA
💻 Platform
⭐ Server Version
1.8.9
📚 Library Version
v3.1.0-rc (compiled from github)
✍️ Additional context
No response