Plex/server/src/main/java/dev/plex/command/impl/LocalSpawnCMD.java

25 lines
1.0 KiB
Java
Raw Normal View History

package dev.plex.command.impl;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@CommandParameters(name = "localspawn", description = "Teleport to the spawnpoint of the world you are in")
@CommandPermissions(level = Rank.OP, permission = "plex.spawnpoint", source = RequiredCommandSource.IN_GAME)
public class LocalSpawnCMD extends PlexCommand
{
@Override
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
{
assert playerSender != null;
playerSender.teleportAsync(playerSender.getWorld().getSpawnLocation());
2022-02-25 07:09:55 +00:00
return messageComponent("teleportedToWorldSpawn");
}
}