From 13e169c4588d0d1bc57fb05d2865ed16204e0a63 Mon Sep 17 00:00:00 2001 From: Aleksey Date: Tue, 29 Jun 2021 21:14:28 +0300 Subject: [PATCH] Possible avoid #214 --- build.gradle | 3 +++ .../ru/betterend/mixin/common/LivingEntityMixin.java | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 4411ad026..ce8b39950 100644 --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,7 @@ def useOptional(String dep) { exclude group: "net.fabricmc.fabric-api" exclude group: "net.fabricmc" if (!dep.contains("me.shedaniel")) { + exclude group: "me.shedaniel.cloth" exclude group: "me.shedaniel" } } @@ -53,6 +54,7 @@ def useOptional(String dep) { exclude group: "net.fabricmc.fabric-api" exclude group: "net.fabricmc" if (!dep.contains("me.shedaniel")) { + exclude group: "me.shedaniel.cloth" exclude group: "me.shedaniel" } } @@ -63,6 +65,7 @@ def useApi(String dep) { exclude group: "net.fabricmc.fabric-api" exclude group: "net.fabricmc" if (!dep.contains("me.shedaniel")) { + exclude group: "me.shedaniel.cloth" exclude group: "me.shedaniel" } } diff --git a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java index b4e430d6d..93c281748 100644 --- a/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java +++ b/src/main/java/ru/betterend/mixin/common/LivingEntityMixin.java @@ -32,6 +32,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; +import ru.betterend.BetterEnd; import ru.betterend.interfaces.FallFlyingItem; import ru.betterend.interfaces.MobEffectApplier; import ru.betterend.item.CrystaliteArmor; @@ -89,8 +90,12 @@ protected void be_applyEffects(CallbackInfo info) { @Inject(method = "canBeAffected", at = @At("HEAD"), cancellable = true) public void be_canBeAffected(MobEffectInstance mobEffectInstance, CallbackInfoReturnable info) { - if (mobEffectInstance.getEffect() == MobEffects.BLINDNESS && getAttributes().getValue(EndAttributes.BLINDNESS_RESISTANCE) > 0.0) { - info.setReturnValue(false); + try { + if (mobEffectInstance.getEffect() == MobEffects.BLINDNESS && getAttributes().getValue(EndAttributes.BLINDNESS_RESISTANCE) > 0.0) { + info.setReturnValue(false); + } + } catch (Exception ex) { + BetterEnd.LOGGER.warning("Blindness resistance attribute haven't registered."); } }