diff --git a/next/src/main/kotlin/org/incendo/interfaces/next/view/PlayerInterfaceView.kt b/next/src/main/kotlin/org/incendo/interfaces/next/view/PlayerInterfaceView.kt index fc7ceb7..30330da 100644 --- a/next/src/main/kotlin/org/incendo/interfaces/next/view/PlayerInterfaceView.kt +++ b/next/src/main/kotlin/org/incendo/interfaces/next/view/PlayerInterfaceView.kt @@ -35,8 +35,18 @@ public class PlayerInterfaceView internal constructor( InterfacesListeners.INSTANCE.setOpenInterface(player.uniqueId, this) } - // Trigger onOpen manually because there is no real inventory being opened - onOpen() + // Double-check that this inventory is open now! + if (isOpen(player)) { + // Clear the player's inventory! + player.inventory.clear() + if (player.openInventory.topInventory.type == InventoryType.CRAFTING) { + player.openInventory.topInventory.clear() + } + player.openInventory.cursor = null + + // Trigger onOpen manually because there is no real inventory being opened + onOpen() + } } override fun close() {