-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add UpdateInventoryOnCloseListener
- Loading branch information
1 parent
61dfbe8
commit 0bbb666
Showing
3 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/com/github/mori01231/lifecore/listener/UpdateInventoryOnCloseListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
}) | ||
} | ||
} |