net.projecttl.inventory.util.MathSupport.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of InventoryGUI-api Show documentation
Show all versions of InventoryGUI-api Show documentation
This is minecraft gui library
package net.projecttl.inventory.util
/**
* Math in inventories
*/
object MathSupport {
fun toLocation(index: Int): InvLocation {
return InvLocation(index / 9, index % 9)
}
fun toIndex(location: InvLocation): Int {
return location.y * 9 + location.x
}
}