Skip to content

Commit 09cd68e

Browse files
committed
fix rotation comparison
1 parent ebad580 commit 09cd68e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private void injectSendMovementPacketsHead(CallbackInfo ci) {
100100
@Expression("g != 0.0")
101101
@ModifyExpressionValue(method = "sendMovementPackets", at = @At("MIXINEXTRAS:EXPRESSION"))
102102
private boolean modifyHasRotated(boolean original) {
103-
return RotationManager.getActiveRotation() != RotationManager.getServerRotation() || original;
103+
return !RotationManager.getActiveRotation().equalFloat(RotationManager.getServerRotation()) || original;
104104
}
105105

106106
@WrapOperation(method = "sendMovementPackets", at = @At(value = "NEW", target = "net/minecraft/network/packet/c2s/play/PlayerMoveC2SPacket$Full"))
@@ -123,7 +123,7 @@ private PlayerMoveC2SPacket.OnGroundOnly wrapOnGroundOnly(boolean onGround, bool
123123
return original.call(moveEvent.getOnGround(), moveEvent.isCollidingHorizontally());
124124
}
125125

126-
@Inject(method = "sendMovementPackets", at = @At("RETURN"))
126+
@Inject(method = "sendMovementPackets", at = @At("TAIL"))
127127
private void injectSendMovementPacketsReturn(CallbackInfo ci) {
128128
RotationManager.onRotationSend();
129129
EventFlow.post(new PlayerPacketEvent.Post());

src/main/kotlin/com/lambda/event/events/PlayerPacketEvent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ sealed class PlayerPacketEvent {
3131
var onGround: Boolean,
3232
var isSprinting: Boolean,
3333
var isCollidingHorizontally: Boolean,
34-
) : ICancellable by Cancellable()
34+
) : Event
3535

3636
data class Send(
3737
val packet: PlayerMoveC2SPacket,

src/main/kotlin/com/lambda/module/modules/combat/AutoDisconnect.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ object AutoDisconnect : Module(
152152
}
153153

154154
private fun SafeContext.disconnect(reasonText: Text, reason: Reason? = null) {
155-
if (connection.brand == "2b2t (Velocity)" && player.gameMode == GameMode.SPECTATOR) return
155+
if (player.gameMode != GameMode.SURVIVAL && player.gameMode != GameMode.ADVENTURE) return
156156
if (reason == Reason.Health || reason == Reason.Totem) disable()
157157
connection.connection.disconnect(generateInfo(reasonText))
158158
playSound(SoundEvents.BLOCK_ANVIL_LAND)

0 commit comments

Comments
 (0)