Move the remaining legacy item template lookups to CObjectTemplate

Dev commands, BuildingManager, ChatManager, ForgeManager, NPCManager,
NPC, Warehouse, WorkOrder and ManageNPCMsg now call
CObjectTemplate.lookup instead of ItemTemplate.templates.get. Forge
production cost reads getItemResourceCosts(). Only the DB loader and
linkCacheTemplates still use the legacy class (removed in Task 1.8).

Removes the static_item_templates ParityCheck comparator. Final parity
(offline p17.py, 7586 rows): every id has a cache template, 0 item_type
differences, 0 item_resource_costs differences (84 ITEMs have costs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-20 07:56:08 -04:00
1 parent 6b4e9815e0
commit 566870de79
17 files changed
+67 -70

No files matched your search

@@ -12,6 +12,7 @@ package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd;
import engine.mbEnums.ItemType;
import engine.objects.*;
import engine.parsers.objects.CObjectTemplate;
import java.text.DecimalFormat;
import java.util.ArrayList;
@@ -75,18 +76,18 @@ public class PrintInventoryCmd extends AbstractDevCmd {
int goldCount = 0;
for (Item item : inventory) {
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
if (item.template.getItemType().equals(ItemType.GOLD) == false) {
String chargeInfo = "";
int chargeMax = template.cacheTemplate.getItemInitialCharges();
int chargeMax = template.getItemInitialCharges();
if (chargeMax > 0) {
int charges = item.chargesRemaining;
chargeInfo = " charges: " + charges + '/' + chargeMax;
}
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems() + chargeInfo);
throwbackInfo(pc, " " + template.getItemBaseName() + ", count: " + item.getNumOfItems() + chargeInfo);
} else
goldCount += item.getNumOfItems();
}