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;
|
|
|
|
import dev.plex.rank.enums.Rank;
|
2022-01-27 09:00:50 +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 09:00:50 +00:00
|
|
|
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-01-04 03:04:39 +00:00
|
|
|
|
2022-01-30 01:31:10 +00:00
|
|
|
@CommandPermissions(level = Rank.OP, permission = "plex.flatlands", source = RequiredCommandSource.IN_GAME)
|
2022-01-27 09:00:50 +00:00
|
|
|
@CommandParameters(name = "flatlands", description = "Teleport to the flatlands")
|
2021-06-20 08:02:07 +00:00
|
|
|
public class FlatlandsCMD extends PlexCommand
|
|
|
|
{
|
|
|
|
|
|
|
|
@Override
|
2022-02-04 04:49:05 +00:00
|
|
|
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, String[] args)
|
2021-06-20 08:02:07 +00:00
|
|
|
{
|
|
|
|
if (args.length == 0)
|
|
|
|
{
|
|
|
|
Location loc = new Location(Bukkit.getWorld("flatlands"), 0, 50, 0);
|
2022-02-04 04:01:30 +00:00
|
|
|
playerSender.teleportAsync(loc);
|
2022-01-27 09:00:50 +00:00
|
|
|
return tl("teleportedToWorld", "flatlands");
|
2021-06-20 08:02:07 +00:00
|
|
|
}
|
2022-01-27 09:00:50 +00:00
|
|
|
return null;
|
2021-06-20 08:02:07 +00:00
|
|
|
}
|
|
|
|
}
|