Improve small teleport performances (#1079, #1080)

Increase small teleport range and immediately update location instead of queuing
This commit is contained in:
Рома Данилов 2020-06-27 13:45:33 +05:00 committed by GitHub
parent 4cc29a6ee6
commit a579b453b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -793,11 +793,11 @@ namespace MinecraftClient
{
lock (locationLock)
{
if (allowSmallTeleport && location.DistanceSquared(this.location) <= 16)
if (allowSmallTeleport && location.DistanceSquared(this.location) <= 32)
{
// Allow small teleport within a range of 4 blocks. 1-step path to the desired location without checking anything
path = null;
steps = new Queue<Location>(new[] { location });
// Allow small teleport within a range of 8 blocks. 1-step path to the desired location without checking anything
UpdateLocation(location, location); // Update yaw and pitch to look at next step
handler.SendLocationUpdate(location, Movement.IsOnGround(world, location), yaw, pitch);
return true;
}
else