Books on:   Sociology   |   Anthropology   |   Development   |   Political Science   |   Women Studies   |   Economics   |   Geography   |   Environment   |   and more...

Mcpack Converter [exclusive] -

mcpack_path = zip_path.with_suffix('.mcpack') zip_path.rename(mcpack_path) print(f"✅ Converted to: {mcpack_path}") return True def bulk_extract(directory): """Extract all .mcpack files in a directory""" directory = Path(directory) mcpack_files = list(directory.glob("*.mcpack")) if not mcpack_files: print("❌ No .mcpack files found") return

import tkinter as tk from tkinter import filedialog, messagebox, scrolledtext import subprocess import sys import os class MCPackConverterGUI: def (self, root): self.root = root root.title("MCPack Converter") root.geometry("600x400") mcpack converter

def run(self, command): path = self.path_var.get() if not path: messagebox.showerror("Error", "Select a file or folder first") return # Call the CLI script script_dir = os.path.dirname(os.path.abspath(__file__)) script_path = os.path.join(script_dir, "mcpack_converter.py") cmd = [sys.executable, script_path, path, command] try: result = subprocess.run(cmd, capture_output=True, text=True) self.log.insert(tk.END, f"\n> {' '.join(cmd)}\n") self.log.insert(tk.END, result.stdout) if result.stderr: self.log.insert(tk.END, result.stderr) self.log.see(tk.END) except Exception as e: messagebox.showerror("Error", str(e)) if == " main ": root = tk.Tk() app = MCPackConverterGUI(root) root.mainloop() mcpack_path = zip_path

try: with zipfile.ZipFile(mcpack_path, 'r') as zip_ref: zip_ref.extractall(output_dir) print(f"✅ Extracted to: {output_dir}") # Try to detect pack type manifest = output_dir / "manifest.json" if manifest.exists(): with open(manifest, 'r') as f: data = json.load(f) modules = data.get("modules", []) if modules: pack_type = modules[0].get("type", "unknown") print(f"📦 Pack type: {pack_type}") return True except Exception as e: print(f"❌ Extraction failed: {e}") return False def pack_to_mcpack(folder_path, output_name=None): """Pack a folder into .mcpack file""" folder_path = Path(folder_path) if not folder_path.exists() or not folder_path.is_dir(): print(f"❌ Folder not found: {folder_path}") return False "mcpack_converter.py") cmd = [sys.executable