Fix mixin conflict with obscure (#831)

They use overwrite, so :(
This commit is contained in:
IzzelAliz 2022-12-08 19:54:07 +08:00
parent 89b7eb47b4
commit 7894e4fa9a
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338
2 changed files with 8 additions and 2 deletions

View File

@ -966,8 +966,13 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt
return CraftEventFactory.handleBlockFormEvent(instance, pPos, pNewState, 3, (Entity) (Object) this);
}
@Redirect(method = "getDamageAfterArmorAbsorb", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;hurtArmor(Lnet/minecraft/world/damagesource/DamageSource;F)V"))
public void arclight$muteDamageArmor(LivingEntity entity, DamageSource damageSource, float damage) {
// https://github.com/IzzelAliz/Arclight/issues/831
@Mixin(value = LivingEntity.class, priority = 1500)
public static class ObscureApiCompat {
@Redirect(method = "getDamageAfterArmorAbsorb", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;hurtArmor(Lnet/minecraft/world/damagesource/DamageSource;F)V"))
private void arclight$muteDamageArmor(LivingEntity entity, DamageSource damageSource, float damage) {
}
}
@Redirect(method = "getDamageAfterMagicAbsorb", require = 0, at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;hasEffect(Lnet/minecraft/world/effect/MobEffect;)Z"))

View File

@ -96,6 +96,7 @@
"world.entity.ItemBaseSteeringMixin",
"world.entity.LightningBoltMixin",
"world.entity.LivingEntityMixin",
"world.entity.LivingEntityMixin$ObscureApiCompat",
"world.entity.MobMixin",
"world.entity.PathfinderMobMixin",
"world.entity.ai.behavior.AssignProfessionFromJobSiteMixin",