compat: complete Twilight Forest support

This commit is contained in:
Martin Prokoph
2025-03-13 22:37:51 +01:00
parent b15c1baac3
commit 95e482133b
58 changed files with 670 additions and 100 deletions

Binary file not shown.

View File

@@ -0,0 +1,18 @@
{ "parent": "block/block",
"textures": {
"particle": "#all"
},
"elements": [
{ "from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "up" },
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "north" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "south" },
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "west" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "east" }
}
}
]
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/acacia_leaves1"
},
{
"model": "minecraft:block/acacia_leaves1",
"y": 90
},
{
"model": "minecraft:block/acacia_leaves1",
"y": 180
},
{
"model": "minecraft:block/acacia_leaves1",
"y": 270
},
{
"model": "minecraft:block/acacia_leaves2"
},
{
"model": "minecraft:block/acacia_leaves2",
"y": 90
},
{
"model": "minecraft:block/acacia_leaves2",
"y": 180
},
{
"model": "minecraft:block/acacia_leaves2",
"y": 270
},
{
"model": "minecraft:block/acacia_leaves3"
},
{
"model": "minecraft:block/acacia_leaves3",
"y": 90
},
{
"model": "minecraft:block/acacia_leaves3",
"y": 180
},
{
"model": "minecraft:block/acacia_leaves3",
"y": 270
},
{
"model": "minecraft:block/acacia_leaves4"
},
{
"model": "minecraft:block/acacia_leaves4",
"y": 90
},
{
"model": "minecraft:block/acacia_leaves4",
"y": 180
},
{
"model": "minecraft:block/acacia_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/spruce_leaves1"
},
{
"model": "minecraft:block/spruce_leaves1",
"y": 90
},
{
"model": "minecraft:block/spruce_leaves1",
"y": 180
},
{
"model": "minecraft:block/spruce_leaves1",
"y": 270
},
{
"model": "minecraft:block/spruce_leaves2"
},
{
"model": "minecraft:block/spruce_leaves2",
"y": 90
},
{
"model": "minecraft:block/spruce_leaves2",
"y": 180
},
{
"model": "minecraft:block/spruce_leaves2",
"y": 270
},
{
"model": "minecraft:block/spruce_leaves3"
},
{
"model": "minecraft:block/spruce_leaves3",
"y": 90
},
{
"model": "minecraft:block/spruce_leaves3",
"y": 180
},
{
"model": "minecraft:block/spruce_leaves3",
"y": 270
},
{
"model": "minecraft:block/spruce_leaves4"
},
{
"model": "minecraft:block/spruce_leaves4",
"y": 90
},
{
"model": "minecraft:block/spruce_leaves4",
"y": 180
},
{
"model": "minecraft:block/spruce_leaves4",
"y": 270
}
]
}
}

View File

