@@ -43,63 +43,63 @@ public class HeldItemRendererMixin {
4343 @ Shadow private ItemStack offHand ;
4444 @ Shadow private float equipProgressMainHand ;
4545 @ Shadow private float equipProgressOffHand ;
46-
47- @ Inject (method = "renderFirstPersonItem" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderArmHoldingItem(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IFFLnet/minecraft/util/Arm;)V" ))
48- private void onRenderArmHoldingItem (AbstractClientPlayerEntity player , float tickDelta , float pitch , Hand hand , float swingProgress , ItemStack itemStack , float equipProgress , MatrixStack matrices , VertexConsumerProvider vertexConsumers , int light , CallbackInfo ci ) {
49- if (!ViewModel .INSTANCE .isEnabled ()) return ;
50-
51- ViewModel .INSTANCE .transform (itemStack , hand , matrices );
52- }
53-
54- @ Inject (method = "renderFirstPersonItem" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemDisplayContext;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V" , ordinal = 1 ))
55- private void onRenderFirstPersonItem (AbstractClientPlayerEntity player , float tickDelta , float pitch , Hand hand , float swingProgress , ItemStack itemStack , float equipProgress , MatrixStack matrices , VertexConsumerProvider vertexConsumers , int light , CallbackInfo ci ) {
56- if (!ViewModel .INSTANCE .isEnabled ()) return ;
57-
58- ViewModel .INSTANCE .transform (itemStack , hand , matrices );
59- }
60-
61- @ ModifyArg (method = "updateHeldItems" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F" , ordinal = 2 ), index = 0 )
62- private float modifyEquipProgressMainHand (float value ) {
63- if (client .player == null || ViewModel .INSTANCE .isDisabled ()) return value ;
64-
65- ViewModel config = ViewModel .INSTANCE ;
66- ItemStack currentStack = client .player .getMainHandStack ();
67- if (config .getOldAnimations () && !config .getSwapAnimation ()) {
68- mainHand = currentStack ;
69- }
70-
71- float progress = config .getOldAnimations () ? 1 : (float ) Math .pow (client .player .getAttackCooldownProgress (1 ), 3 );
72-
73- return (ItemStack .areEqual (mainHand , currentStack ) ? progress : 0 ) - equipProgressMainHand ;
74- }
75-
76- @ ModifyArg (method = "updateHeldItems" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F" , ordinal = 3 ), index = 0 )
77- private float modifyEquipProgressOffHand (float value ) {
78- if (client .player == null || ViewModel .INSTANCE .isDisabled ()) return value ;
79-
80- ViewModel config = ViewModel .INSTANCE ;
81-
82- ItemStack currentStack = client .player .getOffHandStack ();
83- if (config .getOldAnimations () && !config .getSwapAnimation ()) {
84- offHand = currentStack ;
85- }
86-
87- return (ItemStack .areEqual (offHand , currentStack ) ? 1 : 0 ) - equipProgressOffHand ;
88- }
89-
90- @ ModifyVariable (method = "renderItem(FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;Lnet/minecraft/client/network/ClientPlayerEntity;I)V" , at = @ At (value = "STORE" , ordinal = 0 ), index = 6 )
91- private float modifySwing (float swingProgress ) {
92- ViewModel config = ViewModel .INSTANCE ;
93- MinecraftClient mc = Lambda .getMc ();
94- if (config .isDisabled () || mc .player == null ) return swingProgress ;
95- Hand hand = MoreObjects .firstNonNull (mc .player .preferredHand , Hand .MAIN_HAND );
96-
97- if (hand == Hand .MAIN_HAND ) {
98- return swingProgress + config .getMainSwingProgress ();
99- } else if (hand == Hand .OFF_HAND ) {
100- return swingProgress + config .getOffhandSwingProgress ();
101- }
102-
103- return swingProgress ;
104- }
46+ //
47+ // @Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderArmHoldingItem(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IFFLnet/minecraft/util/Arm;)V"))
48+ // private void onRenderArmHoldingItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack itemStack, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
49+ // if (!ViewModel.INSTANCE.isEnabled()) return;
50+ //
51+ // ViewModel.INSTANCE.transform(itemStack, hand, matrices);
52+ // }
53+ //
54+ // @Inject(method = "renderFirstPersonItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/item/HeldItemRenderer;renderItem(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemDisplayContext;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", ordinal = 1))
55+ // private void onRenderFirstPersonItem(AbstractClientPlayerEntity player, float tickDelta, float pitch, Hand hand, float swingProgress, ItemStack itemStack, float equipProgress, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, CallbackInfo ci) {
56+ // if (!ViewModel.INSTANCE.isEnabled()) return;
57+ //
58+ // ViewModel.INSTANCE.transform(itemStack, hand, matrices);
59+ // }
60+ //
61+ // @ModifyArg(method = "updateHeldItems", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 2), index = 0)
62+ // private float modifyEquipProgressMainHand(float value) {
63+ // if (client.player == null || ViewModel.INSTANCE.isDisabled()) return value;
64+ //
65+ // ViewModel config = ViewModel.INSTANCE;
66+ // ItemStack currentStack = client.player.getMainHandStack();
67+ // if (config.getOldAnimations() && !config.getSwapAnimation()) {
68+ // mainHand = currentStack;
69+ // }
70+ //
71+ // float progress = config.getOldAnimations() ? 1 : (float) Math.pow(client.player.getAttackCooldownProgress(1), 3);
72+ //
73+ // return (ItemStack.areEqual(mainHand, currentStack) ? progress : 0) - equipProgressMainHand;
74+ // }
75+ //
76+ // @ModifyArg(method = "updateHeldItems", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F", ordinal = 3), index = 0)
77+ // private float modifyEquipProgressOffHand(float value) {
78+ // if (client.player == null || ViewModel.INSTANCE.isDisabled()) return value;
79+ //
80+ // ViewModel config = ViewModel.INSTANCE;
81+ //
82+ // ItemStack currentStack = client.player.getOffHandStack();
83+ // if (config.getOldAnimations() && !config.getSwapAnimation()) {
84+ // offHand = currentStack;
85+ // }
86+ //
87+ // return (ItemStack.areEqual(offHand, currentStack) ? 1 : 0) - equipProgressOffHand;
88+ // }
89+ //
90+ // @ModifyVariable(method = "renderItem(FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;Lnet/minecraft/client/network/ClientPlayerEntity;I)V", at = @At(value = "STORE", ordinal = 0), index = 6)
91+ // private float modifySwing(float swingProgress) {
92+ // ViewModel config = ViewModel.INSTANCE;
93+ // MinecraftClient mc = Lambda.getMc();
94+ // if (config.isDisabled() || mc.player == null) return swingProgress;
95+ // Hand hand = MoreObjects.firstNonNull(mc.player.preferredHand, Hand.MAIN_HAND);
96+ //
97+ // if (hand == Hand.MAIN_HAND) {
98+ // return swingProgress + config.getMainSwingProgress();
99+ // } else if (hand == Hand.OFF_HAND) {
100+ // return swingProgress + config.getOffhandSwingProgress();
101+ // }
102+ //
103+ // return swingProgress;
104+ // }
105105}
0 commit comments