Skip to content

Commit c843d4c

Browse files
committed
fix: (scaffold) suppress the duplicate look after a Telly on-tick raw send
In OnTick/OnTickSnap, the raw C06 (dispatched before the C08 place so the server raytraces the right rotation) and the same-tick movement packet both carried the identical rotation -> GrimAC AimDuplicateLook (from==to). Expose a lastReported accessor on EntityPlayerSP (new IMixinEntityPlayerSP) and, right after each raw send, sync the client's last-reported look to it; the follow-up movement packet then computes zero rotation delta and emits a position-only update (C04) instead of re-sending an identical look. Preserves the place-before-move ordering.
1 parent 62500bc commit c843d4c

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

src/main/java/net/ccbluex/liquidbounce/features/module/modules/player/scaffolds/Scaffold.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import net.ccbluex.liquidbounce.utils.rotation.PlaceRotation
2727
import net.ccbluex.liquidbounce.utils.rotation.Rotation
2828
import net.ccbluex.liquidbounce.utils.rotation.RotationPriority
2929
import net.ccbluex.liquidbounce.utils.rotation.RotationSettingsWithRotationModes
30+
import net.ccbluex.liquidbounce.injection.implementations.IMixinEntityPlayerSP
3031
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils
3132
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.canUpdateRotation
3233
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils.getFixedAngleDelta
@@ -971,6 +972,10 @@ object Scaffold : Module("Scaffold", Category.PLAYER, Category.SubCategory.PLAYE
971972
false
972973
)
973974
RotationUtils.serverRotation = Rotation(continuousYaw, rotation.pitch)
975+
// The raw send already delivered this rotation; sync the client's last-reported look so the
976+
// same-tick movement packet emits a position-only update instead of re-sending an identical
977+
// look (GrimAC AimDuplicateLook = from==to).
978+
(player as? IMixinEntityPlayerSP)?.syncLastReportedRotation(rotation.yaw, rotation.pitch)
974979
}
975980

976981
if (rotationTiming == "OnTickSnap") {
@@ -1004,6 +1009,7 @@ object Scaffold : Module("Scaffold", Category.PLAYER, Category.SubCategory.PLAYE
10041009
false
10051010
)
10061011
RotationUtils.serverRotation = Rotation(continuousYaw, rotation.pitch)
1012+
(player as? IMixinEntityPlayerSP)?.syncLastReportedRotation(rotation.yaw, rotation.pitch)
10071013
}
10081014

10091015
// Search for new target block

src/main/java/net/ccbluex/liquidbounce/injection/forge/mixins/entity/MixinEntityPlayerSP.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import net.ccbluex.liquidbounce.utils.movement.MovementUtils;
1818
import net.ccbluex.liquidbounce.utils.rotation.Rotation;
1919
import net.ccbluex.liquidbounce.utils.rotation.RotationSettings;
20+
import net.ccbluex.liquidbounce.injection.implementations.IMixinEntityPlayerSP;
2021
import net.ccbluex.liquidbounce.utils.rotation.RotationUtils;
2122
import net.ccbluex.liquidbounce.utils.extensions.MathExtensionsKt;
2223
import net.ccbluex.liquidbounce.utils.extensions.PlayerExtensionKt;
@@ -60,7 +61,7 @@
6061

6162
@Mixin(EntityPlayerSP.class)
6263
@SideOnly(Side.CLIENT)
63-
public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer {
64+
public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer implements IMixinEntityPlayerSP {
6465

6566
@Shadow
6667
public boolean serverSprintState;
@@ -122,6 +123,12 @@ public abstract class MixinEntityPlayerSP extends MixinAbstractClientPlayer {
122123
@Shadow
123124
protected abstract boolean isCurrentViewEntity();
124125

126+
@Override
127+
public void syncLastReportedRotation(float yaw, float pitch) {
128+
this.lastReportedYaw = yaw;
129+
this.lastReportedPitch = pitch;
130+
}
131+
125132
/**
126133
* @author CCBlueX
127134
* @reason Dispatch FDP movement events and module hooks while preserving the vanilla update flow
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* FDPClient Hacked Client
3+
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
4+
* https://github.com/SkidderMC/FDPClient/
5+
*/
6+
package net.ccbluex.liquidbounce.injection.implementations
7+
8+
interface IMixinEntityPlayerSP {
9+
/**
10+
* Overwrites the client's record of the last yaw/pitch it reported to the server. Used when a
11+
* rotation is dispatched outside the normal movement-packet path (e.g. a scaffold on-tick send)
12+
* so the follow-up movement packet does not re-send an identical look (GrimAC AimDuplicateLook).
13+
*/
14+
fun syncLastReportedRotation(yaw: Float, pitch: Float)
15+
}

0 commit comments

Comments
 (0)