net.silkmc.silk.igui.GuiDimensions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of silk-igui Show documentation
Show all versions of silk-igui Show documentation
Silk is a Minecraft API for Kotlin
package net.silkmc.silk.igui
data class GuiDimensions(val width: Int, val height: Int) {
val slotAmount = width * height
val guiSlots = ArrayList().apply {
for (row in 1..height) for (slotInRow in 1..width) {
add(GuiSlot(row, slotInRow))
}
sortBy { it.slotIndexIn(this@GuiDimensions) }
}
val slotMap = HashMap().apply {
guiSlots.forEach {
put(it.slotIndexIn(this@GuiDimensions)!!, it)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy