Skip to content

Instantly share code, notes, and snippets.

@bizarre
Last active January 29, 2020 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bizarre/3f8c88d217cfd9d7879033c0cfa5c10f to your computer and use it in GitHub Desktop.
Save bizarre/3f8c88d217cfd9d7879033c0cfa5c10f to your computer and use it in GitHub Desktop.
kotlinic bukkit gui library
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