Shortcut for getting all worlds

This commit is contained in:
copyandexecute
2021-08-27 19:28:42 +02:00
parent 424945d562
commit 87e1b836da

View File

@@ -3,6 +3,7 @@ package net.axay.kspigot.extensions
import net.axay.kspigot.main.PluginInstance
import org.bukkit.Bukkit
import org.bukkit.NamespacedKey
import org.bukkit.World
import org.bukkit.command.CommandSender
import org.bukkit.entity.Player
@@ -47,3 +48,9 @@ val console get() = Bukkit.getConsoleSender()
* Shortcut for creating a new [NamespacedKey]
*/
fun pluginKey(key: String) = NamespacedKey(PluginInstance, key)
/**
* Shortcut to get a collection of all worlds
*/
val worlds: Collection<World> get() = Bukkit.getWorlds()