Skip to content

Commit

Permalink
Should Fix Special Armor mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
ALongStringOfNumbers committed Feb 25, 2024
1 parent bb57d61 commit 0d53384
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraftforge.common.ISpecialArmor;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.sugar.Local;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

Expand All @@ -18,13 +17,12 @@
public class SpecialArmorPropertiesMixin {

@ModifyExpressionValue(method = "applyArmor",
at = @At(value = "INVOKE_ASSIGN",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/util/CombatRules;getDamageAfterAbsorb(FFF)F"),
remap = false)
private static double adjustArmorAbsorption(double originalDamage, float damage, float totalArmor,
float totalToughness, @Local EntityLivingBase entity,
@Local NonNullList<ItemStack> inventory,
@Local DamageSource damageSource) {
private static float adjustArmorAbsorption(float originalDamage, EntityLivingBase entity,
NonNullList<ItemStack> inventory,
DamageSource damageSource, double damage) {
double armorDamage = Math.max(1.0F, damage / 4.0F);
for (int i = 0; i < inventory.size(); i++) {
ItemStack itemStack = inventory.get(i);
Expand Down

0 comments on commit 0d53384

Please sign in to comment.