diff --git a/build.gradle.kts b/build.gradle.kts index 8cd5354..0dcd4a9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "net.azisaba" -version = "6.11.1" +version = "6.11.2" java { toolchain.languageVersion.set(JavaLanguageVersion.of(8)) diff --git a/src/main/java/com/github/mori01231/lifecore/LifeCore.kt b/src/main/java/com/github/mori01231/lifecore/LifeCore.kt index c8e34bf..73795c1 100644 --- a/src/main/java/com/github/mori01231/lifecore/LifeCore.kt +++ b/src/main/java/com/github/mori01231/lifecore/LifeCore.kt @@ -274,6 +274,7 @@ class LifeCore : JavaPlugin() { pm.registerEvents(OverrideTabCompleteListener(), this) pm.registerEvents(KotlinLoveItemListener(this), this) pm.registerEvents(CommandListScreen.EventListener(), this) + pm.registerEvents(UpdateInventoryOnCloseListener(this), this) // Items pm.registerEvents(OreOnlyItemListener(), this) diff --git a/src/main/java/com/github/mori01231/lifecore/listener/UpdateInventoryOnCloseListener.kt b/src/main/java/com/github/mori01231/lifecore/listener/UpdateInventoryOnCloseListener.kt new file mode 100644 index 0000000..2b5130a --- /dev/null +++ b/src/main/java/com/github/mori01231/lifecore/listener/UpdateInventoryOnCloseListener.kt @@ -0,0 +1,17 @@ +package com.github.mori01231.lifecore.listener + +import com.github.mori01231.lifecore.LifeCore +import org.bukkit.Bukkit +import org.bukkit.entity.Player +import org.bukkit.event.EventHandler +import org.bukkit.event.Listener +import org.bukkit.event.inventory.InventoryCloseEvent + +class UpdateInventoryOnCloseListener(private val plugin: LifeCore) : Listener { + @EventHandler + fun onInventoryClose(e: InventoryCloseEvent) { + Bukkit.getScheduler().runTask(plugin, Runnable { + (e.player as Player).updateInventory() + }) + } +} \ No newline at end of file