From 8f39b03cd3ff309e82660dd1c997e44ba6c5513c Mon Sep 17 00:00:00 2001 From: olim Date: Fri, 28 Jun 2024 10:33:53 +0100 Subject: clean ping code --- .../hysky/skyblocker/skyblock/crimson/dojo/ControlTestHelper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/crimson/dojo/ControlTestHelper.java b/src/main/java/de/hysky/skyblocker/skyblock/crimson/dojo/ControlTestHelper.java index 740949c8..2f616a1e 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/crimson/dojo/ControlTestHelper.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/crimson/dojo/ControlTestHelper.java @@ -46,11 +46,11 @@ public class ControlTestHelper { //smoothly adjust the ping throughout the test if (lastPos != null) { lastPingOffset = pingOffset; - double ping = (double) DojoManager.ping / 1000; + double ping = DojoManager.ping / 1000d; //find distance between last position and current position of skeleton Vec3d movementVector = correctWitherSkeleton.getPos().subtract(lastPos).multiply(1, 0.1, 1); - //adjust the vector to current ping - pingOffset = movementVector.multiply((double) 23 / 20 + ping); + //adjust the vector to current ping (multiply by 1 + time in second until the next update offset by the players ping) + pingOffset = movementVector.multiply(1 + 3 / 20d + ping); } lastPos = correctWitherSkeleton.getPos(); lastUpdate = System.currentTimeMillis(); -- cgit