From d9549c227a72a5f9b47db80cd8e3768aa6bc59c6 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 15 Mar 2024 11:47:44 -0400 Subject: [PATCH] More itembase refactor work --- src/engine/devcmd/cmds/CreateItemCmd.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/engine/devcmd/cmds/CreateItemCmd.java b/src/engine/devcmd/cmds/CreateItemCmd.java index 813f2b41..31e77836 100644 --- a/src/engine/devcmd/cmds/CreateItemCmd.java +++ b/src/engine/devcmd/cmds/CreateItemCmd.java @@ -11,7 +11,6 @@ package engine.devcmd.cmds; import engine.devcmd.AbstractDevCmd; import engine.objects.AbstractGameObject; -import engine.objects.ItemBase; import engine.objects.ItemFactory; import engine.objects.PlayerCharacter; @@ -27,28 +26,20 @@ public class CreateItemCmd extends AbstractDevCmd { @Override protected void _doCmd(PlayerCharacter pc, String[] words, AbstractGameObject target) { + if (words.length < 2) { this.sendUsage(pc); return; } - int id; - id = ItemBase.getIDByName(words[0]); - if (id == 0) - id = Integer.parseInt(words[0]); - if (id == 7) { - this.throwbackInfo(pc, "use /addgold to add gold....."); - return; - } + int templateID = Integer.parseInt(words[0]); int size = 1; - if (words.length < 3) { + if (words.length == 2) size = Integer.parseInt(words[1]); - } - - ItemFactory.fillInventory(pc, id, size); + ItemFactory.fillInventory(pc, templateID, size); } @Override