Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/main/java/com/glisco/conjuring/mixin/LivingEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public void applySwordAoe(DamageSource source, float amount, CallbackInfo ci) {
@Inject(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;applyDamage(Lnet/minecraft/entity/damage/DamageSource;F)V"))
public void calculateDamageReduction(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
if (!source.getName().equals("player")) return;
if (source.getAttacker() == null) return;

final PlayerEntity player = (PlayerEntity) source.getAttacker();

if (!SoulAlloyToolAbilities.canArmorPierce(player)) return;

float pierceDamage = SoulAlloyTool.getModifierLevel(player.getMainHandStack(), SoulAlloyTool.SoulAlloyModifier.IGNORANCE) * Conjuring.CONFIG.tools_config.sword_ignorance_multiplier() * amount;
applyDamage(new CopycatPlayerDamageSource(player).pierceArmor(), pierceDamage);
damageReduction = pierceDamage;
if (source.getAttacker() instanceof PlayerEntity player) {
if (!SoulAlloyToolAbilities.canArmorPierce(player)) return;
float pierceDamage = SoulAlloyTool.getModifierLevel(player.getMainHandStack(),
SoulAlloyTool.SoulAlloyModifier.IGNORANCE)
* Conjuring.CONFIG.tools_config.sword_ignorance_multiplier() * amount;
applyDamage(new CopycatPlayerDamageSource(player).pierceArmor(), pierceDamage);
damageReduction = pierceDamage;
}
}

//Reduces the normal damage so that it's even with the original amount again
Expand Down