Last active
January 29, 2020 15:20
-
-
Save bizarre/3f8c88d217cfd9d7879033c0cfa5c10f to your computer and use it in GitHub Desktop.
kotlinic bukkit gui library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val slate = Slate.Builder.withPlugin(plugin).build() | |
slate { | |
title("Worlds") | |
provider { | |
for ((index, world) in Bukkit.getWorld().withIndex()) { | |
button(index + 1) { | |
name(world.name) | |
lore("Entities: ${world.entities.size}") | |
type(when (world.environment!!) { | |
World.Environment.NORMAL -> Material.GRASS | |
World.Environment.NETHER -> Material.NETHERRACK | |
World.Environment.THE_END -> Material.ENDER_STONE | |
}) | |
clicked { player -> | |
player.teleport(world.spawnLocation) | |
} | |
} | |
} | |
} | |
}.open(player) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment