mirror of
https://github.com/plexusorg/Plex.git
synced 2025-04-12 05:13:14 +00:00
40 lines
1.4 KiB
Java
40 lines
1.4 KiB
Java
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 java.util.Collections;
|
|
import java.util.List;
|
|
import net.kyori.adventure.text.Component;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.Location;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
@CommandPermissions(permission = "plex.flatlands", source = RequiredCommandSource.IN_GAME)
|
|
@CommandParameters(name = "flatlands", description = "Teleport to the flatlands")
|
|
public class FlatlandsCMD extends PlexCommand
|
|
{
|
|
@Override
|
|
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
|
|
{
|
|
assert playerSender != null;
|
|
if (args.length == 0)
|
|
{
|
|
Location loc = new Location(Bukkit.getWorld("flatlands"), 0, 50, 0);
|
|
playerSender.teleportAsync(loc);
|
|
return messageComponent("teleportedToWorld", "flatlands");
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
|
{
|
|
return Collections.emptyList();
|
|
}
|
|
}
|