mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-03 00:16:42 +00:00
Actually add Player as a field to the commands
This commit is contained in:
@ -21,16 +21,15 @@ import org.jetbrains.annotations.NotNull;
|
||||
@CommandParameters(name = "world", description = "Teleport to a world.", usage = "/<command> <world>")
|
||||
public class WorldCMD extends PlexCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public Component execute(CommandSender sender, String[] args)
|
||||
public Component execute(CommandSender sender, Player playerSender, String[] args)
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
throw new CommandArgumentException();
|
||||
}
|
||||
World world = getNonNullWorld(args[0]);
|
||||
((Player)sender).teleportAsync(new Location(world, 0, world.getHighestBlockYAt(0, 0) + 1, 0, 0, 0));
|
||||
playerSender.teleportAsync(new Location(world, 0, world.getHighestBlockYAt(0, 0) + 1, 0, 0, 0));
|
||||
return tl("playerWorldTeleport", world.getName());
|
||||
}
|
||||
|
||||
@ -43,5 +42,4 @@ public class WorldCMD extends PlexCommand
|
||||
}
|
||||
return ImmutableList.of();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user