|
|
@ -7,6 +7,7 @@ import org.bukkit.configuration.ConfigurationSection
|
|
|
|
import org.bukkit.entity.Player
|
|
|
|
import org.bukkit.entity.Player
|
|
|
|
import org.bukkit.inventory.Inventory
|
|
|
|
import org.bukkit.inventory.Inventory
|
|
|
|
import org.bukkit.inventory.ItemStack
|
|
|
|
import org.bukkit.inventory.ItemStack
|
|
|
|
|
|
|
|
import kotlin.math.max
|
|
|
|
|
|
|
|
|
|
|
|
val String.c: String
|
|
|
|
val String.c: String
|
|
|
|
get() = ChatColor.translateAlternateColorCodes('&', this)
|
|
|
|
get() = ChatColor.translateAlternateColorCodes('&', this)
|
|
|
@ -48,7 +49,7 @@ fun makeInventory(
|
|
|
|
if (page != total) setItem(menuRow + 8, buttons.forward)
|
|
|
|
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 {
|
|
|
|
items.drop(dropping).forEach {
|
|
|
|
if (firstEmpty() != -1) setItem(firstEmpty(), it.item)
|
|
|
|
if (firstEmpty() != -1) setItem(firstEmpty(), it.item)
|
|
|
|
else return@apply
|
|
|
|
else return@apply
|
|
|
|