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("skin_packs");
searchModules.Add("world_templates"); searchModules.Add("world_templates");
searchModules.Add("persona"); searchModules.Add("persona");
searchModules.Add("behaviour_packs"); searchModules.Add("behavior_packs");
searchModules.Add("resource"); searchModules.Add("resource");
} }
private static void rebaseLocalData() private static void rebaseLocalData()

View File

@ -176,7 +176,7 @@ namespace McDecryptor
break; break;
} }
catch (Exception) { } catch (Exception e) { Console.WriteLine("Error: " + e.Message); }
} }
@ -194,51 +194,62 @@ namespace McDecryptor
counter++; counter++;
} }
new Thread(() =>
Console.WriteLine("Decrypting: " + cListing.Name);
Directory.CreateDirectory(outFolder);
CopyDirectory(cListing.Path, outFolder);
try
{ {
Console.WriteLine("Decrypting: " + cListing.Name); string levelDatFile = Path.Combine(outFolder, "level.dat");
Directory.CreateDirectory(outFolder); string skinsJsonFile = Path.Combine(outFolder, "skins.json");
CopyDirectory(cListing.Path, outFolder); string oldSchoolZipe = Path.Combine(outFolder, "content.zipe");
try
Marketplace.DecryptContents(outFolder);
if (Config.CrackPacks)
{ {
string levelDatFile = Path.Combine(outFolder, "level.dat"); if (File.Exists(oldSchoolZipe))
string skinsJsonFile = Path.Combine(outFolder, "skins.json"); Marketplace.CrackZipe(oldSchoolZipe);
string oldSchoolZipe = Path.Combine(outFolder, "content.zipe");
Marketplace.DecryptContents(outFolder); if (File.Exists(levelDatFile))
Marketplace.CrackLevelDat(levelDatFile);
if (Config.CrackPacks) if (File.Exists(skinsJsonFile))
{ Marketplace.CrackSkinsJson(skinsJsonFile);
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);
}
} }
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); 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 CrackThePacks: yes
# Should i zip packs to .mcpack/.mctemplate # Should i zip packs to .mcpack/.mctemplate
ZipThePacks: no ZipThePacks: yes
# Where to output the decrypted data, (deafult to install into the game) # 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. # You can also add more search locations ontop of the default ones.
# Do this by using AdditionalSearchDir and a path, it will look there # Do this by using AdditionalSearchDir and a path, it will look there
# for packs. # for packs.
# You can use AdditionalModuleDir to add new folders to look for encrypted data inside of the search folders # 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\Folder\With\ResourcePacks
#AdditionalSearchDir: C:\Some\Other\Folder\With\ResourcePacks #AdditionalSearchDir: C:\Some\Other\Folder\With\ResourcePacks