Make chunk loading status to be displayed using "/move" command

This commit is contained in:
BruceChen 2022-07-25 14:20:24 +08:00
parent ff014d2912
commit b0b45a74a0
5 changed files with 23 additions and 27 deletions

View file

@ -59,8 +59,6 @@ namespace MinecraftClient
private float playerYaw;
private float playerPitch;
private double motionY;
private int chunkLoadingStateTicks = 30; // Setting it to zero to disable chunk loading statu log
private double lastChunkLoadedRatio = 0;
private string host;
private int port;
@ -387,26 +385,6 @@ namespace MinecraftClient
taskToRun();
}
}
if (terrainAndMovementsEnabled)
{
if (chunkLoadingStateTicks <= 0)
{
chunkLoadingStateTicks = 50;
if (world.chunkCnt != 0)
{
double chunkLoadedRatio = (world.chunkCnt - world.chunkLoadNotCompleted) / (double)world.chunkCnt;
if (chunkLoadedRatio != lastChunkLoadedRatio)
{
Log.Info(string.Format("Chunk loading: {0:P} {1}/{2}",
chunkLoadedRatio, world.chunkCnt - world.chunkLoadNotCompleted, world.chunkCnt));
lastChunkLoadedRatio = chunkLoadedRatio;
}
}
}
else
chunkLoadingStateTicks--;
}
}
#region Connection Lost and Disconnect from Server