From 1769caa7178e2bea7501fdc2292519615a65720c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 3 Dec 2025 18:14:49 +0100 Subject: [PATCH 1/7] PckStudio.ModelSupport(SkinModelImporter) - Fix null reference exception in `TryConvertToSkinBoxType` & add another box uv check for all elements(cubes) --- PckStuido.ModelSupport/SkinModelImporter.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PckStuido.ModelSupport/SkinModelImporter.cs b/PckStuido.ModelSupport/SkinModelImporter.cs index 2cc7c2a8..77ee8199 100644 --- a/PckStuido.ModelSupport/SkinModelImporter.cs +++ b/PckStuido.ModelSupport/SkinModelImporter.cs @@ -70,6 +70,13 @@ namespace PckStudio.ModelSupport if (!blockBenchModel.Format.UseBoxUv) { Trace.TraceError($"[{nameof(SkinModelImporter)}:{nameof(ImportBlockBenchModel)}] Failed to import skin '{blockBenchModel.Name}': Skin does not use box uv."); + MessageBox.Show("Skin does not use box uv.", $"Failed to import skin '{blockBenchModel.Name}'", MessageBoxButtons.OK, MessageBoxIcon.Error); + return null; + } + if (!blockBenchModel.Elements.All(e => e.UseBoxUv)) + { + Trace.TraceError($"[{nameof(SkinModelImporter)}:{nameof(ImportBlockBenchModel)}] Failed to import skin '{blockBenchModel.Name}': Some boxes do not use box uv."); + MessageBox.Show("Some boxes do not use box uv.", $"Failed to import skin '{blockBenchModel.Name}'", MessageBoxButtons.OK, MessageBoxIcon.Error); return null; } @@ -443,6 +450,8 @@ namespace PckStudio.ModelSupport private static string TryConvertToSkinBoxType(string name) { + if (name is null) + return string.Empty; if (!SkinBOX.IsValidType(name) && SkinBOX.IsValidType(name.ToUpper())) { return name.ToUpper(); From 539842fd6ca4d6e22813770f745a18fabf68b98b Mon Sep 17 00:00:00 2001 From: MayNL Date: Sun, 4 Jan 2026 09:52:44 -0500 Subject: [PATCH 2/7] Update and rename README.md to Fixed MayNL link in README --- README.md => Fixed MayNL link in README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename README.md => Fixed MayNL link in README (98%) diff --git a/README.md b/Fixed MayNL link in README similarity index 98% rename from README.md rename to Fixed MayNL link in README index 256c49e1..56590db9 100644 --- a/README.md +++ b/Fixed MayNL link in README @@ -48,7 +48,7 @@ $ cd PCK-Studio ## Active Developers: > [PhoenixARC](https://github.com/PhoenixARC)
-> [MattNL](https://github.com/MattN-L)
+> [MayNL](https://github.com/MayN-L)
> [Miku-666](https://github.com/NessieHax)
> [EternalModz](https://github.com/EternalModz)
From a6c8d330c8b143a6dc5273f0afe0b6a7897230b9 Mon Sep 17 00:00:00 2001 From: MayNL Date: Sun, 4 Jan 2026 09:58:53 -0500 Subject: [PATCH 3/7] HOW DID I MANAGE THAT. Fixed README. >< --- Fixed MayNL link in README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Fixed MayNL link in README => README.md (100%) diff --git a/Fixed MayNL link in README b/README.md similarity index 100% rename from Fixed MayNL link in README rename to README.md From 6e3b88aa18b1091c75e033236e4f7369f471c5cc Mon Sep 17 00:00:00 2001 From: MattNL Date: Sun, 25 Jan 2026 14:07:00 -0500 Subject: [PATCH 4/7] Removed restriction on file extension LCE technically allows for any file to be opened regardless of file extension as long as it is a valid PCK file. Removing this allows advanced users to be creative with pack stylization --- PCK-Studio/MainForm.cs | 4 ++-- PCK-Studio/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 760c5c96..4508f1c4 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -86,7 +86,7 @@ namespace PckStudio private bool TryOpenPck(string filepath, out PackInfo packInfo) { - if (!File.Exists(filepath) || !filepath.EndsWith(".pck")) + if (!File.Exists(filepath)) { packInfo = PackInfo.Empty; return false; @@ -127,7 +127,7 @@ namespace PckStudio private void AddEditorPage(string filepath) { - if (!File.Exists(filepath) && !filepath.EndsWith(".pck")) + if (!File.Exists(filepath)) { Trace.TraceError($"[{nameof(AddEditorPage)}] Invalid filepath({filepath})"); return; diff --git a/PCK-Studio/Program.cs b/PCK-Studio/Program.cs index 5d11a7d5..3aa66369 100644 --- a/PCK-Studio/Program.cs +++ b/PCK-Studio/Program.cs @@ -38,7 +38,7 @@ namespace PckStudio Updater.SetOwner(MainInstance); if (args.Length > 0) { - MainInstance.LoadPckFromFile(args.Where(arg => File.Exists(arg) && arg.EndsWith(".pck"))); + MainInstance.LoadPckFromFile(args.Where(arg => File.Exists(arg))); } Application.ApplicationExit += (sender, e) => { RPC.Deinitialize(); }; MainInstance.FocusMe(); From cb70382a8be844543655245ae17da99e10391027 Mon Sep 17 00:00:00 2001 From: MattNL Date: Sun, 25 Jan 2026 14:20:40 -0500 Subject: [PATCH 5/7] Updated additional development contributors label --- PCK-Studio/Forms/ContributorsForm.Designer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Forms/ContributorsForm.Designer.cs b/PCK-Studio/Forms/ContributorsForm.Designer.cs index 1fdb6b58..749c7db5 100644 --- a/PCK-Studio/Forms/ContributorsForm.Designer.cs +++ b/PCK-Studio/Forms/ContributorsForm.Designer.cs @@ -70,9 +70,9 @@ metroLabel5.Enabled = false; metroLabel5.Location = new System.Drawing.Point(397, 456); metroLabel5.Name = "metroLabel5"; - metroLabel5.Size = new System.Drawing.Size(300, 19); + metroLabel5.Size = new System.Drawing.Size(298, 19); metroLabel5.TabIndex = 5; - metroLabel5.Text = "Additional development by MattNL and Miku-666"; + metroLabel5.Text = "Additional development by Miku-666 and MayNL"; metroLabel5.Theme = MetroFramework.MetroThemeStyle.Dark; // // metroLabel6 From 37cec08d7c5ff59ed9c7293cf4aa78a619721cb5 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 26 Jan 2026 03:01:38 +0100 Subject: [PATCH 6/7] Fix Pck save & save as functionality :') --- PCK-Studio/Controls/EditorControl.cs | 23 +++++++++-- PCK-Studio/Controls/PckEditor.cs | 39 +++++-------------- PCK-Studio/MainForm.cs | 32 ++++++++++----- PCK-Studio/MainForm.resx | 25 ++++++------ PckStudio.Core/DelegatedFileSaveContext.cs | 13 +------ PckStudio.Core/Interfaces/IEditor.cs | 10 +++-- .../PckStudio.Rendering.csproj | 2 +- Vendor/OMI-Lib | 2 +- 8 files changed, 74 insertions(+), 72 deletions(-) diff --git a/PCK-Studio/Controls/EditorControl.cs b/PCK-Studio/Controls/EditorControl.cs index 6a7259fa..fffacd64 100644 --- a/PCK-Studio/Controls/EditorControl.cs +++ b/PCK-Studio/Controls/EditorControl.cs @@ -8,6 +8,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PckStudio.Interfaces; +using System.IO; namespace PckStudio.Controls { @@ -15,15 +16,18 @@ namespace PckStudio.Controls { public T EditorValue { get; } - public ISaveContext SaveContext { get; } + public ISaveContext SaveContext { get; private set; } + + public string TitleName { get; } public EditorControl() { } - protected EditorControl(T value, ISaveContext saveContext) + protected EditorControl(string titleName, T value, ISaveContext saveContext) { _ = value ?? throw new ArgumentNullException(nameof(value)); + TitleName = titleName; EditorValue = value; SaveContext = saveContext; } @@ -35,9 +39,20 @@ namespace PckStudio.Controls base.OnControlRemoved(e); } - public void Save() => SaveContext.Save(EditorValue); + public void SetSaveContext(ISaveContext saveContext) => SaveContext = saveContext; - public virtual void SaveAs() => throw new NotImplementedException(); + protected virtual void PreSave() + { } + + protected virtual void PostSave() + { } + + public void Save() + { + PreSave(); + SaveContext.Save(EditorValue); + PostSave(); + } public virtual void Close() => throw new NotImplementedException(); diff --git a/PCK-Studio/Controls/PckEditor.cs b/PCK-Studio/Controls/PckEditor.cs index dc461bac..d6f1fac6 100644 --- a/PCK-Studio/Controls/PckEditor.cs +++ b/PCK-Studio/Controls/PckEditor.cs @@ -52,9 +52,6 @@ namespace PckStudio.Controls { internal partial class PckEditor : EditorControl { - - private string _location = string.Empty; - private readonly OMI.ByteOrder _originalEndianness; private OMI.ByteOrder _currentEndianness; private bool __modified = false; @@ -78,8 +75,8 @@ namespace PckStudio.Controls private readonly Dictionary> _pckAssetTypeHandler; - public PckEditor(PackInfo packInfo, ISaveContext saveContext) - : base(packInfo, saveContext) + public PckEditor(string name, PackInfo packInfo, ISaveContext saveContext) + : base(name, packInfo, saveContext) { InitializeComponent(); _onModifiedChangeDelegate = OnModify; @@ -140,26 +137,13 @@ namespace PckStudio.Controls [PckAssetType.MaterialFile] = HandleMaterialFile, }; } - - public new void Save() + + protected override void PostSave() { - base.Save(); _timesSaved++; _wasModified = false; - } - - public override void SaveAs() - { - using SaveFileDialog saveFileDialog = new SaveFileDialog - { - Filter = "PCK (Minecraft Console Package)|*.pck", - DefaultExt = ".pck", - }; - if (saveFileDialog.ShowDialog() == DialogResult.OK) - { - SaveTo(saveFileDialog.FileName); - pckFileLabel.Text = "Current PCK File: " + Path.GetFileName(_location); - } + MessageBox.Show("Pck Saved.", "Saved"); + Debug.WriteLine($"_timesSaved: {_timesSaved}"); } public override void Close() @@ -178,12 +162,6 @@ namespace PckStudio.Controls BuildMainTreeView(); } - private void SaveTo(string filepath) - { - _location = filepath; - Save(); - } - private void HandleInnerPckFile(PckAsset asset) { if (asset.Type != PckAssetType.SkinDataFile && asset.Type != PckAssetType.TexturePackInfoFile || asset.Size <= 0 || !Settings.Default.LoadSubPcks) @@ -199,7 +177,7 @@ namespace PckStudio.Controls }); string caption = Path.GetFileName(asset.Filename); - string identifier = _location + Path.GetFileName(asset.Filename); + string identifier = TitleName + Path.GetFileName(asset.Filename); PckFile pckFile = asset.GetData(new PckFileReader(_originalEndianness)); PackInfo packInfo = PackInfo.Create(pckFile, _originalEndianness, false); @@ -1313,7 +1291,8 @@ namespace PckStudio.Controls return; } - if (string.IsNullOrEmpty(_location)) + // TODO: ! -null + if (true) { MessageBox.Show(this, "You must save your pck before creating or opening a music cues PCK file", "Can't create audio.pck"); return; diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 4508f1c4..361e889c 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -30,7 +30,8 @@ namespace PckStudio { public partial class MainForm : MetroFramework.Forms.MetroForm { - private PckManager PckManager = null; + private const string DEFAULT_PCK_SAVECONTEXT_DESCRIPTION = "PCK (Minecraft Console Package)"; + private PckManager PckManager = null; private Dictionary openTabPages = new Dictionary(); @@ -67,14 +68,14 @@ namespace PckStudio tabControl.SelectTab(openTabPages[identifier]); return; } - var editor = new PckEditor(packInfo, saveContext); + var editor = new PckEditor(caption, packInfo: packInfo, saveContext: saveContext); AddPage(caption, identifier, editor); } private void AddEditorPage(string caption, string identifier, PackInfo packInfo, ISaveContext saveContext = null) { - saveContext ??= GetDefaultSaveContext("./new.pck", "PCK (Minecraft Console Package)"); - var editor = new PckEditor(packInfo, saveContext); + saveContext ??= GetDefaultSaveContext("./new.pck", DEFAULT_PCK_SAVECONTEXT_DESCRIPTION); + var editor = new PckEditor("New Pack", packInfo: packInfo, saveContext: saveContext); AddPage(caption, identifier, editor); } @@ -142,8 +143,8 @@ namespace PckStudio if (TryOpenPck(filepath, out PackInfo packInfo)) { - ISaveContext saveContext = GetDefaultSaveContext(filepath, "PCK (Minecraft Console Package)"); - var editor = new PckEditor(packInfo, saveContext); + ISaveContext saveContext = GetDefaultSaveContext(filepath, DEFAULT_PCK_SAVECONTEXT_DESCRIPTION); + var editor = new PckEditor(Path.GetFileNameWithoutExtension(filepath), packInfo: packInfo, saveContext: saveContext); TabPage page = AddPage(Path.GetFileName(filepath), filepath, editor); return; } @@ -152,7 +153,7 @@ namespace PckStudio private static ISaveContext GetDefaultSaveContext(string filepath, string description) { - return new DelegatedFileSaveContext(filepath, false, new FileDialogFilter(description, "*"+Path.GetExtension(filepath)),(packInfo, stream) => new PckFileWriter(packInfo.File, packInfo.Endianness).WriteToStream(stream)); + return new DelegatedFileSaveContext(filepath, false,(packInfo, stream) => new PckFileWriter(packInfo.File, packInfo.Endianness).WriteToStream(stream)); } private TabPage AddPage(string caption, string identifier, Control control) @@ -165,6 +166,7 @@ namespace PckStudio page.Name = identifier; page.Controls.Add(control); tabControl.TabPages.Add(page); + openTabPages.Add(identifier, page); tabControl.SelectTab(page); return page; } @@ -297,7 +299,7 @@ namespace PckStudio { using var ofd = new OpenFileDialog(); ofd.CheckFileExists = true; - ofd.Filter = "PCK (Minecraft Console Package)|*.pck"; + ofd.Filter = $"{DEFAULT_PCK_SAVECONTEXT_DESCRIPTION}|*.pck"; if (ofd.ShowDialog(this) == DialogResult.OK) { LoadPckFromFile(ofd.FileName); @@ -542,11 +544,21 @@ namespace PckStudio } } - private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) + private void saveAsToolStripMenuItem_Click(object sender, EventArgs e) { if (TryGetCurrentEditor(out IEditor editor)) { - editor.SaveAs(); + using SaveFileDialog saveFileDialog = new SaveFileDialog + { + FileName = editor.TitleName, + Filter = "PCK (Minecraft Console Package)|*.pck", + DefaultExt = ".pck", + }; + if (saveFileDialog.ShowDialog() != DialogResult.OK) + return; + + editor.SetSaveContext(GetDefaultSaveContext(saveFileDialog.FileName, DEFAULT_PCK_SAVECONTEXT_DESCRIPTION)); + editor.Save(); } } diff --git a/PCK-Studio/MainForm.resx b/PCK-Studio/MainForm.resx index a485fc38..79954053 100644 --- a/PCK-Studio/MainForm.resx +++ b/PCK-Studio/MainForm.resx @@ -128,13 +128,13 @@ False - 177, 6 + 183, 6 False - 177, 6 + 183, 6 202, 6 @@ -179,7 +179,7 @@ - 180, 22 + 186, 22 New @@ -196,7 +196,7 @@ Ctrl+O - 180, 22 + 186, 22 Open @@ -217,7 +217,7 @@ - 180, 22 + 186, 22 Recently open @@ -233,10 +233,10 @@ - Ctrl+Shift+S + Ctrl+S - 180, 22 + 186, 22 Save @@ -245,8 +245,11 @@ False + + Ctrl+Shift+S + - 180, 22 + 186, 22 Save As @@ -276,7 +279,7 @@ - 180, 22 + 186, 22 Close @@ -285,7 +288,7 @@ False - 180, 22 + 186, 22 Close all @@ -303,7 +306,7 @@ - 180, 22 + 186, 22 Exit diff --git a/PckStudio.Core/DelegatedFileSaveContext.cs b/PckStudio.Core/DelegatedFileSaveContext.cs index 98f78cd6..f1116f9e 100644 --- a/PckStudio.Core/DelegatedFileSaveContext.cs +++ b/PckStudio.Core/DelegatedFileSaveContext.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using Newtonsoft.Json.Linq; using PckStudio.Interfaces; using PckStudio.Core; +using System.Diagnostics; namespace PckStudio.Core { @@ -18,26 +19,16 @@ namespace PckStudio.Core public bool AutoSave { get; } public string Filepath { get; private set; } private SerializeDataToStreamDelegate _serializeDataDelegate; - private FileDialogFilter _dialogFilter; - public DelegatedFileSaveContext(string filepath, bool autoSave, FileDialogFilter dialogFilter, SerializeDataToStreamDelegate serializeDataDelegate) + public DelegatedFileSaveContext(string filepath, bool autoSave, SerializeDataToStreamDelegate serializeDataDelegate) { AutoSave = autoSave; Filepath = filepath; _serializeDataDelegate = serializeDataDelegate; - _dialogFilter = dialogFilter; } public void Save(T value) { - if (!File.Exists(Filepath)) - { - SaveFileDialog saveFileDialog = new SaveFileDialog(); - saveFileDialog.Filter = _dialogFilter.ToString(); - if (saveFileDialog.ShowDialog() != DialogResult.OK) - return; - Filepath = saveFileDialog.FileName; - } using (Stream stream = File.OpenWrite(Filepath)) { _serializeDataDelegate(value, stream); diff --git a/PckStudio.Core/Interfaces/IEditor.cs b/PckStudio.Core/Interfaces/IEditor.cs index dd19944d..2d6301ea 100644 --- a/PckStudio.Core/Interfaces/IEditor.cs +++ b/PckStudio.Core/Interfaces/IEditor.cs @@ -1,21 +1,23 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using OMI.Formats.Pck; namespace PckStudio.Interfaces { - public interface IEditor where T : class + public interface IEditor where T : notnull { + string TitleName { get; } + T EditorValue { get; } ISaveContext SaveContext { get; } - void Save(); + void SetSaveContext(ISaveContext saveContext); - void SaveAs(); + void Save(); void Close(); diff --git a/PckStudio.Rendering/PckStudio.Rendering.csproj b/PckStudio.Rendering/PckStudio.Rendering.csproj index 3e83c5d7..83a2fcf3 100644 --- a/PckStudio.Rendering/PckStudio.Rendering.csproj +++ b/PckStudio.Rendering/PckStudio.Rendering.csproj @@ -6,7 +6,7 @@ AnyCPU {B1E19D0F-6DD5-4D91-9B45-9818759CA8EF} Library - NDEBUG + NDEBUG Properties PckStudio.Rendering PckStudio.Rendering diff --git a/Vendor/OMI-Lib b/Vendor/OMI-Lib index de0894be..bedf961a 160000 --- a/Vendor/OMI-Lib +++ b/Vendor/OMI-Lib @@ -1 +1 @@ -Subproject commit de0894bea66464eb8ea97eb9e92618aa368cf445 +Subproject commit bedf961a0466f96f21d635e64e69978403bb3124 From c5c86bb1c1a4ed6329646198c9ebcd2292dd0a8f Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 26 Jan 2026 04:46:33 +0100 Subject: [PATCH 7/7] Update v7.0.1.1 --- Version.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Version.json b/Version.json index 0711d4f6..4f0f0999 100644 --- a/Version.json +++ b/Version.json @@ -1,6 +1,6 @@ { - "version": "7.0.1.0", - "url": "https://github.com/PhoenixARC/-PCK-Studio/releases/download/v7.0.1.0/PCK-Studio.zip", - "changelog": "https://raw.githubusercontent.com/PhoenixARC/-PCK-Studio/main/CHANGELOG.md", + "version": "7.0.1.1", + "url": "https://github.com/LCERD/PCK-Studio/releases/download/v7.0.1.1/PCK-Studio.zip", + "changelog": "https://raw.githubusercontent.com/LCERD/PCK-Studio/main/CHANGELOG.md", "mandatory": false } \ No newline at end of file