From 29c68110cf73c0ac62f448703d8915e07ba29969 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Fri, 1 Mar 2024 08:20:34 -0500 Subject: [PATCH] Refactor out itembase --- src/engine/devcmd/cmds/AuditFailedItemsCmd.java | 4 +--- src/engine/devcmd/cmds/SimulateBootyCmd.java | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/engine/devcmd/cmds/AuditFailedItemsCmd.java b/src/engine/devcmd/cmds/AuditFailedItemsCmd.java index 67b0a2e8..c0075a3d 100644 --- a/src/engine/devcmd/cmds/AuditFailedItemsCmd.java +++ b/src/engine/devcmd/cmds/AuditFailedItemsCmd.java @@ -64,12 +64,10 @@ public class AuditFailedItemsCmd extends AbstractDevCmd { else playerName = roller.getName(); - ItemBase ib = ItemBase.getItemBase(failedItem.getItemBaseID()); ItemTemplate template = ItemTemplate.itemTemplates.get(failedItem.getItemBaseID()); - if (ib != null) { + if (template != null) itemName = template.item_base_name; - } if (failedItem.isRandom() == false) { if (failedItem.getPrefix().isEmpty() == false) { diff --git a/src/engine/devcmd/cmds/SimulateBootyCmd.java b/src/engine/devcmd/cmds/SimulateBootyCmd.java index bf796b88..656f3a8f 100644 --- a/src/engine/devcmd/cmds/SimulateBootyCmd.java +++ b/src/engine/devcmd/cmds/SimulateBootyCmd.java @@ -33,11 +33,11 @@ public class SimulateBootyCmd extends AbstractDevCmd { if (mob.bootySet != 0) { for (BootySetEntry entry : LootManager._bootySetMap.get(mob.bootySet)) { - ItemBase item = ItemBase.getItemBase(entry.itemBase); - if (item != null) { - ItemTemplate template = ItemTemplate.itemTemplates.get(entry.itemBase); + + ItemTemplate template = ItemTemplate.itemTemplates.get(entry.itemBase); + + if (template != null) output += "[" + entry.bootyType + "] " + template.item_base_name + " [Chance] " + entry.dropChance + newline; - } } }