30 lines
830 B
Kotlin
30 lines
830 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 Warp(id: EntityID<Int>) : IntEntity(id) {
|
|
companion object : IntEntityClass<Warp>(Warps)
|
|
|
|
var x by Warps.x
|
|
var y by Warps.y
|
|
var z by Warps.z
|
|
var world by Warps.world
|
|
var pitch by Warps.pitch
|
|
var yaw by Warps.yaw
|
|
var name by Warps.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
|
|
}
|
|
|
|
} |