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

+2 -2
View File
@@ -201,7 +201,7 @@ public enum BuildingManager {
ItemTemplate template = ItemTemplate.templates.get(1705032); // Elan Stone
if (!player.charItemManager.hasRoomInventory(template.item_wt))
if (!player.charItemManager.hasRoomInventory(template.cacheTemplate.getItemWt()))
return false;
if (!ItemManager.MakeItemForPlayer(template.template_id, player, amount))
@@ -223,7 +223,7 @@ public enum BuildingManager {
if (resourceTemplate == null)
continue;
if (!player.charItemManager.hasRoomInventory(resourceTemplate.item_wt)) {
if (!player.charItemManager.hasRoomInventory(resourceTemplate.cacheTemplate.getItemWt())) {
ChatManager.chatSystemInfo(player, "You can not carry any more of that item.");
return false;
}
+1 -1
View File
@@ -540,7 +540,7 @@ public enum ChatManager {
else {
String vowels = "aeiou";
ItemTemplate template = ItemTemplate.templates.get(item.templateID);
String iName = template.item_base_name;
String iName = template.cacheTemplate.getItemBaseName();
if (iName.length() > 0)
if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0)
name = "an " + iName + ' ';
+2 -2
View File
@@ -271,13 +271,13 @@ public enum CombatManager {
if (weapon != null && !attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) {
//check if Out of Stamina
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
if (attacker.getStamina() < (weapon.template.item_wt / 3f)) {
if (attacker.getStamina() < (weapon.template.cacheTemplate.getItemWt() / 3f)) {
//set auto attack job
setAutoAttackJob(attacker, slot, delay);
return;
}
}
float stam = weapon.template.item_wt / 3f;
float stam = weapon.template.cacheTemplate.getItemWt() / 3f;
stam = (stam < 1) ? 1 : stam;
attacker.modifyStamina(-(stam), attacker, true);
} else
+1 -1
View File
@@ -226,7 +226,7 @@ public enum ForgeManager implements Runnable {
// Add gold and resource costs from template
production_cost.put(mbEnums.ResourceType.GOLD, template.item_value);
production_cost.put(mbEnums.ResourceType.GOLD, template.cacheTemplate.getItemValue());
production_cost.putAll(template.item_resource_cost);
// Calculate cost of prefix and suffix
+1 -1
View File
@@ -197,7 +197,7 @@ public enum ItemManager {
//players can't wear 0 value items.
return item.template.item_value != 0 || Kit.IsNoobGear(item.templateID);
return item.template.cacheTemplate.getItemValue() != 0 || Kit.IsNoobGear(item.templateID);
}
+3 -3
View File
@@ -91,8 +91,8 @@ public enum LootManager {
//lastly, check mobs inventory for godly or disc runes to send a server announcement
for (Item item : mob.getInventory()) {
if ((item.templateID > 2499 && item.templateID <= 3050) || item.template.item_base_name.toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + item.template.item_base_name + ". Are you tough enough to take it?");
if ((item.templateID > 2499 && item.templateID <= 3050) || item.template.cacheTemplate.getItemBaseName().toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + item.template.cacheTemplate.getItemBaseName() + ". Are you tough enough to take it?");
chatMsg.setMessageType(10);
chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
DispatchManager.dispatchMsgToAll(chatMsg);
@@ -429,7 +429,7 @@ public enum LootManager {
//early exit if the inventory of the player will not old the item
if (itemMan.hasRoomInventory(winnings.template.item_wt) == false) {
if (itemMan.hasRoomInventory(winnings.template.cacheTemplate.getItemWt()) == false) {
ErrorPopupMsg.sendErrorPopup(playerCharacter, 21);
return;
}