aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authoringle <inglettronald@gmail.com>2022-09-24 21:09:29 -0500
committeringle <inglettronald@gmail.com>2022-09-24 21:09:29 -0500
commit71a57e6635a4fe8e09e2af06cab7f9f8ce2f69f3 (patch)
tree063cde1960f1b10e664dbdb9e8f66952e4d242e2 /src/main/java
parentca61e7812d1153eaefff289815df66be75ba1b80 (diff)
downloadDulkirMod-71a57e6635a4fe8e09e2af06cab7f9f8ce2f69f3.tar.gz
DulkirMod-71a57e6635a4fe8e09e2af06cab7f9f8ce2f69f3.tar.bz2
DulkirMod-71a57e6635a4fe8e09e2af06cab7f9f8ce2f69f3.zip
Added rotationless drink
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/dulkirmod/mixins/ItemRendererMixin.java6
1 files changed, 6 insertions, 0 deletions
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();
+ }
}