From ae27d4a529652607a18f62d4ad1d03166ba8a822 Mon Sep 17 00:00:00 2001 From: LtxPgm Date: Thu, 28 Nov 2024 09:38:23 -0600 Subject: [PATCH] Added ageAsVariant for handsBusy check, when TF anims are disabled. --- .../changed/client/LocalTransfurVariantInstance.java | 2 +- .../ltxprogrammer/changed/mixin/entity/PlayerMixin.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/net/ltxprogrammer/changed/client/LocalTransfurVariantInstance.java b/src/main/java/net/ltxprogrammer/changed/client/LocalTransfurVariantInstance.java index b37c2dd12..4c2d1c743 100644 --- a/src/main/java/net/ltxprogrammer/changed/client/LocalTransfurVariantInstance.java +++ b/src/main/java/net/ltxprogrammer/changed/client/LocalTransfurVariantInstance.java @@ -19,7 +19,7 @@ public LocalTransfurVariantInstance(TransfurVariant parent, LocalPlayer host) protected void tickTransfurProgress() { super.tickTransfurProgress(); - if (transfurProgression < 1f) { + if (transfurProgression < 1f || this.ageAsVariant < 30) { ((LocalPlayerAccessor)host).setHandsBusy(true); } else if (host.getVehicle() == null && host.isHandsBusy()) { ((LocalPlayerAccessor)host).setHandsBusy(false); diff --git a/src/main/java/net/ltxprogrammer/changed/mixin/entity/PlayerMixin.java b/src/main/java/net/ltxprogrammer/changed/mixin/entity/PlayerMixin.java index c44026a33..f79f709a9 100644 --- a/src/main/java/net/ltxprogrammer/changed/mixin/entity/PlayerMixin.java +++ b/src/main/java/net/ltxprogrammer/changed/mixin/entity/PlayerMixin.java @@ -108,14 +108,6 @@ protected void getSwimSound(CallbackInfoReturnable ci) { } } - @Inject(method = "hurt", at = @At("HEAD"), cancellable = true) - public void orNotHurt(DamageSource p_36154_, float p_36155_, CallbackInfoReturnable cir) { - ProcessTransfur.ifPlayerTransfurred(EntityUtil.playerOrNull(this), variant -> { - if (variant.ageAsVariant < 30) - cir.cancel(); - }); - } - @Inject(method = "createAttributes", at = @At("RETURN")) private static void addChangedAttributes(CallbackInfoReturnable cir) { cir.getReturnValue().add(ChangedAttributes.TRANSFUR_DAMAGE.get(), 3.0D);