Read item_type through the cache template bridge
Every consumer of the legacy ItemTemplate item_type now reads template.cacheTemplate.getItemType(). Left on the legacy field: the type count in dbItemHandler.LOAD_ITEM_TEMPLATES, which runs before the bridge is linked. The charter checks already read DeedTemplate. Parity (offline, static_item_templates vs the template CObjectIndex.lookup picks, scripts/p14.py, 7586 templates: ITEM 4011, DEED 880, RUNE 2695): 0 differences in item_type. 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:
1 parent
6825f94f1e
commit
b8ac8cce3e
28 files changed
+69
-69
No files matched your search
@@ -112,7 +112,7 @@ public enum ItemManager {
|
||||
|
||||
public static boolean isTwoHanded(Item item) {
|
||||
|
||||
if (!item.template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
if (!item.template.cacheTemplate.getItemType().equals(mbEnums.ItemType.WEAPON))
|
||||
return false;
|
||||
|
||||
return item.template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
|
||||
@@ -120,7 +120,7 @@ public enum ItemManager {
|
||||
|
||||
public static boolean isTwoHanded(ItemTemplate template) {
|
||||
|
||||
if (!template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
if (!template.cacheTemplate.getItemType().equals(mbEnums.ItemType.WEAPON))
|
||||
return false;
|
||||
|
||||
return template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
|
||||
@@ -165,7 +165,7 @@ public enum ItemManager {
|
||||
(slot == mbEnums.EquipSlotType.RHELD && equipped.get(mbEnums.EquipSlotType.LHELD) != null)))
|
||||
return false;
|
||||
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
if (item.template.cacheTemplate.getItemType().equals(mbEnums.ItemType.WEAPON))
|
||||
if (equipped.get(slot) != null && equipped.get(slot).equals(item) == false)
|
||||
return false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user