VoidPlugin/VoidTeleport/src/main/kotlin/nl/voidcorp/teleportplugin/models/Home.kt

30 lines
860 B
Kotlin

package nl.voidcorp.teleportplugin.models
import org.bukkit.Bukkit
import org.bukkit.Location
import org.jetbrains.exposed.dao.EntityID
import org.jetbrains.exposed.dao.IntEntity
import org.jetbrains.exposed.dao.IntEntityClass
class Home(id: EntityID<Int>) : IntEntity(id) {
companion object : IntEntityClass<Home>(Homes)
var userId by Homes.userid
var x by Homes.x
var y by Homes.y
var z by Homes.z
var world by Homes.world
var pitch by Homes.pitch
var yaw by Homes.yaw
var name by Homes.name
var location: Location
get() = Location(Bukkit.getWorld(world), x, y, z, yaw, pitch)
set(value) {
this.x = value.x
this.y = value.y
this.z = value.z
this.world = value.world.uid
this.yaw = value.yaw
this.pitch = value.pitch
}
}