mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Make chunk loading status to be displayed using "/move" command
This commit is contained in:
parent
ff014d2912
commit
b0b45a74a0
5 changed files with 23 additions and 27 deletions
|
|
@ -17,7 +17,14 @@ namespace MinecraftClient.Commands
|
|||
bool takeRisk = false;
|
||||
|
||||
if (args.Count < 1)
|
||||
return GetCmdDescTranslated();
|
||||
{
|
||||
string desc = GetCmdDescTranslated();
|
||||
|
||||
if (handler.GetTerrainEnabled())
|
||||
handler.Log.Info(getChunkLoadingStatus(handler.GetWorld()));
|
||||
|
||||
return desc;
|
||||
}
|
||||
|
||||
if (args.Contains("-f"))
|
||||
{
|
||||
|
|
@ -88,5 +95,19 @@ namespace MinecraftClient.Commands
|
|||
}
|
||||
else return Translations.Get("extra.terrainandmovement_required");
|
||||
}
|
||||
|
||||
private string getChunkLoadingStatus(World world)
|
||||
{
|
||||
double chunkLoadedRatio;
|
||||
if (world.chunkCnt == 0)
|
||||
chunkLoadedRatio = 0;
|
||||
else
|
||||
chunkLoadedRatio = (world.chunkCnt - world.chunkLoadNotCompleted) / (double)world.chunkCnt;
|
||||
|
||||
string status = Translations.Get("cmd.move.chunk_loading_status",
|
||||
chunkLoadedRatio, world.chunkCnt - world.chunkLoadNotCompleted, world.chunkCnt);
|
||||
|
||||
return status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue