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