diff --git a/src/main/java/cat/nyaa/nyaautils/CommandHandler.java b/src/main/java/cat/nyaa/nyaautils/CommandHandler.java index e2a727b..0b62b85 100644 --- a/src/main/java/cat/nyaa/nyaautils/CommandHandler.java +++ b/src/main/java/cat/nyaa/nyaautils/CommandHandler.java @@ -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) {