Skip to content
坏黑 edited this page May 29, 2022 · 2 revisions

Bukkit

由 Artifex 内置的运行于 Bukkit 平台下的几种组件,独立脚本或工程脚本均可以使用。

类型适配函数

用于快速创建 Bukkit 相关类型:

// 获取世界
fun bukkitWorld(name: String): World?

// 获取玩家
fun bukkitPlayer(name: String): Player?

// 获取所有在线玩家
fun bukkitPlayers(): List<Player>

// 获取坐标
fun location(world: String, x: Int, y: Int, z: Int, yaw: Int = 0, pitch: Int = 0): Location
fun location(world: World, x: Int, y: Int, z: Int, yaw: Int = 0, pitch: Int = 0): Location
fun location(world: String, x: Double, y: Double, z: Double, yaw: Double = 0.0, pitch: Double = 0.0): Location
fun location(world: World, x: Double, y: Double, z: Double, yaw: Double = 0.0, pitch: Double = 0.0): Location

// 获取方块
fun block(world: World, x: Int, y: Int, z: Int): Block 
fun block(world: String, x: Int, y: Int, z: Int): Block

// 获取坐标所在位置的最高处的方块
fun highestBlock(world: World, x: Int, z: Int): Block
fun highestBlock(world: String, x: Int, z: Int): Block


// 将 TabooLib 类型转换为 Bunkkit 类型
fun ProxyCommandSender.bukkitPlayer(): Player
fun ProxyCommandSender.bukkitSender(): CommandSender

// 从 Json 转换为 ItemTag 对象
fun itemTagFromJson(json: String): ItemTag

目录

开发资源

相关问题

Clone this wiki locally