Read item weight, value and base name through the bridge

Consumers of the legacy ItemTemplate item_wt, item_value and
item_base_name now read getItemWt(), getItemValue() and
getItemBaseName() on template.cacheTemplate.

Parity (offline, scripts/p14.py, 7586 templates): 0 differences in
item_wt, item_value and item_base_name. No value changes expected.

JSON-Refactor-Plan Task 1.4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-19 12:44:35 -04:00
1 parent b8ac8cce3e
commit dc4a9ee08a
29 files changed
+59 -59

No files matched your search

+1 -1
View File
@@ -51,7 +51,7 @@ public class CreateItemCmd extends AbstractDevCmd {
for (int i = 0; i < size; i++) {
if (!playerCharacter.charItemManager.hasRoomInventory(template.item_wt)) {
if (!playerCharacter.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt())) {
ChatManager.chatSystemInfo(playerCharacter, "You are encumbered!.");
break;
}
+2 -2
View File
@@ -509,7 +509,7 @@ public class InfoCmd extends AbstractDevCmd {
Item item = (Item) target;
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
output += StringUtils.addWS("Template: " + template.template_id, 20);
output += "Weight: " + template.item_wt;
output += "Weight: " + template.cacheTemplate.getItemWt();
output += newline;
DecimalFormat df = new DecimalFormat("###,###,###,###,##0");
output += StringUtils.addWS("Qty: "
@@ -517,7 +517,7 @@ public class InfoCmd extends AbstractDevCmd {
output += "Charges: " + (byte) item.chargesRemaining
+ '/' + item.template.item_initial_charges;
output += newline;
output += "Name: " + template.item_base_name;
output += "Name: " + template.cacheTemplate.getItemBaseName();
output += newline;
output += item.getContainerInfo();
+1 -1
View File
@@ -154,7 +154,7 @@ public class MakeItemCmd extends AbstractDevCmd {
for (int i = 0; i < quantity; i++) {
int weight = template.item_wt;
int weight = template.cacheTemplate.getItemWt();
if (!cim.hasRoomInventory(weight)) {
throwbackError(pc, "Not enough room in inventory for any more of this item. " + i + " produced.");
+1 -1
View File
@@ -53,7 +53,7 @@ public class PrintBankCmd extends AbstractDevCmd {
for (Item item : list) {
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems());
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems());
}
Item gold = cim.getGoldBank();
+1 -1
View File
@@ -34,7 +34,7 @@ public class PrintBonusesCmd extends AbstractDevCmd {
type = "Item";
tar = (Item) target;
ItemTemplate template = ItemTemplate.templates.get(((Item) tar).templateID);
name = template.item_base_name;
name = template.cacheTemplate.getItemBaseName();
} else if (target instanceof AbstractCharacter) {
tar = (AbstractCharacter) target;
name = ((AbstractCharacter) tar).getFirstName();
+3 -3
View File
@@ -66,7 +66,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (mbEnums.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) {
Item equip = tarMob.charItemManager.equipped.get(slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.cacheTemplate.getItemBaseName() + ", slot: " + slot);
}
return;
}
@@ -76,7 +76,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (mbEnums.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) {
Item equip = tarMob.charItemManager.equipped.get(slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.cacheTemplate.getItemBaseName() + ", slot: " + slot);
}
return;
}
@@ -87,7 +87,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
for (mbEnums.EquipSlotType slot : list.keySet()) {
Item item = list.get(slot);
throwbackInfo(pc, " " + item.template.item_base_name + ", slot: " + slot);
throwbackInfo(pc, " " + item.template.cacheTemplate.getItemBaseName() + ", slot: " + slot);
}
}
@@ -86,7 +86,7 @@ public class PrintInventoryCmd extends AbstractDevCmd {
int charges = item.chargesRemaining;
chargeInfo = " charges: " + charges + '/' + chargeMax;
}
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems() + chargeInfo);
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems() + chargeInfo);
} else
goldCount += item.getNumOfItems();
}
+1 -1
View File
@@ -51,7 +51,7 @@ public class PrintVaultCmd extends AbstractDevCmd {
throwbackInfo(pc, "Vault for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Item item : list) {
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
throwbackInfo(pc, " " + template.item_base_name + ", count: " + item.getNumOfItems());
throwbackInfo(pc, " " + template.cacheTemplate.getItemBaseName() + ", count: " + item.getNumOfItems());
}
Item gold = cim.getGoldVault();
if (gold != null)
+1 -1
View File
@@ -37,7 +37,7 @@ public class SimulateBootyCmd extends AbstractDevCmd {
ItemTemplate template = ItemTemplate.templates.get(entry.templateID);
if (template != null)
output += "[" + entry.bootyType + "] " + template.item_base_name + " [Chance] " + entry.dropChance + newline;
output += "[" + entry.bootyType + "] " + template.cacheTemplate.getItemBaseName() + " [Chance] " + entry.dropChance + newline;
}
}