Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
toxicity188 committed Feb 26, 2024
1 parent 05848c2 commit f9d74a4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions dist/src/main/kotlin/kr/toxicity/inventory/gui/GuiBuilderImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,18 @@ class GuiBuilderImpl: GuiBuilder {
player.openInventory(holder.inventory)
GuiTask {
if (!holder.isCancelled && player.openInventory.topInventory.holder === holder) {
var finalComp = comp
renderer.values.forEach {
if (it.enabled) {
val next = it.next()
finalComp += next + NEGATIVE_ONE_SPACE_COMPONENT + NEW_LAYER + (-next.width).toSpaceComponent()
if (renderer.isNotEmpty()) {
var finalComp = comp
renderer.values.forEach {
if (it.enabled) {
val next = it.next()
finalComp += next + NEGATIVE_ONE_SPACE_COMPONENT + NEW_LAYER + (-next.width).toSpaceComponent()
}
}
holder.setInventory(finalComp.component)
player.openInventory(holder.inventory)
holder.isCancelled = false
}
holder.setInventory(finalComp.component)
player.openInventory(holder.inventory)
holder.isCancelled = false
false
} else {
player.closeInventory()
Expand Down

0 comments on commit f9d74a4

Please sign in to comment.