mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
fix: streamline forge translation preload
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/3b2dd335-d070-4067-b864-5584bb94571b Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
parent
7ce4f82871
commit
21a52b3bcc
2 changed files with 4 additions and 4 deletions
|
|
@ -314,7 +314,7 @@ namespace MinecraftClient
|
|||
client.ReceiveBufferSize = 1024 * 1024;
|
||||
client.ReceiveTimeout = Config.Main.Advanced.TcpTimeout * 1000; // Default: 30 seconds
|
||||
handler = Protocol.ProtocolHandler.GetProtocolHandler(client, protocolversion, forgeInfo, this);
|
||||
if (forgeInfo is not null)
|
||||
if (forgeInfo is not null && forgeInfo.Version == FMLVersion.FML)
|
||||
ChatParser.LoadForgeModTranslations(forgeInfo.Mods.Select(static mod => mod.ModID));
|
||||
Log.Info(Translations.mcc_version_supported);
|
||||
|
||||
|
|
|
|||
|
|
@ -511,8 +511,7 @@ namespace MinecraftClient.Protocol.Message
|
|||
|
||||
foreach (string modDirectory in GetForgeModTranslationDirectories())
|
||||
{
|
||||
foreach (string modJarPath in Directory.EnumerateFiles(modDirectory, "*.jar")
|
||||
.OrderBy(static path => path, StringComparer.OrdinalIgnoreCase))
|
||||
foreach (string modJarPath in Directory.EnumerateFiles(modDirectory, "*.jar"))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -1005,7 +1004,8 @@ namespace MinecraftClient.Protocol.Message
|
|||
private static string ComputeFileSha256(string filePath)
|
||||
{
|
||||
using FileStream stream = File.OpenRead(filePath);
|
||||
return Convert.ToHexString(SHA256.HashData(stream)).ToLowerInvariant();
|
||||
using SHA256 sha256 = SHA256.Create();
|
||||
return Convert.ToHexString(sha256.ComputeHash(stream)).ToLowerInvariant();
|
||||
}
|
||||
|
||||
private static bool TryLoadCachedForgeModTranslations(string cacheFilePath, string sourceHash,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue