mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-09-27 16:10:45 +00:00
update
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stonevox.Mod
|
||||
{
|
||||
public class Alias
|
||||
{
|
||||
public string name;
|
||||
public FileReference file;
|
||||
}
|
||||
|
||||
public class FunctionAlias
|
||||
{
|
||||
public enum endpoint
|
||||
{
|
||||
client,
|
||||
server
|
||||
}
|
||||
|
||||
public string name;
|
||||
public FileReference controller;
|
||||
public endpoint enpoint;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stonevox.Mod
|
||||
{
|
||||
public class FileReference
|
||||
{
|
||||
public string file { get; }
|
||||
|
||||
public FileReference(string file)
|
||||
{
|
||||
this.file = file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using Ionic.Zip;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stonevox.Mod
|
||||
{
|
||||
public class Manifest
|
||||
{
|
||||
public class info
|
||||
{
|
||||
public string name { get; set; }
|
||||
public string version { get; set; }
|
||||
}
|
||||
|
||||
public class game
|
||||
{
|
||||
public FileReference[] script;
|
||||
}
|
||||
|
||||
public FileReference client_init_script;
|
||||
public FileReference server_init_script;
|
||||
|
||||
public List<Alias> aliases;
|
||||
// don't need the other stuff now, will add
|
||||
|
||||
Manifest()
|
||||
{
|
||||
aliases = new List<Alias>();
|
||||
}
|
||||
|
||||
Manifest(string modDirectory)
|
||||
: this()
|
||||
{
|
||||
if (Directory.Exists(modDirectory))
|
||||
{
|
||||
if (File.Exists(Path.Combine(modDirectory , "manifest.json")))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
throw new Exception("No Manifest File found.");
|
||||
}
|
||||
else
|
||||
throw new Exception("Expecting a folder path.");
|
||||
}
|
||||
|
||||
Manifest(ZipFile file)
|
||||
: this()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void LoadFromFile(string manifestPath)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void LoadFromZip(ZipEntry manifestEntry)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static Manifest FromDirectory(string modDirectory)
|
||||
{
|
||||
return new Manifest(modDirectory);
|
||||
}
|
||||
|
||||
public static Manifest FromSMOD(string smodPath)
|
||||
{
|
||||
if (File.Exists(smodPath))
|
||||
{
|
||||
if (ZipFile.IsZipFile(smodPath))
|
||||
{
|
||||
ZipFile zip = ZipFile.Read(smodPath);
|
||||
return new Manifest(zip);
|
||||
}
|
||||
else
|
||||
throw new Exception("Not a valid .smod");
|
||||
}
|
||||
else
|
||||
throw new Exception("Expecting *.smod at path, but found nothing");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Ionic.Zip;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace stonevox.Mod
|
||||
{
|
||||
public class StoneHearthMod
|
||||
{
|
||||
public string path { get; }
|
||||
|
||||
private ZipFile zip;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user