mirror of
https://github.com/funkemunky/KauriV3.git
synced 2026-05-31 05:51:55 +00:00
Fixing prediction
This commit is contained in:
@@ -41,11 +41,11 @@ public class Prediction extends Check {
|
||||
String tags = String.join(", ", player.EMULATOR.getTags());
|
||||
Vector predicted = player.getMovement().getPredicted();
|
||||
|
||||
val to = player.getMovement().getTo();
|
||||
val from = player.getMovement().getFrom();
|
||||
|
||||
double px = MathUtils.getDelta(predicted.getX(), to.getX()),
|
||||
py = MathUtils.getDelta(predicted.getY(), to.getY()),
|
||||
pz = MathUtils.getDelta(predicted.getZ(), to.getZ());
|
||||
double px = predicted.getX() - from.getX(),
|
||||
py = predicted.getY() - from.getY(),
|
||||
pz = predicted.getZ() - from.getZ();
|
||||
|
||||
double totalMotion = px * px + py * py + pz * pz;
|
||||
boolean zeroThree = totalMotion < 9E-4;
|
||||
@@ -69,8 +69,9 @@ public class Prediction extends Check {
|
||||
buffer = 4;
|
||||
}
|
||||
} else if(buffer > 0) buffer-= 0.05f;
|
||||
debug((badOffset ? Color.Red : "") + "offset=%s f=%s s=%s py=%.3f [%s] tags=[%s]",
|
||||
offset, forward, strafe, py, totalMotion, tags);
|
||||
debug((badOffset ? Color.Red : "") + "offset=%s f=%s s=%s dy=%.4f dpy=%.4f py=%.2f [%s] tags=[%s]",
|
||||
offset, forward, strafe, player.getMovement().getDeltaY(),
|
||||
py, predicted.getY(), totalMotion, tags);
|
||||
}
|
||||
|
||||
if (ProtocolVersion.getGameVersion().isBelow(ProtocolVersion.V1_9)) {
|
||||
|
||||
@@ -232,6 +232,13 @@ public class MovementHandler {
|
||||
minimum.getMotion().setMotionZ(deltaZ);
|
||||
}
|
||||
player.EMULATOR.confirm(minimum.getIteration());
|
||||
|
||||
double mx = player.EMULATOR.getMotion().getMotionX();
|
||||
double my = player.EMULATOR.getMotion().getMotionY();
|
||||
double mz = player.EMULATOR.getMotion().getMotionZ();
|
||||
|
||||
//TODO Fix false positive caused by 9E-4 flying not being sent when jumping on slime
|
||||
System.out.println("Predicted: " + predicted + " | " + mx + " " + my + " " + mz);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,15 +12,13 @@ import dev.brighten.ac.utils.Materials;
|
||||
import dev.brighten.ac.utils.XMaterial;
|
||||
import dev.brighten.ac.utils.math.IntVector;
|
||||
import dev.brighten.ac.utils.world.types.RayCollision;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectArrayMap;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.libs.it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
|
||||
Reference in New Issue
Block a user