diff --git a/src/main/kotlin/pw.hamzantal.shopreborn/Util.kt b/src/main/kotlin/pw.hamzantal.shopreborn/Util.kt index b3d1ef2..85b665e 100644 --- a/src/main/kotlin/pw.hamzantal.shopreborn/Util.kt +++ b/src/main/kotlin/pw.hamzantal.shopreborn/Util.kt @@ -7,6 +7,7 @@ import org.bukkit.configuration.ConfigurationSection import org.bukkit.entity.Player import org.bukkit.inventory.Inventory import org.bukkit.inventory.ItemStack +import kotlin.math.max val String.c: String get() = ChatColor.translateAlternateColorCodes('&', this) @@ -48,7 +49,7 @@ fun makeInventory( if (page != total) setItem(menuRow + 8, buttons.forward) } - val dropping = (page - 1) * (size - kotlin.math.max(0, menuRow)) + val dropping = (page - 1) * (if(menuRow > 0) (size - 9) else size) items.drop(dropping).forEach { if (firstEmpty() != -1) setItem(firstEmpty(), it.item) else return@apply