Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Aug 22, 2023
1 parent cb6e4ea commit dba9fb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ idea {

val targetJavaVersion = 8

version = "2.1.3"
version = "2.1.4"
group = "city.newnan.violet"
description = "Useful toolkits java library for Bukkit Server Plugin."

Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/city/newnan/violet/gui/PlayerGuiSession.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class PlayerGuiSession(val player: Player) {
val (gui, _, close) = history.removeLastOrNull() ?: return
close?.invoke(CloseType.Back, gui, this)
if (history.isEmpty()) gui.close(player)
if (!show && i == step) gui.close(player)
}
history.lastOrNull()?.also { (gui, update, _) ->
Schedulers.sync().run {
Expand All @@ -61,15 +62,15 @@ class PlayerGuiSession(val player: Player) {
}

@Synchronized
fun refresh(show: Boolean = true) {
fun refresh() {
if (!player.isOnline) {
clear()
return
}
history.lastOrNull()?.also { (gui, update, _) ->
Schedulers.sync().run {
if (update?.invoke(UpdateType.Refresh, gui, this) == true) gui.update()
if (show) gui.open(player)
gui.open(player)
}
}
}
Expand Down

0 comments on commit dba9fb5

Please sign in to comment.