VoidPlugin/VoidTeleport/src/main/kotlin/nl/voidcorp/teleportplugin/commands/SetWorldspawnCommand.kt

16 lines
545 B
Kotlin

package nl.voidcorp.teleportplugin.commands
import nl.voidcorp.mainplugin.commands.VoidCommand
import org.bukkit.command.Command
import org.bukkit.command.CommandSender
import org.bukkit.entity.Player
class SetWorldspawnCommand : VoidCommand() {
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
if ((sender is Player) && sender.hasPermission("voidteleport.setspawn")) {
sender.world.spawnLocation = sender.location
}
return true
}
}