Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
use nextPlayerOrSender in /nu launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Librazy committed Feb 6, 2019
1 parent 802729b commit 328b7be
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/main/java/cat/nyaa/nyaautils/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,7 @@ public void commandLaunch(CommandSender sender, Arguments args) {
double speed = args.nextDouble();
int delay = args.nextInt();
int launchSpeed = args.nextInt();
String pName = args.next();
if (pName == null) {
if (sender instanceof Player) {
pName = sender.getName();
} else {
sender.sendMessage(I18n.format("user.launch.missing_name"));
return;
}
}
Player p = Bukkit.getPlayer(pName);
if (p == null) {
sender.sendMessage(I18n.format("user.launch.player_not_online", pName));
return;
}
Player p = args.nextPlayerOrSender();

ItemStack chestPlate = p.getInventory().getChestplate();
if (chestPlate == null || chestPlate.getType() != Material.ELYTRA) {
Expand Down

0 comments on commit 328b7be

Please sign in to comment.