From fd3be88cee697a5b86f6edffa7d0ef84b5558690 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Sat, 29 Oct 2022 17:47:54 +0800 Subject: [PATCH] Fix Apotheosis mixin conflict (#626 #784) --- .../mixin/core/world/entity/LivingEntityMixin.java | 12 ++++++++---- .../src/main/resources/mixins.arclight.core.json | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/LivingEntityMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/LivingEntityMixin.java index cf2e18fa3..a99588db9 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/LivingEntityMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/LivingEntityMixin.java @@ -219,7 +219,7 @@ public abstract class LivingEntityMixin extends EntityMixin implements LivingEnt protected void dropExperience() { // if (!this.world.isRemote && (this.isPlayer() || this.recentlyHit > 0 && this.canDropLoot() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT))) { if (true) { - int reward = ForgeEventFactory.getExperienceDrop((LivingEntity)(Object) this, this.lastHurtByPlayer, this.expToDrop); + int reward = ForgeEventFactory.getExperienceDrop((LivingEntity) (Object) this, this.lastHurtByPlayer, this.expToDrop); ExperienceOrb.award((ServerLevel) this.level, this.position(), reward); bridge$setExpToDrop(0); } @@ -938,9 +938,13 @@ private boolean checkTotemDeathProtection(DamageSource damageSourceIn) { public 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")) - public boolean arclight$mutePotion(LivingEntity livingEntity, MobEffect potionIn) { - return false; + @Mixin(value = LivingEntity.class, priority = 1500) + public static class ApotheosisCompatMixin { + + @Redirect(method = "getDamageAfterMagicAbsorb", require = 0, at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/world/entity/LivingEntity;hasEffect(Lnet/minecraft/world/effect/MobEffect;)Z")) + public boolean arclight$mutePotion(LivingEntity livingEntity, MobEffect potionIn) { + return false; + } } @Redirect(method = "travel", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;setSharedFlag(IZ)V")) diff --git a/arclight-common/src/main/resources/mixins.arclight.core.json b/arclight-common/src/main/resources/mixins.arclight.core.json index 1c38f96f9..94d175634 100644 --- a/arclight-common/src/main/resources/mixins.arclight.core.json +++ b/arclight-common/src/main/resources/mixins.arclight.core.json @@ -96,6 +96,7 @@ "world.entity.ItemBaseSteeringMixin", "world.entity.LightningBoltMixin", "world.entity.LivingEntityMixin", + "world.entity.LivingEntityMixin$ApotheosisCompatMixin", "world.entity.MobMixin", "world.entity.PathfinderMobMixin", "world.entity.ai.attributes.RangedAttributeMixin",