Actually add Player as a field to the commands

This commit is contained in:
2022-02-03 22:01:30 -06:00
parent fe53f5c49f
commit 081a702c70
25 changed files with 81 additions and 50 deletions

View File

@ -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();
}
}