aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authoringle <inglettronald@gmail.com>2022-09-26 00:51:45 -0500
committeringle <inglettronald@gmail.com>2022-09-26 00:51:45 -0500
commite60fbdd688ff5257c7720c94945e38f1fce5810e (patch)
tree34bd54107a5089b0b4b36183e90a2e16b4c1a7bb /src/main/java
parentb8bcc4ad43589bf76f57e3af75907eb66e81ffb8 (diff)
downloadDulkirMod-e60fbdd688ff5257c7720c94945e38f1fce5810e.tar.gz
DulkirMod-e60fbdd688ff5257c7720c94945e38f1fce5810e.tar.bz2
DulkirMod-e60fbdd688ff5257c7720c94945e38f1fce5810e.zip
More adjustments to drinking animations
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/dulkirmod/mixins/ItemRendererMixin.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/dulkirmod/mixins/ItemRendererMixin.java b/src/main/java/dulkirmod/mixins/ItemRendererMixin.java
index 54b4d45..18fd72a 100644
--- a/src/main/java/dulkirmod/mixins/ItemRendererMixin.java
+++ b/src/main/java/dulkirmod/mixins/ItemRendererMixin.java
@@ -3,7 +3,11 @@ package dulkirmod.mixins;
import dulkirmod.features.ItemAnimations;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.renderer.ItemRenderer;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.item.ItemStack;
+import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -11,6 +15,10 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = {ItemRenderer.class})
public class ItemRendererMixin {
+ @Shadow @Final private RenderItem itemRenderer;
+
+ @Shadow private ItemStack itemToRender;
+
@Inject(method = {"transformFirstPersonItem(FF)V"}, at = @At("HEAD"), cancellable = true)
public void itemTransform(float equipProgress, float swingProgress, CallbackInfo ci) {
if (ItemAnimations.INSTANCE.itemTransforHook(equipProgress, swingProgress)) ci.cancel();
@@ -24,5 +32,6 @@ public class ItemRendererMixin {
@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();
+ if (ItemAnimations.INSTANCE.scaledDrinking(clientPlayer, partialTicks, itemToRender)) ci.cancel();
}
}