diff --git a/build.gradle.kts b/build.gradle.kts index 99b1a2f..cb06660 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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." diff --git a/src/main/kotlin/city/newnan/violet/gui/PlayerGuiSession.kt b/src/main/kotlin/city/newnan/violet/gui/PlayerGuiSession.kt index 238192f..13bb679 100644 --- a/src/main/kotlin/city/newnan/violet/gui/PlayerGuiSession.kt +++ b/src/main/kotlin/city/newnan/violet/gui/PlayerGuiSession.kt @@ -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 { @@ -61,7 +62,7 @@ class PlayerGuiSession(val player: Player) { } @Synchronized - fun refresh(show: Boolean = true) { + fun refresh() { if (!player.isOnline) { clear() return @@ -69,7 +70,7 @@ class PlayerGuiSession(val player: Player) { 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) } } }