From 324fb6b8bb5239f16f24899393d1b437feeea61d Mon Sep 17 00:00:00 2001 From: Felix Miller Date: Tue, 31 Aug 2021 12:22:27 -0400 Subject: [PATCH] 5.8 update Fix extraction issue --- MinecraftUSkinEditor/Forms/Form1.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MinecraftUSkinEditor/Forms/Form1.cs b/MinecraftUSkinEditor/Forms/Form1.cs index 51b5c1a8..4adf7861 100644 --- a/MinecraftUSkinEditor/Forms/Form1.cs +++ b/MinecraftUSkinEditor/Forms/Form1.cs @@ -23,7 +23,7 @@ namespace PckStudio #region Variables string saveLocation;//Save location for pck file int fileCount = 0;//variable for number of minefiles - string Version = "5.7";//template for program version + string Version = "5.8";//template for program version string hosturl = ""; string basurl = ""; string PCKFile = ""; @@ -1429,6 +1429,16 @@ namespace PckStudio { foreach (PCK.MineFile mf in new PCK(ofd.FileName).mineFiles) { + foreach (object[] entry in mf.entries) + { + if (entry[0].ToString() == "LOCK") // Check for lock on PCK File + { + if ((new pckLocked(entry[1].ToString(), correct).ShowDialog() != DialogResult.OK || !correct)) + { + return; // cancel extraction if password not provided + } + } + } System.IO.FileInfo file = new System.IO.FileInfo(sfd.SelectedPath + @"\" + mf.name); file.Directory.Create(); // If the directory already exists, this method does nothing. File.WriteAllBytes(sfd.SelectedPath + @"\" + mf.name, mf.data); //writes minefile to file