Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisTestUser committed Feb 6, 2023
1 parent 5b4ba93 commit 2d14036
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main/java/net/wurstclient/mixin/ClientPlayerEntityMixin.java
Expand Up @@ -13,6 +13,7 @@
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.At.Shift;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
Expand Down Expand Up @@ -93,14 +94,21 @@ private boolean wurstIsUsingItem(ClientPlayerEntity player)
return player.isUsingItem();
}

@Inject(at = {@At("HEAD")}, method = {"sendMovementPackets()V"})
private void onSendMovementPacketsHEAD(CallbackInfo ci)
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;tick()V",
ordinal = 0,
shift = Shift.AFTER), method = "tick()V")
private void onSendMovementPacketsBefore(CallbackInfo ci)
{
EventManager.fire(PreMotionEvent.INSTANCE);
}

@Inject(at = {@At("TAIL")}, method = {"sendMovementPackets()V"})
private void onSendMovementPacketsTAIL(CallbackInfo ci)
@Inject(at = @At(value = "INVOKE",
target = "Lnet/minecraft/client/network/ClientPlayerEntity;sendMovementPackets()V",
ordinal = 0,
shift = Shift.BY,
by = 2), method = "tick()V")
private void onSendMovementPacketsAfter(CallbackInfo ci)
{
EventManager.fire(PostMotionEvent.INSTANCE);
}
Expand Down

0 comments on commit 2d14036

Please sign in to comment.