diff --git a/Better-Leaves-Lite-1.0.zip b/Better-Leaves-Lite-1.0.zip index 5f1a9d4..fc5c148 100644 Binary files a/Better-Leaves-Lite-1.0.zip and b/Better-Leaves-Lite-1.0.zip differ diff --git a/assets/minecraft/models/block/leaves.json b/assets/minecraft/models/block/leaves.json new file mode 100644 index 0000000..b13c5fd --- /dev/null +++ b/assets/minecraft/models/block/leaves.json @@ -0,0 +1,198 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "normal_block", + "from": [0, 0, 0], + "to": [16, 16, 16], + "shade": false, + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north", "tintindex": 0}, + "east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "east", "tintindex": 0}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south", "tintindex": 0}, + "west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west", "tintindex": 0}, + "up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up", "tintindex": 0}, + "down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [2.4, -6, 5.2], + "to": [20.4, -3, 5.21], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [2, 3, -2]}, + "faces": { + "north": {"uv": [0, 8, 16, 11], "texture": "#all", "cullface": "down", "tintindex": 0}, + "south": {"uv": [0, 1, 16, 4], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [2.4, 20, 5.2], + "to": [20.4, 23, 5.21], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [2, 25, -2]}, + "faces": { + "north": {"uv": [0, 3.05, 16, 5.95], "texture": "#all", "cullface": "up", "tintindex": 0}, + "south": {"uv": [0, 3.05, 16, 5.95], "texture": "#all", "cullface": "up", "tintindex": 0} + } + }, + { + "from": [22.4, -1, 9.3], + "to": [25.4, 18, 9.31], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [12, 7, 2]}, + "faces": { + "north": {"uv": [13, 0, 16, 16], "texture": "#all", "cullface": "east", "tintindex": 0}, + "south": {"uv": [0.05, 0, 2.95, 16], "texture": "#all", "cullface": "east", "tintindex": 0} + } + }, + { + "from": [-2.6, -1, 0.5], + "to": [0.4, 18, 0.51], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-9, 7, -7]}, + "faces": { + "north": {"uv": [0.05, 0, 2.95, 16], "texture": "#all", "cullface": "west", "tintindex": 0}, + "south": {"uv": [0, 0, 3, 16], "texture": "#all", "cullface": "west", "tintindex": 0} + } + }, + { + "from": [7, 4, 7.99], + "to": [23, 20, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 7, 0]}, + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all", "tintindex": 0}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all", "tintindex": 0} + } + }, + { + "from": [7, -3, 7.99], + "to": [23, 4, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 16, 7], "texture": "#all", "cullface": "down", "tintindex": 0}, + "south": {"uv": [0, 0, 16, 7], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [-1, -3, 7.99], + "to": [7, 4, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 8, 7], "texture": "#all", "cullface": "down", "tintindex": 0}, + "south": {"uv": [0, 0, 8, 7], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [-1, 4, 7.99], + "to": [7, 20, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 7, 0]}, + "faces": { + "north": {"uv": [0.05, 0, 7.95, 16], "texture": "#all", "tintindex": 0}, + "south": {"uv": [0, 0, 8, 16], "texture": "#all", "tintindex": 0} + } + }, + { + "from": [4.6, -7, -5], + "to": [4.61, -4, 14], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-5, 4, 13]}, + "faces": { + "east": {"uv": [0, 7, 16, 10], "texture": "#all", "cullface": "down", "tintindex": 0}, + "west": {"uv": [0, 12, 16, 15], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [5, 21, -6.4], + "to": [5.01, 23, 12.6], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 9, 12]}, + "faces": { + "east": {"uv": [0, 14.05, 16, 15.95], "texture": "#all", "cullface": "up", "tintindex": 0}, + "west": {"uv": [0, 14.05, 16, 15.95], "texture": "#all", "cullface": "up", "tintindex": 0} + } + }, + { + "from": [5, -2, -13], + "to": [5.01, 19, -9], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 4, 12]}, + "faces": { + "east": {"uv": [9.05, 0, 12.95, 16], "texture": "#all", "tintindex": 0}, + "west": {"uv": [0, 0, 4, 16], "texture": "#all", "tintindex": 0} + } + }, + { + "from": [2.65, -2, 16.85], + "to": [2.66, 19, 19.85], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-2, 4, 19]}, + "faces": { + "east": {"uv": [13, 0, 16, 16], "texture": "#all", "tintindex": 0}, + "west": {"uv": [0.05, 0, 2.95, 16], "texture": "#all", "tintindex": 0} + } + }, + { + "from": [5, 5, -9], + "to": [5.01, 21, 7], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 4, 12]}, + "faces": { + "east": {"uv": [0, 0, 16, 16], "texture": "#all", "tintindex": 0}, + "west": {"uv": [0, 0, 16, 16], "texture": "#all", "tintindex": 0} + } + }, + { + "from": [5, -4, -9], + "to": [5.01, 5, 7], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, -5, 12]}, + "faces": { + "east": {"uv": [0, 0, 16, 9], "texture": "#all", "cullface": "down", "tintindex": 0}, + "west": {"uv": [0, 0, 16, 9], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [1.3, -4, 3.675], + "to": [1.31, 5, 12.675], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-14, -5, 20]}, + "faces": { + "east": {"uv": [7, 7, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0}, + "west": {"uv": [7, 7, 16, 16], "texture": "#all", "cullface": "down", "tintindex": 0} + } + }, + { + "from": [1.3, 5, 4.375], + "to": [1.31, 21, 13.375], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-14, 4, 20]}, + "faces": { + "east": {"uv": [7, 0, 16, 16], "texture": "#all", "tintindex": 0}, + "west": {"uv": [0, 0, 10, 16], "texture": "#all", "tintindex": 0} + } + } + ], + "groups": [ + 0, + { + "name": "bushy_leaves", + "origin": [8, 8, 8], + "color": 0, + "children": [1, 2, 3, 4, 5, 6, 7, 8] + }, + { + "name": "bushy_leaves2", + "origin": [8, 8, 8], + "color": 0, + "children": [9, 10, 11, 12, 13, 14, 15, 16] + } + ] +} \ No newline at end of file diff --git a/assets/minecraft/models/block/leaves_notint.json b/assets/minecraft/models/block/leaves_notint.json new file mode 100644 index 0000000..8e358ba --- /dev/null +++ b/assets/minecraft/models/block/leaves_notint.json @@ -0,0 +1,198 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "particle": "#all" + }, + "elements": [ + { + "name": "normal_block", + "from": [0, 0, 0], + "to": [16, 16, 16], + "shade": false, + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "north"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "east"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "south"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "west"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "up"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [2.4, -6, 5.2], + "to": [20.4, -3, 5.21], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [2, 3, -2]}, + "faces": { + "north": {"uv": [0, 8, 16, 11], "texture": "#all", "cullface": "down"}, + "south": {"uv": [0, 1, 16, 4], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [2.4, 20, 5.2], + "to": [20.4, 23, 5.21], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [2, 25, -2]}, + "faces": { + "north": {"uv": [0, 3.05, 16, 5.95], "texture": "#all", "cullface": "up"}, + "south": {"uv": [0, 3.05, 16, 5.95], "texture": "#all", "cullface": "up"} + } + }, + { + "from": [22.4, -1, 9.3], + "to": [25.4, 18, 9.31], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [12, 7, 2]}, + "faces": { + "north": {"uv": [13, 0, 16, 16], "texture": "#all", "cullface": "east"}, + "south": {"uv": [0.05, 0, 2.95, 16], "texture": "#all", "cullface": "east"} + } + }, + { + "from": [-2.6, -1, 0.5], + "to": [0.4, 18, 0.51], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-9, 7, -7]}, + "faces": { + "north": {"uv": [0.05, 0, 2.95, 16], "texture": "#all", "cullface": "west"}, + "south": {"uv": [0, 0, 3, 16], "texture": "#all", "cullface": "west"} + } + }, + { + "from": [7, 4, 7.99], + "to": [23, 20, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 7, 0]}, + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#all"} + } + }, + { + "from": [7, -3, 7.99], + "to": [23, 4, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 16, 7], "texture": "#all", "cullface": "down"}, + "south": {"uv": [0, 0, 16, 7], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [-1, -3, 7.99], + "to": [7, 4, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 8, 7], "texture": "#all", "cullface": "down"}, + "south": {"uv": [0, 0, 8, 7], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [-1, 4, 7.99], + "to": [7, 20, 8], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [9, 7, 0]}, + "faces": { + "north": {"uv": [0.05, 0, 7.95, 16], "texture": "#all"}, + "south": {"uv": [0, 0, 8, 16], "texture": "#all"} + } + }, + { + "from": [4.6, -7, -5], + "to": [4.61, -4, 14], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-5, 4, 13]}, + "faces": { + "east": {"uv": [0, 7, 16, 10], "texture": "#all", "cullface": "down"}, + "west": {"uv": [0, 12, 16, 15], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [5, 21, -6.4], + "to": [5.01, 23, 12.6], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 9, 12]}, + "faces": { + "east": {"uv": [0, 14.05, 16, 15.95], "texture": "#all", "cullface": "up"}, + "west": {"uv": [0, 14.05, 16, 15.95], "texture": "#all", "cullface": "up"} + } + }, + { + "from": [5, -2, -13], + "to": [5.01, 19, -9], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 4, 12]}, + "faces": { + "east": {"uv": [9.05, 0, 12.95, 16], "texture": "#all"}, + "west": {"uv": [0, 0, 4, 16], "texture": "#all"} + } + }, + { + "from": [2.65, -2, 16.85], + "to": [2.66, 19, 19.85], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-2, 4, 19]}, + "faces": { + "east": {"uv": [13, 0, 16, 16], "texture": "#all"}, + "west": {"uv": [0.05, 0, 2.95, 16], "texture": "#all"} + } + }, + { + "from": [5, 5, -9], + "to": [5.01, 21, 7], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, 4, 12]}, + "faces": { + "east": {"uv": [0, 0, 16, 16], "texture": "#all"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#all"} + } + }, + { + "from": [5, -4, -9], + "to": [5.01, 5, 7], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-6, -5, 12]}, + "faces": { + "east": {"uv": [0, 0, 16, 9], "texture": "#all", "cullface": "down"}, + "west": {"uv": [0, 0, 16, 9], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [1.3, -4, 3.675], + "to": [1.31, 5, 12.675], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-14, -5, 20]}, + "faces": { + "east": {"uv": [7, 7, 16, 16], "texture": "#all", "cullface": "down"}, + "west": {"uv": [7, 7, 16, 16], "texture": "#all", "cullface": "down"} + } + }, + { + "from": [1.3, 5, 4.375], + "to": [1.31, 21, 13.375], + "shade": false, + "rotation": {"angle": -22.5, "axis": "y", "origin": [-14, 4, 20]}, + "faces": { + "east": {"uv": [7, 0, 16, 16], "texture": "#all"}, + "west": {"uv": [0, 0, 10, 16], "texture": "#all"} + } + } + ], + "groups": [ + 0, + { + "name": "bushy_leaves", + "origin": [8, 8, 8], + "color": 0, + "children": [1, 2, 3, 4, 5, 6, 7, 8] + }, + { + "name": "bushy_leaves2", + "origin": [8, 8, 8], + "color": 0, + "children": [9, 10, 11, 12, 13, 14, 15, 16] + } + ] +} \ No newline at end of file diff --git a/gen_pack.py b/gen_pack.py index 306dba4..2006322 100644 --- a/gen_pack.py +++ b/gen_pack.py @@ -18,7 +18,7 @@ def printCyan(out): print("\033[96m{}\033[00m" .format(out)) def printOverride(out): print(" -> {}".format(out)) # This is where the magic happens -def autoGen(jsonData): +def autoGen(jsonData, args): notint_overrides = jsonData["noTint"] block_texture_overrides = jsonData["blockTextures"] overlay_textures = jsonData["overlayTextures"] @@ -59,10 +59,14 @@ def autoGen(jsonData): continue texture = Image.open(os.path.join(root, infile)) - is_animated = texture.size[0] != texture.size[1] + use_legacy_model = texture.size[0] != texture.size[1] + if use_legacy_model: printOverride("Animated – using legacy model") + if args.legacy: + use_legacy_model = True + printOverride("Using legacy model as requested") # Generate texture - if not is_animated: generateTexture(root, infile) + if not use_legacy_model: generateTexture(root, infile) # Set block id and apply overrides block_id = namespace+":"+block_name @@ -80,9 +84,8 @@ def autoGen(jsonData): base_model = "leaves" # Check if the block appears in the notint overrides hasNoTint = block_id in notint_overrides - if is_animated: + if use_legacy_model: base_model = "leaves_legacy" - printOverride("Animated – using legacy model") elif hasNoTint: base_model = "leaves_notint" printOverride("No tint") @@ -340,6 +343,7 @@ if __name__ == '__main__': epilog='Feel free to ask for help at http://discord.midnightdust.eu/') parser.add_argument('version', type=str) + parser.add_argument('--legacy', '-l', action='store_true') args = parser.parse_args() print(f"Arguments: {args}") @@ -353,7 +357,7 @@ if __name__ == '__main__': data = json.load(f) f.close() - autoGen(data); + autoGen(data, args); print() print("Zipping it up...") makeZip(args.version);