All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.projecttl.kuma.mc.api.utils.VehicleData.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta.8
Show newest version
package net.projecttl.kuma.mc.api.utils

import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import net.minestom.server.coordinate.Pos
import net.minestom.server.entity.Player

class VehicleData(
    val id: Int,
    val name: String,
    val upper: Area?,
    val lower: Area?,
    val upperPos: Pos,
    val lowerPos: Pos) {
    fun Player.next(traffic: List, obj: String) {
        val next = traffic[id + 1]
        teleport(next.lowerPos)
        sendMessage(
            Component.text(next.name, NamedTextColor.YELLOW)
            .append(Component.text("${obj}에 도착 하였습니다.")))
    }

    fun Player.prev(traffic: List, obj: String) {
        val prev = traffic[id - 1]
        teleport(prev.upperPos)
        sendMessage(Component.text(prev.name, NamedTextColor.YELLOW)
            .append(Component.text("${obj}에 도착 하였습니다.")))
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy