Commit c728b9f5 authored by KingRainbow44's avatar KingRainbow44
Browse files

Attempt to fix `!givechar`

parent 69cb03f4
...@@ -186,12 +186,12 @@ public final class PlayerCommands { ...@@ -186,12 +186,12 @@ public final class PlayerCommands {
} }
@Command(label = "givechar", aliases = {"givec"}, @Command(label = "givechar", aliases = {"givec"},
usage = "Usage: givechar <player|avatarId> [avatarId] [level]") usage = "Usage: givechar <player|avatarId> [level|avatarId] [level]")
public static class GiveCharCommand implements CommandHandler { public static class GiveCharCommand implements CommandHandler {
@Override public void execute(GenshinPlayer player, List<String> args) { @Override public void execute(GenshinPlayer player, List<String> args) {
int target, avatarId, level = 1, ascension = 1; int target, avatarId, level = 1, ascension = 1;
if(args.size() < 2) { if(args.size() < 1) {
CommandHandler.sendMessage(player, "Usage: givechar <player> <avatarId> [level]"); CommandHandler.sendMessage(player, "Usage: givechar <player> <avatarId> [level]");
return; return;
} }
...@@ -204,7 +204,8 @@ public final class PlayerCommands { ...@@ -204,7 +204,8 @@ public final class PlayerCommands {
try { try {
target = Integer.parseInt(args.get(0)); target = Integer.parseInt(args.get(0));
if(Grasscutter.getGameServer().getPlayerByUid(target) == null) { if(Grasscutter.getGameServer().getPlayerByUid(target) == null) {
target = player.getUid(); level = Integer.parseInt(args.get(1)); target = player.getUid();
level = Integer.parseInt(args.get(1));
avatarId = Integer.parseInt(args.get(0)); avatarId = Integer.parseInt(args.get(0));
} else { } else {
avatarId = Integer.parseInt(args.get(1)); avatarId = Integer.parseInt(args.get(1));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment