Skip to content

Commit 80e383c

Browse files
committed
reuse the enchantment map in protectionReduction
1 parent 3128d5d commit 80e383c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/main/java/meteordevelopment/meteorclient/utils/entity/DamageUtils.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ private static float protectionReduction(LivingEntity player, float damage, Dama
306306

307307
int damageProtection = 0;
308308

309+
Object2IntMap<Holder<Enchantment>> enchantments = new Object2IntOpenHashMap<>();
310+
309311
for (EquipmentSlot slot : EquipmentSlotGroup.ARMOR) {
310312
ItemStack stack = player.getItemBySlot(slot);
311313

312-
Object2IntMap<Holder<Enchantment>> enchantments = new Object2IntOpenHashMap<>();
313314
Utils.getEnchantments(stack, enchantments);
314315

315316
int protection = Utils.getEnchantmentLevel(enchantments, Enchantments.PROTECTION);

0 commit comments

Comments
 (0)