Skip to content

Commit 368d496

Browse files
committed
Limit how fast you can look
1 parent afe2d21 commit 368d496

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/ca/atlasengine/models/ModelManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,19 @@ public static void updateRotation(double i) {
3939
ClientPlayNetworking.send(animationIdentifier, buf);
4040
}
4141

42+
private static long lastUpdate = 0;
4243
public static void changeLookDirection(float headYaw, float pitch) {
44+
if (System.currentTimeMillis() - lastUpdate < 100) {
45+
return;
46+
}
47+
4348
PacketByteBuf buf = PacketByteBufs.create();
4449
buf.writeByte(2);
4550
buf.writeFloat(headYaw);
4651
buf.writeFloat(pitch);
4752

4853
ClientPlayNetworking.send(animationIdentifier, buf);
54+
lastUpdate = System.currentTimeMillis();
4955
}
5056

5157
public static void setAnimation(UUID uuid, String animation) {

0 commit comments

Comments
 (0)