|
27 | 27 | import com.lambda.module.modules.player.PortalGui; |
28 | 28 | import com.lambda.module.modules.render.ViewModel; |
29 | 29 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; |
| 30 | +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; |
30 | 31 | import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; |
31 | 32 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
32 | 33 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
@@ -75,15 +76,17 @@ void processMovement(Input input, Operation<Void> original) { |
75 | 76 | EventFlow.post(new MovementEvent.InputUpdate(input)); |
76 | 77 | } |
77 | 78 |
|
78 | | - /** |
79 | | - * Overwrites the movement packet update function to use our code |
80 | | - */ |
81 | | - @Inject(method = "sendMovementPackets", at = @At(value = "HEAD"), cancellable = true) |
82 | | - void sendLambdaMovement(CallbackInfo ci) { |
83 | | - ci.cancel(); |
| 79 | + @Inject(method = "sendMovementPackets", at = @At("HEAD")) |
| 80 | + private void injectSendMovementPackets(CallbackInfo ci) { |
84 | 81 | PlayerPacketHandler.sendPlayerPackets(); |
85 | 82 | autoJumpEnabled = Lambda.getMc().options.getAutoJump().getValue(); |
86 | 83 | } |
| 84 | + |
| 85 | + @WrapWithCondition(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendSprintingPacket()V")) |
| 86 | + private boolean wrapSendSprintingPackets(ClientPlayerEntity instance) { return false; } |
| 87 | + |
| 88 | + @ModifyExpressionValue(method = "sendMovementPackets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isCamera()Z")) |
| 89 | + private boolean wrapIsCamera(boolean original) { return false; } |
87 | 90 |
|
88 | 91 | @ModifyExpressionValue(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSprinting()Z")) |
89 | 92 | boolean isSprinting(boolean original) { |
|
0 commit comments