From 9188d3b53a194b197a142d75923793bce1329d56 Mon Sep 17 00:00:00 2001 From: Melledy <121644117+Melledy@users.noreply.github.com> Date: Mon, 1 Dec 2025 13:16:24 -0800 Subject: [PATCH] Improve command arg handling --- src/main/java/emu/nebula/command/CommandArgs.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/nebula/command/CommandArgs.java b/src/main/java/emu/nebula/command/CommandArgs.java index 502a14e..4db613b 100644 --- a/src/main/java/emu/nebula/command/CommandArgs.java +++ b/src/main/java/emu/nebula/command/CommandArgs.java @@ -7,8 +7,8 @@ import emu.nebula.game.character.GameCharacter; import emu.nebula.game.character.GameDisc; import emu.nebula.game.player.Player; import emu.nebula.util.Utils; +import it.unimi.dsi.fastutil.ints.Int2IntLinkedOpenHashMap; import it.unimi.dsi.fastutil.ints.Int2IntMap; -import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import it.unimi.dsi.fastutil.objects.ObjectSet; import lombok.Getter; @@ -53,6 +53,9 @@ public class CommandArgs { } else if (arg.startsWith("lv")) { // Level this.level = Utils.parseSafeInt(arg.substring(2)); it.remove(); + } else if (arg.startsWith("lvl")) { // Level + this.level = Utils.parseSafeInt(arg.substring(3)); + it.remove(); } else if (arg.startsWith("a")) { // Advance this.advance = Utils.parseSafeInt(arg.substring(1)); it.remove(); @@ -76,7 +79,7 @@ public class CommandArgs { int key = Integer.parseInt(split[0]); int value = Integer.parseInt(split[1]); - if (this.map == null) this.map = new Int2IntOpenHashMap(); + if (this.map == null) this.map = new Int2IntLinkedOpenHashMap(); this.map.put(key, value); it.remove();