Skip to content

Commit

Permalink
fix: Don't trigger contents save mid inventory open
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeltumn committed Sep 6, 2024
1 parent 973e01c commit 7661fec
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)

/** Closes the given [view] of a player interface. */
public fun closePlayerInterface(playerId: UUID, view: PlayerInterfaceView?) {
// Save the contents of their currently shown inventory
val bukkitPlayer = Bukkit.getPlayer(playerId)
if (bukkitPlayer != null) {
saveInventoryContentsIfOpened(bukkitPlayer)
}

abortQuery(playerId, view)
if (view == null) {
backgroundPlayerInterfaceViews.invalidate(playerId)
Expand Down Expand Up @@ -423,6 +417,7 @@ public class InterfacesListeners private constructor(private val plugin: Plugin)

@EventHandler
public fun onPlayerQuit(event: PlayerQuitEvent) {
// Save the contents of their currently shown inventory
abortQuery(event.player.uniqueId, null)
closePlayerInterface(event.player.uniqueId, null)
}
Expand Down

0 comments on commit 7661fec

Please sign in to comment.