Rework Resistance
Now grants increased armour/toughness (WILL NOT protect from magic or repeated assault from Wardens/Creaking)
This commit is contained in:
parent
b6a648fddf
commit
7045c2f902
|
|
@ -0,0 +1,22 @@
|
|||
package xyz.nearmisses.patience.mc_rebalance.mixin;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(LivingEntity.class)
|
||||
public abstract class EraseVanillaResistance {
|
||||
@Shadow
|
||||
public abstract boolean hasEffect(Holder<MobEffect> holder);
|
||||
|
||||
@Redirect(method="getDamageAfterMagicAbsorb", at=@At(value="INVOKE", target="Lnet/minecraft/world/entity/LivingEntity;hasEffect(Lnet/minecraft/core/Holder;)Z"))
|
||||
private boolean iDenyYourResistanceAndSubstituteMyOwn(LivingEntity instance, Holder<MobEffect> holder){
|
||||
if(holder==MobEffects.DAMAGE_RESISTANCE){return false;}
|
||||
return this.hasEffect(holder);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package xyz.nearmisses.patience.mc_rebalance.mixin;
|
||||
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Mixin(MobEffects.class)
|
||||
public class ResistanceEffectRework {
|
||||
@Shadow
|
||||
private static Holder<MobEffect> register(String string, MobEffect mobEffect) {
|
||||
throw new UnsupportedOperationException("Implemented via mixin");
|
||||
}
|
||||
|
||||
@Redirect(method="<clinit>", at=@At(value="INVOKE", target = "Lnet/minecraft/world/effect/MobEffects;register(Ljava/lang/String;Lnet/minecraft/world/effect/MobEffect;)Lnet/minecraft/core/Holder;"))
|
||||
private static Holder<MobEffect> resistanceGrantsArmor(String string, MobEffect mobEffect){
|
||||
if(Objects.equals(string, "resistance")){
|
||||
return register(string, mobEffect
|
||||
.addAttributeModifier(Attributes.ARMOR,
|
||||
ResourceLocation.withDefaultNamespace("effect.resistance"),
|
||||
2.0F,
|
||||
AttributeModifier.Operation.ADD_VALUE)
|
||||
.addAttributeModifier(Attributes.ARMOR_TOUGHNESS,
|
||||
ResourceLocation.withDefaultNamespace("effect.resistance"),
|
||||
2.0F,
|
||||
AttributeModifier.Operation.ADD_VALUE
|
||||
)
|
||||
);
|
||||
}else{
|
||||
return register(string, mobEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,12 +3,14 @@
|
|||
"package": "xyz.nearmisses.patience.mc_rebalance.mixin",
|
||||
"compatibilityLevel": "JAVA_21",
|
||||
"mixins": [
|
||||
"EraseVanillaResistance",
|
||||
"ExperienceOrbRework",
|
||||
"GrowRateTweak",
|
||||
"LingeringCooldownTweak",
|
||||
"PlayerTweaks",
|
||||
"PotionThrowRework",
|
||||
"PotionVisualsRework",
|
||||
"ResistanceEffectRework",
|
||||
"SplashCooldownTweak",
|
||||
"mob.BlazeAIRework",
|
||||
"mob.BlazeRework",
|
||||
|
|
|
|||
Loading…
Reference in a new issue