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

33 lines
1.2 KiB
Java
Raw Normal View History

2021-06-20 08:02:07 +00:00
package dev.plex.command.impl;
2022-01-04 03:04:39 +00:00
import dev.plex.command.PlexCommand;
2021-06-20 08:02:07 +00:00
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
2022-01-27 05:28:30 +00:00
import net.kyori.adventure.text.Component;
2021-06-20 08:02:07 +00:00
import org.bukkit.Bukkit;
import org.bukkit.Location;
2022-01-27 05:28:30 +00:00
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
2022-01-04 03:04:39 +00:00
@CommandPermissions(permission = "plex.adminworld", source = RequiredCommandSource.IN_GAME)
2022-01-27 05:28:30 +00:00
@CommandParameters(name = "adminworld", aliases = "aw", description = "Teleport to the adminworld")
2021-06-20 08:02:07 +00:00
public class AdminworldCMD extends PlexCommand
{
@Override
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
2021-06-20 08:02:07 +00:00
{
assert playerSender != null;
2021-06-20 08:02:07 +00:00
// TODO: Add adminworld settings
if (args.length == 0)
{
Location loc = new Location(Bukkit.getWorld("adminworld"), 0, 50, 0);
playerSender.teleportAsync(loc);
2022-02-25 07:09:55 +00:00
return messageComponent("teleportedToWorld", "adminworld");
2021-06-20 08:02:07 +00:00
}
2022-01-27 05:28:30 +00:00
return null;
2021-06-20 08:02:07 +00:00
}
}