File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
next/src/main/kotlin/org/incendo/interfaces/next/view Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,18 @@ public class PlayerInterfaceView internal constructor(
3535 InterfacesListeners .INSTANCE .setOpenInterface(player.uniqueId, this )
3636 }
3737
38- // Trigger onOpen manually because there is no real inventory being opened
39- onOpen()
38+ // Double-check that this inventory is open now!
39+ if (isOpen(player)) {
40+ // Clear the player's inventory!
41+ player.inventory.clear()
42+ if (player.openInventory.topInventory.type == InventoryType .CRAFTING ) {
43+ player.openInventory.topInventory.clear()
44+ }
45+ player.openInventory.cursor = null
46+
47+ // Trigger onOpen manually because there is no real inventory being opened
48+ onOpen()
49+ }
4050 }
4151
4252 override fun close () {
You can’t perform that action at this time.
0 commit comments