From fcd37cbae21aa455a43be50684fa4110bbb33634 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 28 Jan 2024 11:30:54 -0500 Subject: [PATCH] Dev cmd cleanup --- src/engine/devcmd/cmds/AddMobCmd.java | 35 +++++---------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/engine/devcmd/cmds/AddMobCmd.java b/src/engine/devcmd/cmds/AddMobCmd.java index 1bb09c47..49e872d3 100644 --- a/src/engine/devcmd/cmds/AddMobCmd.java +++ b/src/engine/devcmd/cmds/AddMobCmd.java @@ -10,18 +10,15 @@ package engine.devcmd.cmds; import engine.Enum; -import engine.Enum.GameObjectType; import engine.devcmd.AbstractDevCmd; import engine.gameManager.ChatManager; -import engine.gameManager.DbManager; import engine.gameManager.ZoneManager; -import engine.math.Vector3fImmutable; -import engine.objects.*; +import engine.objects.AbstractGameObject; +import engine.objects.Mob; +import engine.objects.PlayerCharacter; +import engine.objects.Zone; import org.pmw.tinylog.Logger; -/** - * @author Eighty - */ public class AddMobCmd extends AbstractDevCmd { public AddMobCmd() { @@ -38,27 +35,8 @@ public class AddMobCmd extends AbstractDevCmd { Zone zone = ZoneManager.findSmallestZone(pc.getLoc()); - if (words[0].equals("all")) { - - for (AbstractGameObject mobbaseAGO : DbManager.getList(GameObjectType.MobBase)) { - MobBase mb = (MobBase) mobbaseAGO; - int loadID = mb.getObjectUUID(); - Mob mob = Mob.createMob(loadID, Vector3fImmutable.getRandomPointInCircle(pc.getLoc(), 100), - null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE); - if (mob != null) { - mob.updateDatabase(); - this.setResult(String.valueOf(mob.getDBID())); - } else { - throwbackError(pc, "Failed to create mob of type " + loadID); - Logger.error("Failed to create mob of type " - + loadID); - } - } - return; - } - - int loadID; + try { loadID = Integer.parseInt(words[0]); } catch (NumberFormatException e) { @@ -72,7 +50,6 @@ public class AddMobCmd extends AbstractDevCmd { return; // NaN } - if (zone == null) { throwbackError(pc, "Failed to find zone to place mob in."); return; @@ -83,9 +60,9 @@ public class AddMobCmd extends AbstractDevCmd { return; } - Mob mob = Mob.createMob(loadID, pc.getLoc(), null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE); + if (mob != null) { mob.updateDatabase(); ChatManager.chatSayInfo(pc,