diff --git a/MinecraftClient/Commands/Move.cs b/MinecraftClient/Commands/Move.cs index 7ccd3ed5..4ccd033a 100644 --- a/MinecraftClient/Commands/Move.cs +++ b/MinecraftClient/Commands/Move.cs @@ -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; + } } } diff --git a/MinecraftClient/Mapping/Movement.cs b/MinecraftClient/Mapping/Movement.cs index ff2e4089..960921b7 100644 --- a/MinecraftClient/Mapping/Movement.cs +++ b/MinecraftClient/Mapping/Movement.cs @@ -31,7 +31,6 @@ namespace MinecraftClient.Mapping belowFoots = location; belowFoots.Y = Math.Truncate(location.Y); } - //Console.WriteLine("IsOnGround = " + IsOnGround(world, location)); if (!IsOnGround(world, location) && !IsSwimming(world, location)) { while (!IsOnGround(world, belowFoots) && diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index e3a9cab0..2f517021 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -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 diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index dc9e4789..474bbfe0 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -332,10 +332,7 @@ namespace MinecraftClient.Protocol.Handlers currentDimensionName = dataTypes.ReadNextString(packetData); // Dimension Name (World Name) - 1.16 and above if (protocolversion >= MC1162Version) - new Task(() => - { handler.GetWorld().SetDimension(currentDimensionName, currentDimensionType); - }).Start(); if (protocolversion >= MC115Version) dataTypes.ReadNextLong(packetData); // Hashed world seed - 1.15 and above diff --git a/MinecraftClient/Resources/lang/en.ini b/MinecraftClient/Resources/lang/en.ini index e1a72f12..c3f5901e 100644 --- a/MinecraftClient/Resources/lang/en.ini +++ b/MinecraftClient/Resources/lang/en.ini @@ -319,6 +319,7 @@ cmd.move.fail=Failed to compute path to {0} cmd.move.suggestforce=Failed to compute a safe path to {0}. Try -f parameter to allow unsafe movements. cmd.move.gravity.enabled=Gravity is enabled. cmd.move.gravity.disabled=Gravity is disabled. +cmd.move.chunk_loading_status=Chunk loading status: {0:P} - {1} out of {2} load completed. cmd.move.chunk_not_loaded=The chunk where the target location resides has not yet been loaded. # Reco