Files
TCOWW/src/main/kotlin/fr/azur/tcoww/utils/BedGestion.kt
2025-11-30 17:22:48 +01:00

23 lines
497 B
Kotlin

package fr.azur.tcoww.utils
import org.bukkit.block.Block
import org.bukkit.block.data.type.Bed
object BedGestion {
fun Block.isBed() = blockData is Bed
fun Block.getHeadBed(): Block {
val bedData = blockData as Bed
return if (bedData.part == Bed.Part.FOOT) {
getRelative(bedData.facing)
} else {
this
}
}
fun Block.isOccupied(): Boolean {
val bedData = blockData as Bed
return bedData.isOccupied
}
}