commit 41c6f56d676e72e69af6d07dbbae886d8570b63f Author: Kq Date: Wed Aug 5 12:36:04 2026 +0200 init diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..80699ef --- /dev/null +++ b/Program.cs @@ -0,0 +1,74 @@ +Console.Write("Block Name(diamon_ore): "); +string blockname = Console.ReadLine(); + +if (string.IsNullOrEmpty(blockname)) +{ + blockname = "diamond_ore"; +} + +Console.Write("top texture url: "); +string top_texture = Console.ReadLine().Trim('\"'); + +Console.Write("bottom texture url: "); +string bottom_texture = Console.ReadLine().Trim('\"'); + +Console.Write("both texture url: "); +string both_texture = Console.ReadLine().Trim('\"'); + +Console.Write("none texture url: "); +string none_texture = Console.ReadLine().Trim('\"'); + + +string working_dir = Directory.GetCurrentDirectory(); +// string blockname = "blockname"; +Directory.CreateDirectory(working_dir + "/output/assets"); + +string mcmeta = @"{ + ""pack"": { + ""description"": """", + ""pack_format"": 15, + ""min_format"": [15, 0], + ""max_format"": [1000, 0], + ""supported_formats"": [15, 1000] + } +}"; + +File.WriteAllText(working_dir + "/output/pack.mcmeta", mcmeta); + +Directory.CreateDirectory(working_dir + "/output/assets/minecraft"); +Directory.CreateDirectory(working_dir + "/output/assets/minecraft/optifine"); +Directory.CreateDirectory(working_dir + "/output/assets/minecraft/optifine/ctm"); +Directory.CreateDirectory(working_dir + "/output/assets/minecraft/optifine/ctm/" + blockname); + + +string ctm_dir = working_dir + "/output/assets/minecraft/optifine/ctm/" + blockname; +string ctmproperties = @"matchTiles=" + blockname + @" +method=ctm +tiles=0-47"; + +File.WriteAllText(ctm_dir + "/" + blockname + ".properties", ctmproperties); + +int[] top = {4,5,7,12,13,14,15,29,31}; +int[] bottom = {16,17,18,36,37,38,39,40,42}; +int[] both = {0,1,2,3}; +int[] none = {6,8,9,10,11,19,20,21,22,23,24,25,26,27,28,30,32,33,34,35,41,43,44,45,46}; + + + + +foreach (int i in top) +{ + File.Copy(top_texture, ctm_dir + "/" + i + ".png"); +} +foreach (int i in bottom) +{ + File.Copy(bottom_texture, ctm_dir + "/" + i + ".png"); +} +foreach (int i in both) +{ + File.Copy(both_texture, ctm_dir + "/" + i + ".png"); +} +foreach (int i in none) +{ + File.Copy(none_texture, ctm_dir + "/" + i + ".png"); +} diff --git a/example/both.png b/example/both.png new file mode 100644 index 0000000..92d5d18 Binary files /dev/null and b/example/both.png differ diff --git a/example/bottom.png b/example/bottom.png new file mode 100644 index 0000000..a7cc171 Binary files /dev/null and b/example/bottom.png differ diff --git a/example/none.png b/example/none.png new file mode 100644 index 0000000..f63fc85 Binary files /dev/null and b/example/none.png differ diff --git a/example/top.png b/example/top.png new file mode 100644 index 0000000..60a7f9f Binary files /dev/null and b/example/top.png differ diff --git a/txtgen.csproj b/txtgen.csproj new file mode 100644 index 0000000..bb73c99 --- /dev/null +++ b/txtgen.csproj @@ -0,0 +1,11 @@ + + + + Exe + win-x64;linux-x64 + net10.0 + enable + enable + + +