Skip to content

Commit

Permalink
Fix not showing attributes for "Armor" category
Browse files Browse the repository at this point in the history
  • Loading branch information
YHDiamond committed Jun 11, 2024
1 parent c3cfa62 commit ca37ac2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ private static void addAttributeLore(ItemAttributeModifiers modifiers, BedrockIt
}

ItemAttributeModifiers.EquipmentSlotGroup slotGroup = entry.getSlot();
if (slotGroup == ItemAttributeModifiers.EquipmentSlotGroup.ANY) {
if (slotGroup == ItemAttributeModifiers.EquipmentSlotGroup.ARMOR) {
// modifier applies to all armor slots
slotsToModifiers.computeIfAbsent(ItemAttributeModifiers.EquipmentSlotGroup.HEAD, s -> new ArrayList<>()).add(loreEntry);
slotsToModifiers.computeIfAbsent(ItemAttributeModifiers.EquipmentSlotGroup.CHEST, s -> new ArrayList<>()).add(loreEntry);
slotsToModifiers.computeIfAbsent(ItemAttributeModifiers.EquipmentSlotGroup.LEGS, s -> new ArrayList<>()).add(loreEntry);
slotsToModifiers.computeIfAbsent(ItemAttributeModifiers.EquipmentSlotGroup.FEET, s -> new ArrayList<>()).add(loreEntry);
} else if (slotGroup == ItemAttributeModifiers.EquipmentSlotGroup.ANY) {
// modifier applies to all slots implicitly
for (var slot : SLOT_NAMES.keySet()) {
slotsToModifiers.computeIfAbsent(slot, s -> new ArrayList<>()).add(loreEntry);
Expand Down

0 comments on commit ca37ac2

Please sign in to comment.