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

+5 -4
View File
@@ -18,6 +18,7 @@ import engine.mbEnums.BuildingGroup;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.TargetColor;
import engine.objects.*;
import engine.parsers.objects.CObjectTemplate;
import engine.util.StringUtils;
import java.text.DecimalFormat;
@@ -507,9 +508,9 @@ public class InfoCmd extends AbstractDevCmd {
case Item: //intentional passthrough
case MobLoot:
Item item = (Item) target;
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
output += StringUtils.addWS("Template: " + template.template_id, 20);
output += "Weight: " + template.cacheTemplate.getItemWt();
CObjectTemplate template = CObjectTemplate.lookup(item.templateID);
output += StringUtils.addWS("Template: " + template.getTemplateId(), 20);
output += "Weight: " + template.getItemWt();
output += newline;
DecimalFormat df = new DecimalFormat("###,###,###,###,##0");
output += StringUtils.addWS("Qty: "
@@ -517,7 +518,7 @@ public class InfoCmd extends AbstractDevCmd {
output += "Charges: " + (byte) item.chargesRemaining
+ '/' + item.template.getItemInitialCharges();
output += newline;
output += "Name: " + template.cacheTemplate.getItemBaseName();
output += "Name: " + template.getItemBaseName();
output += newline;
output += item.getContainerInfo();