Fix spelling of behavior

This commit is contained in:
Li 2024-02-28 14:01:08 +13:00
parent 9a8acbdd1d
commit a441bfe929
3 changed files with 51 additions and 40 deletions

View File

@ -64,7 +64,7 @@ namespace McDecryptor
searchModules.Add("skin_packs");
searchModules.Add("world_templates");
searchModules.Add("persona");
searchModules.Add("behaviour_packs");
searchModules.Add("behavior_packs");
searchModules.Add("resource");
}
private static void rebaseLocalData()

View File

@ -176,7 +176,7 @@ namespace McDecryptor
break;
}
catch (Exception) { }
catch (Exception e) { Console.WriteLine("Error: " + e.Message); }
}
@ -194,51 +194,62 @@ namespace McDecryptor
counter++;
}
new Thread(() =>
Console.WriteLine("Decrypting: " + cListing.Name);
Directory.CreateDirectory(outFolder);
CopyDirectory(cListing.Path, outFolder);
try
{
Console.WriteLine("Decrypting: " + cListing.Name);
Directory.CreateDirectory(outFolder);
CopyDirectory(cListing.Path, outFolder);
try
string levelDatFile = Path.Combine(outFolder, "level.dat");
string skinsJsonFile = Path.Combine(outFolder, "skins.json");
string oldSchoolZipe = Path.Combine(outFolder, "content.zipe");
Marketplace.DecryptContents(outFolder);
if (Config.CrackPacks)
{
string levelDatFile = Path.Combine(outFolder, "level.dat");
string skinsJsonFile = Path.Combine(outFolder, "skins.json");
string oldSchoolZipe = Path.Combine(outFolder, "content.zipe");
if (File.Exists(oldSchoolZipe))
Marketplace.CrackZipe(oldSchoolZipe);
Marketplace.DecryptContents(outFolder);
if (File.Exists(levelDatFile))
Marketplace.CrackLevelDat(levelDatFile);
if (Config.CrackPacks)
{
if (File.Exists(oldSchoolZipe))
Marketplace.CrackZipe(oldSchoolZipe);
if (File.Exists(levelDatFile))
Marketplace.CrackLevelDat(levelDatFile);
if (File.Exists(skinsJsonFile))
Marketplace.CrackSkinsJson(skinsJsonFile);
}
if (Config.ZipPacks)
{
string ext = "";
if (File.Exists(levelDatFile))
ext += ".mctemplate";
else
ext += ".mcpack";
ZipFile.CreateFromDirectory(outFolder, outFolder + ext, CompressionLevel.NoCompression, false);
Directory.Delete(outFolder, true);
}
if (File.Exists(skinsJsonFile))
Marketplace.CrackSkinsJson(skinsJsonFile);
}
catch (Exception)
if (Config.ZipPacks)
{
Console.Error.WriteLine("Failed to decrypt: " + cListing.Name);
Console.WriteLine("Zipping: " + cListing.Name);
string ext = "";
if (File.Exists(levelDatFile))
ext += ".mctemplate";
else if (false)
ext += ".mcaddon";
else
ext += ".mcpack";
string fname = outFolder + ext;
if (File.Exists(fname))
File.Delete(fname);
ZipFile.CreateFromDirectory(outFolder, fname, CompressionLevel.NoCompression, false);
Directory.Delete(outFolder, true);
}
}
catch (Exception e)
{
Console.Error.WriteLine("Failed to decrypt: " + cListing.Name+ " "+e.Message);
Directory.Delete(outFolder, true);
}
}).Start();
}
Console.WriteLine("Finished.");
Console.ReadKey();
}
}

View File

@ -28,17 +28,17 @@ RealmsPremiumCache: $LOCALCACHE\premiumcache
CrackThePacks: yes
# Should i zip packs to .mcpack/.mctemplate
ZipThePacks: no
ZipThePacks: yes
# Where to output the decrypted data, (deafult to install into the game)
OutputFolder: $LOCALSTATE\games\com.mojang
OutputFolder: $EXECDIR\output_packs
# You can also add more search locations ontop of the default ones.
# Do this by using AdditionalSearchDir and a path, it will look there
# for packs.
# You can use AdditionalModuleDir to add new folders to look for encrypted data inside of the search folders
# normally it'll just look inside say "resource_packs" "skin_packs" "persona" etc
# normally it'll just look inside say "resource_packs" "skin_packs" "persona", "behaviour packs" etc
#AdditionalSearchDir: C:\Some\Folder\With\ResourcePacks
#AdditionalSearchDir: C:\Some\Other\Folder\With\ResourcePacks