Skip to content

Commit adf47d9

Browse files
committed
Merge branch '1.21.5' into 1.21.11
2 parents 836fa32 + 2599039 commit adf47d9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/main/java/com/lambda/mixin/entity/ClientPlayerEntityMixin.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.lambda.module.modules.player.PortalGui;
2828
import com.lambda.module.modules.render.ViewModel;
2929
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
30+
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
3031
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
3132
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
3233
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
@@ -75,15 +76,17 @@ void processMovement(Input input, Operation<Void> original) {
7576
EventFlow.post(new MovementEvent.InputUpdate(input));
7677
}
7778

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) {
8481
PlayerPacketHandler.sendPlayerPackets();
8582
autoJumpEnabled = Lambda.getMc().options.getAutoJump().getValue();
8683
}
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; }
8790

8891
@ModifyExpressionValue(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isSprinting()Z"))
8992
boolean isSprinting(boolean original) {

0 commit comments

Comments
 (0)