From 71a57e6635a4fe8e09e2af06cab7f9f8ce2f69f3 Mon Sep 17 00:00:00 2001 From: ingle Date: Sat, 24 Sep 2022 21:09:29 -0500 Subject: Added rotationless drink --- src/main/java/dulkirmod/mixins/ItemRendererMixin.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/dulkirmod/mixins/ItemRendererMixin.java b/src/main/java/dulkirmod/mixins/ItemRendererMixin.java index 9db5c9d..54b4d45 100644 --- a/src/main/java/dulkirmod/mixins/ItemRendererMixin.java +++ b/src/main/java/dulkirmod/mixins/ItemRendererMixin.java @@ -1,6 +1,7 @@ package dulkirmod.mixins; import dulkirmod.features.ItemAnimations; +import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.renderer.ItemRenderer; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -19,4 +20,9 @@ public class ItemRendererMixin { public void useTransform(float swingProgress, CallbackInfo ci){ if (ItemAnimations.INSTANCE.scaledSwing(swingProgress)) ci.cancel(); } + + @Inject(method ={"performDrinking"}, at = @At("HEAD"), cancellable = true) + public void drinkTransform(AbstractClientPlayer clientPlayer, float partialTicks, CallbackInfo ci) { + if (ItemAnimations.INSTANCE.rotationlessDrink(clientPlayer, partialTicks)) ci.cancel(); + } } -- cgit