From 34f06f78791a749205e9ebd588ea1085e51f95b7 Mon Sep 17 00:00:00 2001 From: Alexandra-Myers <78748498+Alexandra-Myers@users.noreply.github.com> Date: Thu, 13 Feb 2025 21:53:01 -0500 Subject: [PATCH] Whoopsies --- .../java/net/atlas/combatify/component/custom/Blocker.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/atlas/combatify/component/custom/Blocker.java b/src/main/java/net/atlas/combatify/component/custom/Blocker.java index 895347cd..163d9fbd 100644 --- a/src/main/java/net/atlas/combatify/component/custom/Blocker.java +++ b/src/main/java/net/atlas/combatify/component/custom/Blocker.java @@ -121,7 +121,8 @@ public void block(ServerLevel serverLevel, LivingEntity instance, DamageSource s public void completeBlock(ServerLevel serverLevel, LivingEntity instance, ItemStack blockingItem, DamageSource source, LocalFloatRef amount, LocalFloatRef protectedDamage, LocalBooleanRef wasBlocked) { int blockingLevel = blockingItem.getOrDefault(CustomDataComponents.BLOCKING_LEVEL, 1); DataSet protection = new DataSet(0, 0); - if (!tooltip.protectionModifiers().isEmpty()) protection = tooltip.protectionModifiers().getFirst().tryCombineVal(tooltip.protectionModifiers(), blockingLevel, instance.getRandom()); + List intermediaryProtection = tooltip.protectionModifiers().stream().filter(combinedModifier -> combinedModifier.matches(blockingItem)).toList(); + if (!intermediaryProtection.isEmpty()) protection = intermediaryProtection.getFirst().tryCombineVal(intermediaryProtection, blockingLevel, instance.getRandom()); final DataSet endProtection = CustomEnchantmentHelper.modifyShieldEffectiveness(blockingItem, instance.getRandom(), protection); damageParsers.forEach(damageParserConditionalEffect -> { protectedDamage.set(damageParserConditionalEffect.parse(amount.get(), endProtection, source.typeHolder()));