@@ -1,66 +0,0 @@
{
"variants": {
"": [
{
"model": "twilightforest:block/darkwood_leaves1"
},
{
"model": "twilightforest:block/darkwood_leaves1",
"y": 90
},
{
"model": "twilightforest:block/darkwood_leaves1",
"y": 180
},
{
"model": "twilightforest:block/darkwood_leaves1",
"y": 270
},
{
"model": "twilightforest:block/darkwood_leaves2"
},
{
"model": "twilightforest:block/darkwood_leaves2",
"y": 90
},
{
"model": "twilightforest:block/darkwood_leaves2",
"y": 180
},
{
"model": "twilightforest:block/darkwood_leaves2",
"y": 270
},
{
"model": "twilightforest:block/darkwood_leaves3"
},
{
"model": "twilightforest:block/darkwood_leaves3",
"y": 90
},
{
"model": "twilightforest:block/darkwood_leaves3",
"y": 180
},
{
"model": "twilightforest:block/darkwood_leaves3",
"y": 270
},
{
"model": "twilightforest:block/darkwood_leaves4"
},
{
"model": "twilightforest:block/darkwood_leaves4",
"y": 90
},
{
"model": "twilightforest:block/darkwood_leaves4",
"y": 180
},
{
"model": "twilightforest:block/darkwood_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,21 @@
{
"variants": {
"": [
{
"model": "twilightforest:block/fallen_leaves"
},
{
"model": "twilightforest:block/fallen_leaves",
"y": 90
},
{
"model": "twilightforest:block/fallen_leaves",
"y": 180
},
{
"model": "twilightforest:block/fallen_leaves",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/birch_leaves1"
},
{
"model": "minecraft:block/birch_leaves1",
"y": 90
},
{
"model": "minecraft:block/birch_leaves1",
"y": 180
},
{
"model": "minecraft:block/birch_leaves1",
"y": 270
},
{
"model": "minecraft:block/birch_leaves2"
},
{
"model": "minecraft:block/birch_leaves2",
"y": 90
},
{
"model": "minecraft:block/birch_leaves2",
"y": 180
},
{
"model": "minecraft:block/birch_leaves2",
"y": 270
},
{
"model": "minecraft:block/birch_leaves3"
},
{
"model": "minecraft:block/birch_leaves3",
"y": 90
},
{
"model": "minecraft:block/birch_leaves3",
"y": 180
},
{
"model": "minecraft:block/birch_leaves3",
"y": 270
},
{
"model": "minecraft:block/birch_leaves4"
},
{
"model": "minecraft:block/birch_leaves4",
"y": 90
},
{
"model": "minecraft:block/birch_leaves4",
"y": 180
},
{
"model": "minecraft:block/birch_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/oak_leaves1"
},
{
"model": "minecraft:block/oak_leaves1",
"y": 90
},
{
"model": "minecraft:block/oak_leaves1",
"y": 180
},
{
"model": "minecraft:block/oak_leaves1",
"y": 270
},
{
"model": "minecraft:block/oak_leaves2"
},
{
"model": "minecraft:block/oak_leaves2",
"y": 90
},
{
"model": "minecraft:block/oak_leaves2",
"y": 180
},
{
"model": "minecraft:block/oak_leaves2",
"y": 270
},
{
"model": "minecraft:block/oak_leaves3"
},
{
"model": "minecraft:block/oak_leaves3",
"y": 90
},
{
"model": "minecraft:block/oak_leaves3",
"y": 180
},
{
"model": "minecraft:block/oak_leaves3",
"y": 270
},
{
"model": "minecraft:block/oak_leaves4"
},
{
"model": "minecraft:block/oak_leaves4",
"y": 90
},
{
"model": "minecraft:block/oak_leaves4",
"y": 180
},
{
"model": "minecraft:block/oak_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/oak_leaves1"
},
{
"model": "minecraft:block/oak_leaves1",
"y": 90
},
{
"model": "minecraft:block/oak_leaves1",
"y": 180
},
{
"model": "minecraft:block/oak_leaves1",
"y": 270
},
{
"model": "minecraft:block/oak_leaves2"
},
{
"model": "minecraft:block/oak_leaves2",
"y": 90
},
{
"model": "minecraft:block/oak_leaves2",
"y": 180
},
{
"model": "minecraft:block/oak_leaves2",
"y": 270
},
{
"model": "minecraft:block/oak_leaves3"
},
{
"model": "minecraft:block/oak_leaves3",
"y": 90
},
{
"model": "minecraft:block/oak_leaves3",
"y": 180
},
{
"model": "minecraft:block/oak_leaves3",
"y": 270
},
{
"model": "minecraft:block/oak_leaves4"
},
{
"model": "minecraft:block/oak_leaves4",
"y": 90
},
{
"model": "minecraft:block/oak_leaves4",
"y": 180
},
{
"model": "minecraft:block/oak_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"variants": {
"": [
{
"model": "minecraft:block/oak_leaves1"
},
{
"model": "minecraft:block/oak_leaves1",
"y": 90
},
{
"model": "minecraft:block/oak_leaves1",
"y": 180
},
{
"model": "minecraft:block/oak_leaves1",
"y": 270
},
{
"model": "minecraft:block/oak_leaves2"
},
{
"model": "minecraft:block/oak_leaves2",
"y": 90
},
{
"model": "minecraft:block/oak_leaves2",
"y": 180
},
{
"model": "minecraft:block/oak_leaves2",
"y": 270
},
{
"model": "minecraft:block/oak_leaves3"
},
{
"model": "minecraft:block/oak_leaves3",
"y": 90
},
{
"model": "minecraft:block/oak_leaves3",
"y": 180
},
{
"model": "minecraft:block/oak_leaves3",
"y": 270
},
{
"model": "minecraft:block/oak_leaves4"
},
{
"model": "minecraft:block/oak_leaves4",
"y": 90
},
{
"model": "minecraft:block/oak_leaves4",
"y": 180
},
{
"model": "minecraft:block/oak_leaves4",
"y": 270
}
]
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/leaves_regular",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "betterleaves:block/leaves",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "betterleaves:block/leaves1",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "betterleaves:block/leaves2",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "betterleaves:block/leaves3",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -1,6 +0,0 @@
{
"parent": "betterleaves:block/leaves4",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "betterleaves:block/leaf_carpet",
"textures": {
"wool": "minecraft:block/oak_leaves"
}
}

View File

@@ -0,0 +1,10 @@
{
"parent": "minecraft:block/block",
"loader": "twilightforest:giant_block",
"parent_block": "minecraft:oak_leaves",
"render_type": "minecraft:cutout_mipped",
"textures": {
"all": "twilightforest:block/oak_leaves_regular",
"particle": "twilightforest:block/oak_leaves_regular"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/leaves_regular",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/azalea_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/spruce_leaves"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "twilightforest:block/oak_leaves_regular"
}
}

View File

@@ -0,0 +1,20 @@
{
"parent": "minecraft:block/oak_leaves",
"base": {
"parent": "twilightforest:item/giant_block_base",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
},
"loader": "neoforge:separate_transforms",
"perspectives": {
"gui": {
"parent": "twilightforest:item/giant_block_gui",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "twilightforest:item/giant_block_base",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "twilightforest:item/giant_block_gui",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/birch_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/mining_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/sorting_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/time_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/transformation_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View File

@@ -0,0 +1,18 @@
{ "parent": "block/block",
"textures": {
"particle": "#all"
},
"elements": [
{ "from": [ 0, 0, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "up" },
"north": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "north" },
"south": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "south" },
"west": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "west" },
"east": { "uv": [ 0, 0, 16, 16 ], "texture": "#all", "tintindex": 0, "cullface": "east" }
}
}
]
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/leaves_regular",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -0,0 +1,10 @@
{
"parent": "minecraft:block/block",
"loader": "twilightforest:giant_block",
"parent_block": "minecraft:oak_leaves",
"render_type": "minecraft:cutout_mipped",
"textures": {
"all": "twilightforest:block/oak_leaves_regular",
"particle": "twilightforest:block/oak_leaves_regular"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/leaves_regular",
"textures": {
"all": "twilightforest:block/darkwood_leaves"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/azalea_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/spruce_leaves"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "twilightforest:block/oak_leaves_regular"
}
}

View File

@@ -0,0 +1,20 @@
{
"parent": "minecraft:block/oak_leaves",
"base": {
"parent": "twilightforest:item/giant_block_base",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
},
"loader": "neoforge:separate_transforms",
"perspectives": {
"gui": {
"parent": "twilightforest:item/giant_block_gui",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "twilightforest:item/giant_block_base",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "twilightforest:item/giant_block_gui",
"textures": {
"all": "minecraft:block/oak_leaves",
"top": "minecraft:block/oak_leaves"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/birch_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/mining_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/sorting_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/time_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "twilightforest:block/transformation_leaves"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "minecraft:item/oak_leaves"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

View File

@@ -55,6 +55,7 @@ def autoGen(jsonData, args):
leaves_with_carpet = jsonData["leavesWithCarpet"]
dynamictrees_namespaces = jsonData["dynamicTreesNamespaces"]
generate_itemmodels_overrides = jsonData["generateItemModels"]
block_state_copies = jsonData["blockStateCopies"]
print("Generating assets...")
if (os.path.exists("./assets")): shutil.rmtree("./assets")
copy_tree("./base/assets/", "./assets/")
@@ -134,7 +135,7 @@ def autoGen(jsonData, args):
printOverride("Also generating item model")
# Generate blockstates & models
generateBlockstate(leaf)
generateBlockstate(leaf, block_state_copies)
generateBlockModels(leaf)
generateItemModel(leaf)
@@ -238,7 +239,7 @@ def generateTexture(root, infile, useProgrammerArt=False):
print("Error while generating texture for '%s'" % infile)
def generateBlockstate(leaf):
def generateBlockstate(leaf, block_state_copies):
mod_namespace = leaf.getId().split(":")[0]
block_name = leaf.getId().split(":")[1]
@@ -269,6 +270,22 @@ def generateBlockstate(leaf):
with open(dyntrees_block_state_file, "w") as f:
json.dump(block_state_data, f, indent=4)
# Additional block state copies
if (leaf.getId()) in block_state_copies:
block_state_copy_ids = block_state_copies[leaf.getId()]
if not isinstance(block_state_copy_ids, list): block_state_copy_ids = [block_state_copy_ids] # In case only one blockstate is provided (as a string), turn it into a list
for block_state_copy_id in block_state_copy_ids:
block_state_copy_namespace = block_state_copy_id.split(":")[0]
block_state_copy_name = block_state_copy_id.split(":")[1]
block_state_copy_file = f"assets/{block_state_copy_namespace}/blockstates/{block_state_copy_name}.json"
os.makedirs("assets/{}/blockstates/".format(block_state_copy_namespace), exist_ok=True)
# Write blockstate file
with open(block_state_copy_file, "w") as f:
json.dump(block_state_data, f, indent=4)
printOverride(f"Writing blockstate copy: {block_state_copy_id}")
def generateBlockModels(leaf):
mod_namespace = leaf.getId().split(":")[0]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

View File

@@ -6,7 +6,7 @@
"palegarden:pale_oak_leaves"
],
"leavesWithCarpet": {
"minecraft:oak_leaves": ["quark:oak_leaf_carpet", "immersive_weathering:oak_leaf_pile"],
"minecraft:oak_leaves": ["quark:oak_leaf_carpet", "immersive_weathering:oak_leaf_pile", "twilightforest:fallen_leaves"],
"minecraft:birch_leaves": ["quark:birch_leaf_carpet", "immersive_weathering:birch_leaf_pile"],
"minecraft:spruce_leaves": ["quark:spruce_leaf_carpet", "immersive_weathering:spruce_leaf_pile"],
"minecraft:jungle_leaves": ["quark:jungle_leaf_carpet", "immersive_weathering:jungle_leaf_pile"],
@@ -71,5 +71,11 @@
"betterend:dragon_tree_leaves",
"betterend:pythadendron_leaves",
"betterend:shadow_berry_leaves"
]
],
"blockStateCopies": {
"minecraft:oak_leaves": ["twilightforest:twilight_oak_leaves", "twilightforest:rainbow_oak_leaves", "twilightforest:thorn_leaves"],
"minecraft:birch_leaves": "twilightforest:mangrove_leaves",
"minecraft:spruce_leaves": "twilightforest:canopy_leaves",
"minecraft:acacia_leaves": "twilightforest:beanstalk_leaves"
}
}