mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
chore: finalize resource pack cache toggle
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/70cfa855-cff8-495e-ac06-9a65bb5cc913 Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
This commit is contained in:
parent
b87b5abbe2
commit
b543825200
2 changed files with 12 additions and 2 deletions
|
|
@ -707,7 +707,13 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
var hash = dataTypes.ReadNextString(packetData);
|
||||
// Use the server-provided UUID when available, then fall back to the legacy SHA-1 hash,
|
||||
// and finally the URL so pre-UUID resource packs can still be replaced or cleared locally.
|
||||
string packIdentifier = uuid != Guid.Empty ? uuid.ToString("D") : (hash.Length == 40 ? hash : url);
|
||||
string packIdentifier;
|
||||
if (uuid != Guid.Empty)
|
||||
packIdentifier = uuid.ToString("D");
|
||||
else if (hash.Length == 40)
|
||||
packIdentifier = hash;
|
||||
else
|
||||
packIdentifier = url;
|
||||
|
||||
if (protocolVersion >= MC_1_17_Version)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -699,7 +699,11 @@ namespace MinecraftClient.Protocol.Message
|
|||
if (translations.Count == 0)
|
||||
return;
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath)!);
|
||||
string? cacheDirectory = Path.GetDirectoryName(cacheFilePath);
|
||||
if (string.IsNullOrEmpty(cacheDirectory))
|
||||
return;
|
||||
|
||||
Directory.CreateDirectory(cacheDirectory);
|
||||
|
||||
ResourcePackTranslationCacheEntry cacheEntry = new()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue