From f608e5716e1ac27d61c581671feb771b5b9a98e4 Mon Sep 17 00:00:00 2001 From: lowercasebtw Date: Thu, 12 Dec 2024 17:41:31 -0500 Subject: [PATCH] Some small cleanups & fixes --- .../mixces/animatium/mixins/MixinGameRenderer.java | 2 +- .../animatium/mixins/MixinHeldItemRenderer.java | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/java/me/mixces/animatium/mixins/MixinGameRenderer.java b/src/main/java/me/mixces/animatium/mixins/MixinGameRenderer.java index f7eff3f..f67febb 100644 --- a/src/main/java/me/mixces/animatium/mixins/MixinGameRenderer.java +++ b/src/main/java/me/mixces/animatium/mixins/MixinGameRenderer.java @@ -22,7 +22,7 @@ public abstract class MixinGameRenderer { private MinecraftClient client; @Inject(method = "bobView", at = @At("TAIL")) - private void animatium$bobbingTilt(MatrixStack matrices, float tickDelta, CallbackInfo ci) { + private void fixVerticalBobbingTilt(MatrixStack matrices, float tickDelta, CallbackInfo ci) { if (AnimatiumConfig.fixVerticalBobbingTilt && this.client.getCameraEntity() instanceof PlayerEntity playerEntity) { ViewBobbingStorage bobbingAccessor = (ViewBobbingStorage) playerEntity; float j = MathHelper.lerp(tickDelta, bobbingAccessor.animatium$getPreviousBobbingTilt(), bobbingAccessor.animatium$getBobbingTilt()); diff --git a/src/main/java/me/mixces/animatium/mixins/MixinHeldItemRenderer.java b/src/main/java/me/mixces/animatium/mixins/MixinHeldItemRenderer.java index f1fb978..445f54c 100644 --- a/src/main/java/me/mixces/animatium/mixins/MixinHeldItemRenderer.java +++ b/src/main/java/me/mixces/animatium/mixins/MixinHeldItemRenderer.java @@ -8,11 +8,8 @@ import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.client.render.item.HeldItemRenderer; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.component.DataComponentTypes; -import net.minecraft.component.type.ConsumableComponent; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemStack; -import net.minecraft.item.consume.UseAction; import net.minecraft.util.Arm; import net.minecraft.util.Hand; import net.minecraft.util.math.RotationAxis; @@ -24,8 +21,6 @@ import org.spongepowered.asm.mixin.injection.Slice; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.Objects; - @Mixin(HeldItemRenderer.class) public abstract class MixinHeldItemRenderer { @Shadow @@ -51,13 +46,7 @@ private void tiltItemPositions(AbstractClientPlayerEntity player, float tickDelt private void removeBlockingEquipAnimation(Hand hand, CallbackInfo ci) { ClientPlayerEntity player = this.client.player; if (AnimatiumConfig.removeBlockingEquipAnimation && player != null && player.isUsingItem()) { - ItemStack activeStack = player.getActiveItem(); - if (activeStack.contains(DataComponentTypes.CONSUMABLE)) { - ConsumableComponent consumableComponent = Objects.requireNonNull(activeStack.get(DataComponentTypes.CONSUMABLE)); - if (consumableComponent.useAction() == UseAction.BLOCK) { - ci.cancel(); - } - } + ci.cancel(); } }