Skip to content

Commit

Permalink
Whoopsies
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra-Myers authored Feb 14, 2025
1 parent 2871a23 commit 34f06f7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CombinedModifier> 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()));
Expand Down

0 comments on commit 34f06f7

Please sign in to comment.