From eb2534076a3cbb04406f21fa645730f4311d01cd Mon Sep 17 00:00:00 2001 From: mlavaire Date: Fri, 19 Apr 2019 08:54:06 -0400 Subject: [PATCH 01/12] Bamboo fix --- .../minecraft/blockstates/bamboo.json | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/bamboo.json diff --git a/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json b/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json new file mode 100644 index 0000000..59e7e52 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/bamboo.json @@ -0,0 +1,26 @@ +{ + "multipart": [ + { "when": { "leaves": "none", "age": "0" }, + "apply": [ + { "model": "block/bamboo1_age0" }, + { "model": "block/bamboo2_age0" }, + { "model": "block/bamboo3_age0" }, + { "model": "block/bamboo4_age0" } + ] + }, + { "when": { "leaves": "none", "age": "1" }, + "apply": [ + { "model": "block/bamboo1_age1" }, + { "model": "block/bamboo2_age1" }, + { "model": "block/bamboo3_age1" }, + { "model": "block/bamboo4_age1" } + ] + }, + { "when": { "leaves": "small" }, + "apply": { "model": "block/bamboo_small_leaves" } + }, + { "when": { "leaves": "large" }, + "apply": { "model": "block/bamboo_large_leaves" } + } + ] +} From 7d339291f03a41a6df41162c7270d93b1b7b5c29 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Fri, 19 Apr 2019 15:47:26 -0400 Subject: [PATCH 02/12] Change sign processing to the multiple sign types of 1.14 --- .../minecraft/blockstates/acacia_sign.json | 23 +++++++++++++ .../blockstates/acacia_wall_sign.json | 8 +++++ .../minecraft/blockstates/birch_sign.json | 23 +++++++++++++ .../blockstates/birch_wall_sign.json | 8 +++++ .../minecraft/blockstates/dark_oak_sign.json | 23 +++++++++++++ .../blockstates/dark_oak_wall_sign.json | 8 +++++ .../minecraft/blockstates/jungle_sign.json | 23 +++++++++++++ .../blockstates/jungle_wall_sign.json | 8 +++++ .../minecraft/blockstates/oak_sign.json | 23 +++++++++++++ .../minecraft/blockstates/oak_wall_sign.json | 8 +++++ .../minecraft/blockstates/sign.json | 23 ------------- .../minecraft/blockstates/spruce_sign.json | 23 +++++++++++++ .../blockstates/spruce_wall_sign.json | 8 +++++ .../minecraft/blockstates/wall_sign.json | 8 ----- .../minecraft/models/block/acacia_sign.json | 34 +++++++++++++++++++ .../models/block/acacia_wall_sign.json | 23 +++++++++++++ .../minecraft/models/block/birch_sign.json | 34 +++++++++++++++++++ .../models/block/birch_wall_sign.json | 23 +++++++++++++ .../minecraft/models/block/dark_oak_sign.json | 34 +++++++++++++++++++ .../models/block/dark_oak_wall_sign.json | 23 +++++++++++++ .../minecraft/models/block/jungle_sign.json | 34 +++++++++++++++++++ .../models/block/jungle_wall_sign.json | 23 +++++++++++++ .../models/block/{sign.json => oak_sign.json} | 10 +++--- .../{wall_sign.json => oak_wall_sign.json} | 10 +++--- .../minecraft/models/block/spruce_sign.json | 34 +++++++++++++++++++ .../models/block/spruce_wall_sign.json | 23 +++++++++++++ blockcrafter/mcmodel.py | 3 +- 27 files changed, 483 insertions(+), 42 deletions(-) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/birch_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json rename blockcrafter/custom_assets/minecraft/models/block/{sign.json => oak_sign.json} (79%) rename blockcrafter/custom_assets/minecraft/models/block/{wall_sign.json => oak_wall_sign.json} (68%) create mode 100644 blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json diff --git a/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json new file mode 100644 index 0000000..b5f0617 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/acacia_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/acacia_sign", "y": 0 }, + "rotation=1": { "model": "block/acacia_sign", "y": 22.5 }, + "rotation=2": { "model": "block/acacia_sign", "y": 45 }, + "rotation=3": { "model": "block/acacia_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/acacia_sign", "y": 90 }, + "rotation=5": { "model": "block/acacia_sign", "y": 112.5 }, + "rotation=6": { "model": "block/acacia_sign", "y": 135}, + "rotation=7": { "model": "block/acacia_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/acacia_sign", "y": 180 }, + "rotation=9": { "model": "block/acacia_sign", "y": 202.5 }, + "rotation=10": { "model": "block/acacia_sign", "y": 225 }, + "rotation=11": { "model": "block/acacia_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/acacia_sign", "y": 270 }, + "rotation=13": { "model": "block/acacia_sign", "y": 292.5 }, + "rotation=14": { "model": "block/acacia_sign", "y": 315 }, + "rotation=15": { "model": "block/acacia_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json new file mode 100644 index 0000000..feb2ed4 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/acacia_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/acacia_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/acacia_wall_sign", "y": 0 }, + "facing=east": { "model": "block/acacia_wall_sign", "y": 270 }, + "facing=west": { "model": "block/acacia_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json new file mode 100644 index 0000000..7f243fd --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/birch_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/birch_sign", "y": 0 }, + "rotation=1": { "model": "block/birch_sign", "y": 22.5 }, + "rotation=2": { "model": "block/birch_sign", "y": 45 }, + "rotation=3": { "model": "block/birch_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/birch_sign", "y": 90 }, + "rotation=5": { "model": "block/birch_sign", "y": 112.5 }, + "rotation=6": { "model": "block/birch_sign", "y": 135}, + "rotation=7": { "model": "block/birch_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/birch_sign", "y": 180 }, + "rotation=9": { "model": "block/birch_sign", "y": 202.5 }, + "rotation=10": { "model": "block/birch_sign", "y": 225 }, + "rotation=11": { "model": "block/birch_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/birch_sign", "y": 270 }, + "rotation=13": { "model": "block/birch_sign", "y": 292.5 }, + "rotation=14": { "model": "block/birch_sign", "y": 315 }, + "rotation=15": { "model": "block/birch_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json new file mode 100644 index 0000000..eb6ed4c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/birch_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/birch_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/birch_wall_sign", "y": 0 }, + "facing=east": { "model": "block/birch_wall_sign", "y": 270 }, + "facing=west": { "model": "block/birch_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json new file mode 100644 index 0000000..058913c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/dark_oak_sign", "y": 0 }, + "rotation=1": { "model": "block/dark_oak_sign", "y": 22.5 }, + "rotation=2": { "model": "block/dark_oak_sign", "y": 45 }, + "rotation=3": { "model": "block/dark_oak_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/dark_oak_sign", "y": 90 }, + "rotation=5": { "model": "block/dark_oak_sign", "y": 112.5 }, + "rotation=6": { "model": "block/dark_oak_sign", "y": 135}, + "rotation=7": { "model": "block/dark_oak_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/dark_oak_sign", "y": 180 }, + "rotation=9": { "model": "block/dark_oak_sign", "y": 202.5 }, + "rotation=10": { "model": "block/dark_oak_sign", "y": 225 }, + "rotation=11": { "model": "block/dark_oak_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/dark_oak_sign", "y": 270 }, + "rotation=13": { "model": "block/dark_oak_sign", "y": 292.5 }, + "rotation=14": { "model": "block/dark_oak_sign", "y": 315 }, + "rotation=15": { "model": "block/dark_oak_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json new file mode 100644 index 0000000..b97f012 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/dark_oak_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/dark_oak_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/dark_oak_wall_sign", "y": 0 }, + "facing=east": { "model": "block/dark_oak_wall_sign", "y": 270 }, + "facing=west": { "model": "block/dark_oak_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json new file mode 100644 index 0000000..8e91f45 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/jungle_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/jungle_sign", "y": 0 }, + "rotation=1": { "model": "block/jungle_sign", "y": 22.5 }, + "rotation=2": { "model": "block/jungle_sign", "y": 45 }, + "rotation=3": { "model": "block/jungle_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/jungle_sign", "y": 90 }, + "rotation=5": { "model": "block/jungle_sign", "y": 112.5 }, + "rotation=6": { "model": "block/jungle_sign", "y": 135}, + "rotation=7": { "model": "block/jungle_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/jungle_sign", "y": 180 }, + "rotation=9": { "model": "block/jungle_sign", "y": 202.5 }, + "rotation=10": { "model": "block/jungle_sign", "y": 225 }, + "rotation=11": { "model": "block/jungle_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/jungle_sign", "y": 270 }, + "rotation=13": { "model": "block/jungle_sign", "y": 292.5 }, + "rotation=14": { "model": "block/jungle_sign", "y": 315 }, + "rotation=15": { "model": "block/jungle_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json new file mode 100644 index 0000000..d8aaf3b --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/jungle_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/jungle_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/jungle_wall_sign", "y": 0 }, + "facing=east": { "model": "block/jungle_wall_sign", "y": 270 }, + "facing=west": { "model": "block/jungle_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json new file mode 100644 index 0000000..1d4b20e --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/oak_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/oak_sign", "y": 0 }, + "rotation=1": { "model": "block/oak_sign", "y": 22.5 }, + "rotation=2": { "model": "block/oak_sign", "y": 45 }, + "rotation=3": { "model": "block/oak_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/oak_sign", "y": 90 }, + "rotation=5": { "model": "block/oak_sign", "y": 112.5 }, + "rotation=6": { "model": "block/oak_sign", "y": 135}, + "rotation=7": { "model": "block/oak_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/oak_sign", "y": 180 }, + "rotation=9": { "model": "block/oak_sign", "y": 202.5 }, + "rotation=10": { "model": "block/oak_sign", "y": 225 }, + "rotation=11": { "model": "block/oak_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/oak_sign", "y": 270 }, + "rotation=13": { "model": "block/oak_sign", "y": 292.5 }, + "rotation=14": { "model": "block/oak_sign", "y": 315 }, + "rotation=15": { "model": "block/oak_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json new file mode 100644 index 0000000..4ec02cb --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/oak_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/oak_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/oak_wall_sign", "y": 0 }, + "facing=east": { "model": "block/oak_wall_sign", "y": 270 }, + "facing=west": { "model": "block/oak_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/sign.json b/blockcrafter/custom_assets/minecraft/blockstates/sign.json deleted file mode 100644 index bd6f94f..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/sign.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "variants": { - "rotation=0": { "model": "block/sign", "y": 0 }, - "rotation=1": { "model": "block/sign", "y": 22.5 }, - "rotation=2": { "model": "block/sign", "y": 45 }, - "rotation=3": { "model": "block/sign", "y": 67.5 }, - - "rotation=4": { "model": "block/sign", "y": 90 }, - "rotation=5": { "model": "block/sign", "y": 112.5 }, - "rotation=6": { "model": "block/sign", "y": 135}, - "rotation=7": { "model": "block/sign", "y": 157.5 }, - - "rotation=8": { "model": "block/sign", "y": 180 }, - "rotation=9": { "model": "block/sign", "y": 202.5 }, - "rotation=10": { "model": "block/sign", "y": 225 }, - "rotation=11": { "model": "block/sign", "y": 247.5 }, - - "rotation=12": { "model": "block/sign", "y": 270 }, - "rotation=13": { "model": "block/sign", "y": 292.5 }, - "rotation=14": { "model": "block/sign", "y": 315 }, - "rotation=15": { "model": "block/sign", "y": 337.5 } - } -} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json new file mode 100644 index 0000000..c648de2 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/spruce_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/spruce_sign", "y": 0 }, + "rotation=1": { "model": "block/spruce_sign", "y": 22.5 }, + "rotation=2": { "model": "block/spruce_sign", "y": 45 }, + "rotation=3": { "model": "block/spruce_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/spruce_sign", "y": 90 }, + "rotation=5": { "model": "block/spruce_sign", "y": 112.5 }, + "rotation=6": { "model": "block/spruce_sign", "y": 135}, + "rotation=7": { "model": "block/spruce_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/spruce_sign", "y": 180 }, + "rotation=9": { "model": "block/spruce_sign", "y": 202.5 }, + "rotation=10": { "model": "block/spruce_sign", "y": 225 }, + "rotation=11": { "model": "block/spruce_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/spruce_sign", "y": 270 }, + "rotation=13": { "model": "block/spruce_sign", "y": 292.5 }, + "rotation=14": { "model": "block/spruce_sign", "y": 315 }, + "rotation=15": { "model": "block/spruce_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json new file mode 100644 index 0000000..662c430 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/spruce_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/spruce_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/spruce_wall_sign", "y": 0 }, + "facing=east": { "model": "block/spruce_wall_sign", "y": 270 }, + "facing=west": { "model": "block/spruce_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json deleted file mode 100644 index e525f4f..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/wall_sign.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "variants": { - "facing=north": { "model": "block/wall_sign", "y" : 180 }, - "facing=south": { "model": "block/wall_sign", "y": 0 }, - "facing=east": { "model": "block/wall_sign", "y": 270 }, - "facing=west": { "model": "block/wall_sign", "y": 90 } - } -} diff --git a/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json b/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json new file mode 100644 index 0000000..99f3058 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/acacia_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/acacia/post", + "front": "entity/signs/acacia/front", + "back" : "entity/signs/acacia/back", + "side": "entity/signs/acacia/side", + "top": "entity/signs/acacia/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json new file mode 100644 index 0000000..9f948a5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/acacia_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/acacia/post", + "front": "entity/signs/acacia/front", + "back" : "entity/signs/acacia/back", + "side": "entity/signs/acacia/side", + "top": "entity/signs/acacia/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json b/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json new file mode 100644 index 0000000..3ec903f --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/birch_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/birch/post", + "front": "entity/signs/birch/front", + "back" : "entity/signs/birch/back", + "side": "entity/signs/birch/side", + "top": "entity/signs/birch/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json new file mode 100644 index 0000000..2289b3c --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/birch_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/birch/post", + "front": "entity/signs/birch/front", + "back" : "entity/signs/birch/back", + "side": "entity/signs/birch/side", + "top": "entity/signs/birch/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json new file mode 100644 index 0000000..6a2e507 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/dark_oak/post", + "front": "entity/signs/dark_oak/front", + "back" : "entity/signs/dark_oak/back", + "side": "entity/signs/dark_oak/side", + "top": "entity/signs/dark_oak/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json new file mode 100644 index 0000000..9286a9a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/dark_oak_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/dark_oak/post", + "front": "entity/signs/dark_oak/front", + "back" : "entity/signs/dark_oak/back", + "side": "entity/signs/dark_oak/side", + "top": "entity/signs/dark_oak/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json b/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json new file mode 100644 index 0000000..2188142 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/jungle_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/jungle/post", + "front": "entity/signs/jungle/front", + "back" : "entity/signs/jungle/back", + "side": "entity/signs/jungle/side", + "top": "entity/signs/jungle/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json new file mode 100644 index 0000000..67b91b3 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/jungle_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/jungle/post", + "front": "entity/signs/jungle/front", + "back" : "entity/signs/jungle/back", + "side": "entity/signs/jungle/side", + "top": "entity/signs/jungle/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/sign.json b/blockcrafter/custom_assets/minecraft/models/block/oak_sign.json similarity index 79% rename from blockcrafter/custom_assets/minecraft/models/block/sign.json rename to blockcrafter/custom_assets/minecraft/models/block/oak_sign.json index 83f18fa..cefb3b6 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/sign.json +++ b/blockcrafter/custom_assets/minecraft/models/block/oak_sign.json @@ -1,10 +1,10 @@ { "textures": { - "post": "entity/sign/post", - "front": "entity/sign/front", - "back" : "entity/sign/back", - "side": "entity/sign/side", - "top": "entity/sign/top" + "post": "entity/signs/oak/post", + "front": "entity/signs/oak/front", + "back" : "entity/signs/oak/back", + "side": "entity/signs/oak/side", + "top": "entity/signs/oak/top" }, "elements": [ { diff --git a/blockcrafter/custom_assets/minecraft/models/block/wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json similarity index 68% rename from blockcrafter/custom_assets/minecraft/models/block/wall_sign.json rename to blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json index 81e41e6..0b89c4e 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/wall_sign.json +++ b/blockcrafter/custom_assets/minecraft/models/block/oak_wall_sign.json @@ -1,10 +1,10 @@ { "textures": { - "post": "entity/sign/post", - "front": "entity/sign/front", - "back" : "entity/sign/back", - "side": "entity/sign/side", - "top": "entity/sign/top" + "post": "entity/signs/oak/post", + "front": "entity/signs/oak/front", + "back" : "entity/signs/oak/back", + "side": "entity/signs/oak/side", + "top": "entity/signs/oak/top" }, "elements": [ { diff --git a/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json b/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json new file mode 100644 index 0000000..8bda114 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/spruce_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/spruce/post", + "front": "entity/signs/spruce/front", + "back" : "entity/signs/spruce/back", + "side": "entity/signs/spruce/side", + "top": "entity/signs/spruce/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json new file mode 100644 index 0000000..d1a279a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/spruce_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/spruce/post", + "front": "entity/signs/spruce/front", + "back" : "entity/signs/spruce/back", + "side": "entity/signs/spruce/side", + "top": "entity/signs/spruce/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index 43d644c..7922fd8 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -296,7 +296,8 @@ def create_files(self, source): files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/ender.png")) files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_double.png")) files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_double.png")) - files.update(self.create_sign_files(source, "minecraft/textures/entity/sign.png")) + for path in source.glob_files("minecraft/textures/entity/signs/*.png"): + files.update(self.create_sign_files(source, path)) for path in source.glob_files("minecraft/textures/entity/shulker/shulker*.png"): files.update(self.create_shulker_files(source, path)) for path in source.glob_files("minecraft/textures/entity/bed/*.png"): From 8a7c2bd86a33737f2450b9d4cbe3f92e32bb067e Mon Sep 17 00:00:00 2001 From: mlavaire Date: Sat, 20 Apr 2019 23:00:14 -0400 Subject: [PATCH 03/12] Fixing composter level 0 --- .../minecraft/blockstates/composter.json | 31 +++++++++++++++++++ blockcrafter/mcmodel.py | 6 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/composter.json diff --git a/blockcrafter/custom_assets/minecraft/blockstates/composter.json b/blockcrafter/custom_assets/minecraft/blockstates/composter.json new file mode 100644 index 0000000..82152ba --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/composter.json @@ -0,0 +1,31 @@ +{ + "multipart": [ + { "apply": { "model": "block/composter" }}, + { "when": { "level": "0" } + }, + { "when": { "level": "1" }, + "apply": { "model": "block/composter_contents1" } + }, + { "when": { "level": "2" }, + "apply": { "model": "block/composter_contents2" } + }, + { "when": { "level": "3" }, + "apply": { "model": "block/composter_contents3" } + }, + { "when": { "level": "4" }, + "apply": { "model": "block/composter_contents4" } + }, + { "when": { "level": "5" }, + "apply": { "model": "block/composter_contents5" } + }, + { "when": { "level": "6" }, + "apply": { "model": "block/composter_contents6" } + }, + { "when": { "level": "7" }, + "apply": { "model": "block/composter_contents7" } + }, + { "when": { "level": "8" }, + "apply": { "model": "block/composter_contents_ready" } + } + ] +} diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index 7922fd8..c1097ad 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -460,10 +460,12 @@ def evaluate_variant(self, variant): when = part["when"] if len(when) == 1 and "OR" in when: if any(map(lambda c: is_condition_fulfilled(c, variant), when["OR"])): - modelrefs.append(part["apply"]) + if("apply" in part): + modelrefs.append(part["apply"]) else: if is_condition_fulfilled(when, variant): - modelrefs.append(part["apply"]) + if("apply" in part): + modelrefs.append(part["apply"]) else: assert False, "There must be variants defined!" From 108e25298b5a0365d3fa0ffaed4ccaa21aa50714 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Thu, 9 Jan 2020 14:22:50 -0500 Subject: [PATCH 04/12] Accomodate changes in 1.15 doublechest texture mapping --- .../models/block/base_chest_left.json | 2 +- .../models/block/base_chest_right.json | 2 +- .../minecraft/models/block/chest_left.json | 2 +- .../minecraft/models/block/chest_right.json | 2 +- .../models/block/trapped_chest_left.json | 2 +- .../models/block/trapped_chest_right.json | 2 +- blockcrafter/mcmodel.py | 71 +++++++++++-------- 7 files changed, 47 insertions(+), 36 deletions(-) diff --git a/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json index 263a3a1..d94978c 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/base_chest_left.json @@ -6,7 +6,7 @@ "to": [ 16, 14, 15 ], "faces": { "up" : { "texture": "#top" }, - "north": { "texture": "#right_back" }, + "north": { "texture": "#back" }, "south": { "texture": "#front" }, "west": { "texture": "#side" } } diff --git a/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json index 65f5d9f..87c3d5a 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/base_chest_right.json @@ -6,7 +6,7 @@ "to": [ 15, 14, 15 ], "faces": { "up" : { "texture": "#top" }, - "north": { "texture": "#left_back" }, + "north": { "texture": "#back" }, "south": { "texture": "#front" }, "east": { "texture": "#side" } } diff --git a/blockcrafter/custom_assets/minecraft/models/block/chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/chest_left.json index ecc43be..420462d 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/chest_left.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/normal_double/left_front", "side": "entity/chest/normal_double/side", - "right_back": "entity/chest/normal_double/right_back", + "back": "entity/chest/normal_double/left_back", "top": "entity/chest/normal_double/left_top", "thing_front": "entity/chest/normal_double/thing_front", "thing_side": "entity/chest/normal_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/chest_right.json index 0abf2e7..9a28957 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/chest_right.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/normal_double/right_front", "side": "entity/chest/normal_double/side", - "left_back": "entity/chest/normal_double/left_back", + "back": "entity/chest/normal_double/right_back", "top": "entity/chest/normal_double/right_top", "thing_front": "entity/chest/normal_double/thing_front", "thing_side": "entity/chest/normal_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json index 0ecd335..ac0b00d 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json +++ b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_left.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/trapped_double/left_front", "side": "entity/chest/trapped_double/side", - "right_back": "entity/chest/trapped_double/right_back", + "back": "entity/chest/trapped_double/left_back", "top": "entity/chest/trapped_double/left_top", "thing_front": "entity/chest/trapped_double/thing_front", "thing_side": "entity/chest/trapped_double/thing_side", diff --git a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json index 5bcf4b7..ef57040 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json +++ b/blockcrafter/custom_assets/minecraft/models/block/trapped_chest_right.json @@ -3,7 +3,7 @@ "textures": { "front": "entity/chest/trapped_double/right_front", "side": "entity/chest/trapped_double/side", - "left_back": "entity/chest/trapped_double/left_back", + "back": "entity/chest/trapped_double/right_back", "top": "entity/chest/trapped_double/right_top", "thing_front": "entity/chest/trapped_double/thing_front", "thing_side": "entity/chest/trapped_double/thing_side", diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index c1097ad..ad2e7bb 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -186,40 +186,51 @@ def create_chest_files(self, source, path): assert w == h f = w / 64 - front = image.crop((int(f * 14), int(f * 14), int(f * 28), int(f * 28))) - front.paste(image.crop((int(f * 14), int(f * 33), int(f * 28), int(f * (33+14)))), (int(f * 0), int(f * 5))) - side = image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 28))) - side.paste(image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+14)))), (int(f * 0), int(f * 5))) + front = image.crop((int(f * 42), int(f * 33), int(f * 56), int(f * (33+15)))) + front.paste(image.crop((int(f * 42), int(f * 14), int(f * 56), int(f * 19))), (int(f * 0), int(f * 10))) + front = front.transpose(Image.FLIP_TOP_BOTTOM) + side = image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+15)))) + side.paste(image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 19))), (int(f * 0), int(f * 10))) + side = side.transpose(Image.FLIP_TOP_BOTTOM) files = {} files[base_name + "front.png"] = pack_image(front) files[base_name + "side.png"] = pack_image(side) - files[base_name + "top.png"] = pack_image(image.crop((int(f * 14), int(f * 0), int(f * 28), int(f * 14)))) + files[base_name + "top.png"] = pack_image(image.crop((int(f * 28), int(f * 0), int(f * 42), int(f * 14)))) files[base_name + "thing_front.png"] = pack_image(image.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) files[base_name + "thing_side.png"] = pack_image(image.crop((int(f * 0), int(f * 1), int(f * 1), int(f * 5)))) files[base_name + "thing_top.png"] = pack_image(image.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) return files - def create_double_chest_files(self, source, path): - base_name = path.replace(".png", "/") - if len(source.glob_files(path)) == 0: + def create_double_chest_files(self, source, path_left, path_right): + base_name = path_left.replace("_left.png", "_double/") + if len(source.glob_files(path_left)) == 0 or len(source.glob_files(path_right)) == 0: return {} - image = Image.open(source.open_file(path)).convert("RGBA") - w, h = image.size - assert w == h * 2 - f = w / 128 - - left_front = image.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 28))) - left_front.paste(image.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+14)))), (int(f * 0), int(f * 5))) - right_front = image.crop((int(f * 29), int(f * 14), int(f * 44), int(f * 28))) - right_front.paste(image.crop((int(f * 29), int(f * 33), int(f * 44), int(f * (33+14)))), (int(f * 0), int(f * 5))) - side = image.crop((int(f * 0), int(f * 14), int(f * 14), int(f * 28))) - side.paste(image.crop((int(f * 0), int(f * 33), int(f * 14), int(f * (33+14)))), (int(f * 0), int(f * 5))) - left_back = image.crop((int(f * 58), int(f * 14), int(f * 73), int(f * 28))) - left_back.paste(image.crop((int(f * 58), int(f * 33), int(f * 73), int(f * (33+14)))), (int(f * 0), int(f * 5))) - right_back = image.crop((int(f * 73), int(f * 14), int(f * 88), int(f * 28))) - right_back.paste(image.crop((int(f * 73), int(f * 33), int(f * 88), int(f * (33+14)))), (int(f * 0), int(f * 5))) + image_left = Image.open(source.open_file(path_left)).convert("RGBA") + image_right = Image.open(source.open_file(path_right)).convert("RGBA") + wl, hl = image_left.size + wr, hr = image_right.size + assert wl == hl + assert wr == hr + assert wl == wr + f = wl / 64 + + left_front = image_left.crop((int(f * 43), int(f * 33), int(f * 58), int(f * (33+15)))) + left_front.paste(image_left.crop((int(f * 43), int(f * 14), int(f * 58), int(f * 19))), (int(f * 0), int(f * 10))) + left_front = left_front.transpose(Image.FLIP_TOP_BOTTOM) + right_front = image_right.crop((int(f * 43), int(f * 33), int(f * 58), int(f * (33+15)))) + right_front.paste(image_right.crop((int(f * 43), int(f * 14), int(f * 58), int(f * 19))), (int(f * 0), int(f * 10))) + right_front = right_front.transpose(Image.FLIP_TOP_BOTTOM) + side = image_left.crop((int(f * 29), int(f * 33), int(f * 43), int(f * (33+15)))) + side.paste(image_left.crop((int(f * 29), int(f * 14), int(f * 43), int(f * 19))), (int(f * 0), int(f * 10))) + side = side.transpose(Image.FLIP_TOP_BOTTOM) + left_back = image_left.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+15)))) + left_back.paste(image_left.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 19))), (int(f * 0), int(f * 10))) + left_back = left_back.transpose(Image.FLIP_TOP_BOTTOM) + right_back = image_right.crop((int(f * 14), int(f * 33), int(f * 29), int(f * (33+15)))) + right_back.paste(image_right.crop((int(f * 14), int(f * 14), int(f * 29), int(f * 19))), (int(f * 0), int(f * 10))) + right_back = right_back.transpose(Image.FLIP_TOP_BOTTOM) files = {} files[base_name + "left_front.png"] = pack_image(left_front) @@ -227,11 +238,11 @@ def create_double_chest_files(self, source, path): files[base_name + "side.png"] = pack_image(side) files[base_name + "left_back.png"] = pack_image(left_back) files[base_name + "right_back.png"] = pack_image(right_back) - files[base_name + "left_top.png"] = pack_image(image.crop((int(f * 14), int(f * 0), int(f * 29), int(f * 14)))) - files[base_name + "right_top.png"] = pack_image(image.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14)))) - files[base_name + "thing_front.png"] = pack_image(image.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) - files[base_name + "thing_side.png"] = pack_image(image.crop((int(f * 0), int(f * 1), int(f * 1), int(f * 5)))) - files[base_name + "thing_top.png"] = pack_image(image.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) + files[base_name + "left_top.png"] = pack_image(image_left.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14))).transpose(Image.FLIP_LEFT_RIGHT)) + files[base_name + "right_top.png"] = pack_image(image_right.crop((int(f * 29), int(f * 0), int(f * 44), int(f * 14))).transpose(Image.FLIP_LEFT_RIGHT)) + files[base_name + "thing_front.png"] = pack_image(image_left.crop((int(f * 1), int(f * 1), int(f * 3), int(f * 5)))) + files[base_name + "thing_side.png"] = pack_image(image_left.crop((int(f * 3), int(f * 1), int(f * 4), int(f * 5)))) + files[base_name + "thing_top.png"] = pack_image(image_left.crop((int(f * 1), int(f * 0), int(f * 3), int(f * 1)))) return files def create_sign_files(self, source, path): @@ -294,8 +305,8 @@ def create_files(self, source): files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/normal.png")) files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/trapped.png")) files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/ender.png")) - files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_double.png")) - files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_double.png")) + files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_left.png", "minecraft/textures/entity/chest/normal_right.png")) + files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_left.png", "minecraft/textures/entity/chest/trapped_right.png")) for path in source.glob_files("minecraft/textures/entity/signs/*.png"): files.update(self.create_sign_files(source, path)) for path in source.glob_files("minecraft/textures/entity/shulker/shulker*.png"): From a5015a2f91b5f0f30ba8a101435b659e51c740e2 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Mon, 24 Feb 2020 10:40:36 -0500 Subject: [PATCH 05/12] Adding Bell rendering Previously only the support was rendered, now the bell is displayed too --- .../minecraft/blockstates/bell.json | 24 +++++++++++ .../minecraft/models/block/simple_bell.json | 42 +++++++++++++++++++ blockcrafter/mcmodel.py | 23 ++++++++++ 3 files changed, 89 insertions(+) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/bell.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/simple_bell.json diff --git a/blockcrafter/custom_assets/minecraft/blockstates/bell.json b/blockcrafter/custom_assets/minecraft/blockstates/bell.json new file mode 100644 index 0000000..2131c24 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/bell.json @@ -0,0 +1,24 @@ +{ + "variants": { + "facing=north,attachment=floor": { "model": "block/bell_floor" }, + "facing=south,attachment=floor": { "model": "block/bell_floor", "y": 180 }, + "facing=east,attachment=floor": { "model": "block/bell_floor", "y": 90 }, + "facing=west,attachment=floor": { "model": "block/bell_floor", "y": 270 }, + "facing=north,attachment=ceiling": { "model": "block/bell_ceiling" }, + "facing=south,attachment=ceiling": { "model": "block/bell_ceiling", "y": 180 }, + "facing=east,attachment=ceiling": { "model": "block/bell_ceiling", "y": 90 }, + "facing=west,attachment=ceiling": { "model": "block/bell_ceiling", "y": 270 }, + "facing=east,attachment=single_wall": { "model": "block/bell_wall" }, + "facing=west,attachment=single_wall": { "model": "block/bell_wall", "y": 180 }, + "facing=south,attachment=single_wall": { "model": "block/bell_wall", "y": 90 }, + "facing=north,attachment=single_wall": { "model": "block/bell_wall", "y": 270 }, + "facing=east,attachment=double_wall": { "model": "block/bell_between_walls" }, + "facing=west,attachment=double_wall": { "model": "block/bell_between_walls", "y": 180 }, + "facing=north,attachment=double_wall": { "model": "block/bell_between_walls", "y": 90 }, + "facing=south,attachment=double_wall": { "model": "block/bell_between_walls", "y": 270 }, + "facing=north" : { "model" : "block/simple_bell", "y": 180 }, + "facing=south" : { "model" : "block/simple_bell", "y": 0 }, + "facing=east" : { "model" : "block/simple_bell", "y": 270 }, + "facing=west" : { "model" : "block/simple_bell", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json b/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json new file mode 100644 index 0000000..6413993 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/simple_bell.json @@ -0,0 +1,42 @@ +{ + "elements": [ + { + "comment": "bell-middle", + "from": [ 5, 5, 5 ], + "to": [ 11, 13, 11 ], + "faces": { + "up": { "texture": "#top-middle" }, + "north": { "texture": "#front-middle" }, + "south": { "texture": "#back-middle" }, + "east": { "texture": "#east-middle" }, + "west": { "texture": "#west-middle" } + } + }, + { + "comment": "bell-bottom", + "from": [ 4, 3, 4 ], + "to": [ 12, 5, 12 ], + "faces": { + "up": { "texture": "#top-bottom" }, + "north": { "texture": "#front-bottom" }, + "south": { "texture": "#back-bottom" }, + "east": { "texture": "#east-bottom" }, + "west": { "texture": "#west-bottom" } + } + } + ], + "textures": { + "front-middle": "entity/bell/bell_body/front", + "east-middle": "entity/bell/bell_body/east", + "back-middle": "entity/bell/bell_body/back", + "west-middle": "entity/bell/bell_body/west", + "side-middle": "entity/bell/bell_body/side", + "top-middle": "entity/bell/bell_body/top", + "front-bottom": "entity/bell/bell_body/low_front", + "east-bottom": "entity/bell/bell_body/low_east", + "back-bottom": "entity/bell/bell_body/low_back", + "west-bottom": "entity/bell/bell_body/low_west", + "side-bottom": "entity/bell/bell_body/low_side", + "top-bottom": "entity/bell/bell_body/low_top" + } +} \ No newline at end of file diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index ad2e7bb..827aaa4 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -262,6 +262,28 @@ def create_sign_files(self, source, path): files[base_name + "post.png"] = pack_image(image.crop((int(f * 2), int(f * 16), int(f * 4), int(f * 30)))) return files + def create_bell_files(self, source, path): + base_name = path.replace(".png", "/") + if len(source.glob_files(path)) == 0: + return {} + image = Image.open(source.open_file(path)).convert("RGBA") + w, h = image.size + assert w == h + f = w / 32 + + files = {} + files[base_name + "front.png"] = pack_image(image.crop((int(f * 0), int(f * 6), int(f * 6), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "east.png"] = pack_image(image.crop((int(f * 6), int(f * 6), int(f * 12), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "back.png"] = pack_image(image.crop((int(f * 12), int(f * 6), int(f * 18), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "west.png"] = pack_image(image.crop((int(f * 18), int(f * 6), int(f * 24), int(f * 13))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "top.png"] = pack_image(image.crop((int(f * 6), int(f * 0), int(f * 12), int(f * 6)))) + files[base_name + "low_front.png"] = pack_image(image.crop((int(f * 0), int(f * 21), int(f * 8), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_east.png"] = pack_image(image.crop((int(f * 8), int(f * 21), int(f * 16), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_back.png"] = pack_image(image.crop((int(f * 16), int(f * 21), int(f * 24), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_west.png"] = pack_image(image.crop((int(f * 24), int(f * 21), int(f * 32), int(f * 23))).transpose(Image.FLIP_TOP_BOTTOM)) + files[base_name + "low_top.png"] = pack_image(image.crop((int(f * 8), int(f * 13), int(f * 16), int(f * 21)))) + return files + def create_shulker_files(self, source, path): base_name = path.replace(".png", "/") if len(source.glob_files(path)) == 0: @@ -307,6 +329,7 @@ def create_files(self, source): files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/ender.png")) files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_left.png", "minecraft/textures/entity/chest/normal_right.png")) files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_left.png", "minecraft/textures/entity/chest/trapped_right.png")) + files.update(self.create_bell_files(source, "minecraft/textures/entity/bell/bell_body.png")) for path in source.glob_files("minecraft/textures/entity/signs/*.png"): files.update(self.create_sign_files(source, path)) for path in source.glob_files("minecraft/textures/entity/shulker/shulker*.png"): From cc29627c06784c3dc46b2a258960990d14385a67 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Sun, 28 Jun 2020 10:57:37 -0400 Subject: [PATCH 06/12] 1,16 update to assets - namespace have been added in some files, and should be removed to furthur process the asset - Walls have now new properties that must be explicitly set. --- .../minecraft/blockstates/andesite_wall.json | 110 ++++++++++++++++++ .../blockstates/blackstone_wall.json | 110 ++++++++++++++++++ .../minecraft/blockstates/brick_wall.json | 110 ++++++++++++++++++ .../blockstates/cobblestone_wall.json | 110 ++++++++++++++++++ .../minecraft/blockstates/diorite_wall.json | 110 ++++++++++++++++++ .../blockstates/end_stone_brick_wall.json | 110 ++++++++++++++++++ .../minecraft/blockstates/granite_wall.json | 110 ++++++++++++++++++ .../blockstates/mossy_cobblestone_wall.json | 110 ++++++++++++++++++ .../blockstates/mossy_stone_brick_wall.json | 110 ++++++++++++++++++ .../blockstates/nether_brick_wall.json | 110 ++++++++++++++++++ .../polished_blackstone_brick_wall.json | 110 ++++++++++++++++++ .../blockstates/polished_blackstone_wall.json | 110 ++++++++++++++++++ .../blockstates/prismarine_wall.json | 110 ++++++++++++++++++ .../blockstates/red_nether_brick_wall.json | 110 ++++++++++++++++++ .../blockstates/red_sandstone_wall.json | 110 ++++++++++++++++++ .../minecraft/blockstates/sandstone_wall.json | 110 ++++++++++++++++++ .../blockstates/stone_brick_wall.json | 110 ++++++++++++++++++ blockcrafter/mcmodel.py | 33 ++++-- 18 files changed, 1896 insertions(+), 7 deletions(-) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json diff --git a/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json new file mode 100644 index 0000000..13e3394 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/andesite_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/andesite_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json new file mode 100644 index 0000000..826884e --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/blackstone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json new file mode 100644 index 0000000..fa989bc --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json new file mode 100644 index 0000000..216ab1a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/cobblestone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json new file mode 100644 index 0000000..40b1c86 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/diorite_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/diorite_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json new file mode 100644 index 0000000..7c9c1e9 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/end_stone_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json new file mode 100644 index 0000000..85cdc9b --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/granite_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/granite_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/granite_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/granite_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/granite_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/granite_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/granite_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/granite_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/granite_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json new file mode 100644 index 0000000..3af060b --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_cobblestone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json new file mode 100644 index 0000000..ec6db86 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/mossy_stone_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json new file mode 100644 index 0000000..d6636f5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/nether_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json new file mode 100644 index 0000000..2a63b0a --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json new file mode 100644 index 0000000..d37b1ae --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/polished_blackstone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json new file mode 100644 index 0000000..d0213e5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/prismarine_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json new file mode 100644 index 0000000..76b7088 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/red_nether_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json new file mode 100644 index 0000000..edba9a6 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/red_sandstone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json new file mode 100644 index 0000000..0ca1f69 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/sandstone_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json new file mode 100644 index 0000000..798d8f9 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json @@ -0,0 +1,110 @@ +{ + "multipart": [ + { + "when": { + "east": "none" + } + }, + { + "when": { + "west": "none" + } + }, + { + "when": { + "north": "none" + } + }, + { + "when": { + "south": "none" + } + }, + { + "when": { + "up": "true" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_post" + } + }, + { + "when": { + "north": "low" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side", + "uvlock": true + } + }, + { + "when": { + "east": "low" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "low" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "low" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side", + "y": 270, + "uvlock": true + } + }, + { + "when": { + "north": "tall" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side_tall", + "uvlock": true + } + }, + { + "when": { + "east": "tall" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side_tall", + "y": 90, + "uvlock": true + } + }, + { + "when": { + "south": "tall" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side_tall", + "y": 180, + "uvlock": true + } + }, + { + "when": { + "west": "tall" + }, + "apply": { + "model": "minecraft:block/stone_brick_wall_side_tall", + "y": 270, + "uvlock": true + } + } + ] +} \ No newline at end of file diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index 827aaa4..53b1a97 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -355,6 +355,9 @@ def load_file(self, path): return data class Assets: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, source): self.source = source @@ -409,7 +412,11 @@ def _get_model_json(self, path): if "parent" in m: prefix = path.split("/")[0] - parent = self._get_model_json(self.model_base.format(prefix=prefix) + "/" + m["parent"] + ".json") + parent_model = m["parent"] + # The model can have the minecraft: namespace in it since 1.16 + if parent_model.startswith(self.MINECRAFT_NAMESPACE): + parent_model = parent_model[len(self.MINECRAFT_NAMESPACE):] + parent = self._get_model_json(self.model_base.format(prefix=prefix) + "/" + parent_model + ".json") textures.update(parent["textures"]) if "elements" in parent: elements = parent["elements"] @@ -449,6 +456,9 @@ def load_texture(self, prefix, path): return self.source.open_file(self.texture_base.format(prefix=prefix) + "/" + path, mode="rb") class Blockstate: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, assets, prefix, name, data, properties={}): self.assets = assets self.prefix = prefix @@ -509,6 +519,9 @@ def evaluate_variant(self, variant): if isinstance(modelref, list): modelref = modelref[0] model_name = modelref["model"] + # The model can have the minecraft: namespace in it since 1.16 + if model_name.startswith(self.MINECRAFT_NAMESPACE): + model_name = model_name[len(self.MINECRAFT_NAMESPACE):] model_transformation = dict(modelref) del model_transformation["model"] model = self.assets.get_model(self.prefix + "/models/" + model_name + ".json") @@ -575,6 +588,9 @@ def __repr__(self): return "" % (self.prefix, self.name) class Model: + + MINECRAFT_NAMESPACE = "minecraft:" + def __init__(self, assets, prefix, name, data): self.assets = assets self.prefix = prefix @@ -590,12 +606,15 @@ def elements(self): return self.data["elements"] def resolve_texture(self, texture): - if not texture.startswith("#"): - return texture - name = texture[1:] - if not name in self.textures: - return None - return self.resolve_texture(self.textures[name]) + if texture.startswith("#"): + name = texture[1:] + if not name in self.textures: + return None + texture = self.resolve_texture(self.textures[name]) + # The data can have the minecraft: namespace in it since 1.16 + if texture != None and texture.startswith(self.MINECRAFT_NAMESPACE): + texture = texture[len(self.MINECRAFT_NAMESPACE):] + return texture def load_texture(self, name): return self.assets.load_texture(self.prefix, name + ".png") From 5ad74ecafff25b67b38b9ec2c2b52825b7d3095a Mon Sep 17 00:00:00 2001 From: Bart Kuivenhoven Date: Fri, 10 Jul 2020 14:41:48 +0200 Subject: [PATCH 07/12] Fix biome colouring for stem blocks This issue solves the green tints on: * mushroom stems * warped stems * stripped warped stems * crimson stems * stripped crimson stems --- blockcrafter/blockstates.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index cf8dabf..f2f8b4c 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -14,7 +14,8 @@ minecraft:grass biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:tall_grass biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:fern biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:large_fern biome_type=simple,biome_colors=grass,biome_colormap=grass -minecraft:*_stem biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:*melon_stem biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:*pumpkin_stem biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:redstone_wire biome_type=simple,biome_colors=grass,biome_colormap=#ff0000c0|#ff0000c0|#ff0000c0 minecraft:seagrass is_waterloggable=true,inherently_waterlogged=true From 11f5aa994d8b9b25b2f7ea3c680e0feae3d98ec0 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Fri, 4 Dec 2020 13:12:30 -0500 Subject: [PATCH 08/12] Cleanner glass, crispier textures and missing signs and conduit --- .gitignore | 1 + Dockerfile | 8 +++-- blockcrafter/blockstates.properties | 22 ++++++++++-- .../minecraft/blockstates/conduit.json | 5 +++ .../minecraft/blockstates/crimson_sign.json | 23 +++++++++++++ .../blockstates/crimson_wall_sign.json | 8 +++++ .../minecraft/blockstates/full_water.json | 24 +++++++++++-- .../minecraft/blockstates/warped_sign.json | 23 +++++++++++++ .../blockstates/warped_wall_sign.json | 8 +++++ .../minecraft/models/block/conduit.json | 24 +++++++++++++ .../minecraft/models/block/crimson_sign.json | 34 +++++++++++++++++++ .../models/block/crimson_wall_sign.json | 23 +++++++++++++ .../models/block/full_water_south_up.json | 15 ++++++++ .../minecraft/models/block/full_water_up.json | 2 +- .../models/block/full_water_west_up.json | 15 ++++++++ .../minecraft/models/block/warped_sign.json | 34 +++++++++++++++++++ .../models/block/warped_wall_sign.json | 23 +++++++++++++ .../minecraft/models/block/waterlog.json | 2 +- blockcrafter/export.py | 8 +++-- blockcrafter/mcmodel.py | 21 ++++++++++++ blockcrafter/render.py | 20 +++++++++-- fractions.patch | 8 +++++ setup.py | 2 +- 23 files changed, 338 insertions(+), 15 deletions(-) create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/conduit.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/conduit.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/warped_sign.json create mode 100644 blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json create mode 100644 fractions.patch diff --git a/.gitignore b/.gitignore index 894a44c..bd7eb45 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ venv.bak/ # mypy .mypy_cache/ +/.vscode/launch.json diff --git a/Dockerfile b/Dockerfile index 3f3df1c..f9a490b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ -FROM python:3-alpine +FROM python:alpine3.12 -RUN apk --no-cache add git mesa-osmesa mesa-gles gcc gfortran python-dev build-base wget freetype-dev fontconfig-dev libpng-dev libjpeg-turbo-dev openblas-dev && pip install numpy vispy Pillow +RUN apk --no-cache add git py3-pip mesa-osmesa mesa-gles gcc gfortran python3-dev build-base wget freetype-dev fontconfig-dev libpng-dev libjpeg-turbo-dev openblas-dev +RUN pip3 install -U scikit-build make +RUN pip3 install numpy==1.17.5 +RUN pip3 install Pillow==6.2.2 +RUN pip3 install vispy==0.5.3 COPY . /blockcrafter RUN cd /blockcrafter && pip wheel . diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index f2f8b4c..c10d0e8 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -113,6 +113,7 @@ minecraft:*_trapdoor is_waterloggable=true #minecraft:tube_coral_fan is_waterloggable=true minecraft:*_coral is_waterloggable=true minecraft:*_coral_fan is_waterloggable=true +minecraft:*_coral_wall_fan is_waterloggable=true #minecraft:chest is_waterloggable=true #minecraft:ender_chest is_waterloggable=true @@ -124,11 +125,10 @@ minecraft:*shulker_box is_waterloggable=true minecraft:iron_bars is_waterloggable=true minecraft:iron_trapdoor is_waterloggable=true minecraft:ladder is_waterloggable=true -minecraft:cobblestone_wall is_waterloggable=true -minecraft:mossy_cobblestone_wall is_waterloggable=true +minecraft:*_wall is_waterloggable=true minecraft:nether_brick_fence is_waterloggable=true minecraft:sea_pickle is_waterloggable=true -minecraft:conduit is_waterloggable=true +minecraft:conduit is_waterloggable=true,disable_culling=true minecraft:farmland faulty_lighting=true minecraft:anvil faulty_lighting=true @@ -144,6 +144,22 @@ minecraft:flowing_water lighting_type=smooth,biome_type=simple,biome_colors=wate minecraft:full_water lighting_type=smooth,biome_type=simple,biome_colors=water minecraft:waterlog lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 +minecraft:water_cauldron lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 + +minecraft:sculk_sensor is_waterloggable=true +minecraft:*candle is_waterloggable=true +minecraft:*amethyst_bud is_waterloggable=true +minecraft:amethyst_cluster is_waterloggable=true +minecraft:*_dripstone is_waterloggable=true +minecraft:*rail is_waterloggable=true +minecraft:*campfire is_waterloggable=true +minecraft:scaffolding is_waterloggable=true +minecraft:*lantern is_waterloggable=true + +# minecraft:ice disable_blending=true +# minecraft:respawn_anchor disable_blending=true +# minecraft:honey_block disable_blending=true + minecraft:snow shadow_edges=1 minecraft:*_leaves shadow_edges=5 minecraft:full_water shadow_edges=1 diff --git a/blockcrafter/custom_assets/minecraft/blockstates/conduit.json b/blockcrafter/custom_assets/minecraft/blockstates/conduit.json new file mode 100644 index 0000000..1dae143 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/conduit.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "block/conduit" } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json new file mode 100644 index 0000000..3f295e0 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/crimson_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/crimson_sign", "y": 0 }, + "rotation=1": { "model": "block/crimson_sign", "y": 22.5 }, + "rotation=2": { "model": "block/crimson_sign", "y": 45 }, + "rotation=3": { "model": "block/crimson_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/crimson_sign", "y": 90 }, + "rotation=5": { "model": "block/crimson_sign", "y": 112.5 }, + "rotation=6": { "model": "block/crimson_sign", "y": 135}, + "rotation=7": { "model": "block/crimson_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/crimson_sign", "y": 180 }, + "rotation=9": { "model": "block/crimson_sign", "y": 202.5 }, + "rotation=10": { "model": "block/crimson_sign", "y": 225 }, + "rotation=11": { "model": "block/crimson_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/crimson_sign", "y": 270 }, + "rotation=13": { "model": "block/crimson_sign", "y": 292.5 }, + "rotation=14": { "model": "block/crimson_sign", "y": 315 }, + "rotation=15": { "model": "block/crimson_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json new file mode 100644 index 0000000..f5b20f5 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/crimson_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/crimson_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/crimson_wall_sign", "y": 0 }, + "facing=east": { "model": "block/crimson_wall_sign", "y": 270 }, + "facing=west": { "model": "block/crimson_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/full_water.json b/blockcrafter/custom_assets/minecraft/blockstates/full_water.json index c854ad6..d0cbaf6 100644 --- a/blockcrafter/custom_assets/minecraft/blockstates/full_water.json +++ b/blockcrafter/custom_assets/minecraft/blockstates/full_water.json @@ -4,13 +4,33 @@ "apply" : { "model" : "block/full_water_up" }, "when" : { "up" : "false" } }, + { + "apply" : { "model" : "block/full_water_south_up" }, + "when": { + "up": "false", + "south": "false" + } + }, { "apply" : { "model" : "block/full_water_south" }, - "when" : { "south" : "false" } + "when": { + "up": "true", + "south": "false" + } + }, + { + "apply" : { "model" : "block/full_water_west_up" }, + "when": { + "up": "false", + "west": "false" + } }, { "apply" : { "model" : "block/full_water_west" }, - "when" : { "west" : "false" } + "when": { + "up": "true", + "west": "false" + } } ] } diff --git a/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json new file mode 100644 index 0000000..43ded60 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/warped_sign.json @@ -0,0 +1,23 @@ +{ + "variants": { + "rotation=0": { "model": "block/warped_sign", "y": 0 }, + "rotation=1": { "model": "block/warped_sign", "y": 22.5 }, + "rotation=2": { "model": "block/warped_sign", "y": 45 }, + "rotation=3": { "model": "block/warped_sign", "y": 67.5 }, + + "rotation=4": { "model": "block/warped_sign", "y": 90 }, + "rotation=5": { "model": "block/warped_sign", "y": 112.5 }, + "rotation=6": { "model": "block/warped_sign", "y": 135}, + "rotation=7": { "model": "block/warped_sign", "y": 157.5 }, + + "rotation=8": { "model": "block/warped_sign", "y": 180 }, + "rotation=9": { "model": "block/warped_sign", "y": 202.5 }, + "rotation=10": { "model": "block/warped_sign", "y": 225 }, + "rotation=11": { "model": "block/warped_sign", "y": 247.5 }, + + "rotation=12": { "model": "block/warped_sign", "y": 270 }, + "rotation=13": { "model": "block/warped_sign", "y": 292.5 }, + "rotation=14": { "model": "block/warped_sign", "y": 315 }, + "rotation=15": { "model": "block/warped_sign", "y": 337.5 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json b/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json new file mode 100644 index 0000000..b1e3e37 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/blockstates/warped_wall_sign.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=north": { "model": "block/warped_wall_sign", "y" : 180 }, + "facing=south": { "model": "block/warped_wall_sign", "y": 0 }, + "facing=east": { "model": "block/warped_wall_sign", "y": 270 }, + "facing=west": { "model": "block/warped_wall_sign", "y": 90 } + } +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/conduit.json b/blockcrafter/custom_assets/minecraft/models/block/conduit.json new file mode 100644 index 0000000..0ec1071 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/conduit.json @@ -0,0 +1,24 @@ +{ + "elements": [ + { + "from": [ 4, 4, 4 ], + "to": [ 11, 11, 11 ], + "faces": { + "up" : { "texture": "#up" }, + "down": { "texture": "#down"}, + "north": { "texture": "#north" }, + "south": { "texture": "#south" }, + "east": { "texture": "#east" }, + "west": { "texture": "#west" } + } + } + ], + "textures": { + "up": "entity/conduit/cage/up", + "down": "entity/conduit/cage/down", + "north": "entity/conduit/cage/north", + "south": "entity/conduit/cage/south", + "east": "entity/conduit/cage/east", + "west": "entity/conduit/cage/west" + } +} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json b/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json new file mode 100644 index 0000000..5cd44e2 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/crimson_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/crimson/post", + "front": "entity/signs/crimson/front", + "back" : "entity/signs/crimson/back", + "side": "entity/signs/crimson/side", + "top": "entity/signs/crimson/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json new file mode 100644 index 0000000..c7dff45 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/crimson_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/crimson/post", + "front": "entity/signs/crimson/front", + "back" : "entity/signs/crimson/back", + "side": "entity/signs/crimson/side", + "top": "entity/signs/crimson/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json new file mode 100644 index 0000000..c75b720 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json @@ -0,0 +1,15 @@ +{ + "parent": "block/water", + "textures": { + "water" : "block/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "south": { "uv" : [0, 6, 16, 16], "texture": "#water", "cullface": "south" } + } + } + ] +} + diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json index ca47068..5f1b711 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json @@ -5,7 +5,7 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "to": [ 16, 10, 16 ], "faces": { "up": { "texture": "#water", "cullface": "up"} } diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json new file mode 100644 index 0000000..f5773f8 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json @@ -0,0 +1,15 @@ +{ + "parent": "block/water", + "textures": { + "water" : "block/water_still" + }, + "elements": [ + { "from": [ 0, 0, 0 ], + "to": [ 16, 10, 16 ], + "faces": { + "west": { "uv" : [0, 6, 16, 16], "texture": "#water", "cullface": "west" } + } + } + ] +} + diff --git a/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json b/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json new file mode 100644 index 0000000..1395f78 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/warped_sign.json @@ -0,0 +1,34 @@ +{ + "textures": { + "post": "entity/signs/warped/post", + "front": "entity/signs/warped/front", + "back" : "entity/signs/warped/back", + "side": "entity/signs/warped/side", + "top": "entity/signs/warped/top" + }, + "elements": [ + { + "comment" : "post", + "from": [ 7, 0, 7 ], + "to": [ 9, 8, 9 ], + "faces": { + "north": { "texture": "#post" }, + "south": { "texture": "#post" }, + "east": { "texture": "#post" }, + "west": { "texture": "#post" } + } + }, + { + "comment" : "sign", + "from": [ 0, 8, 7 ], + "to": [ 16, 16, 9 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json b/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json new file mode 100644 index 0000000..0945027 --- /dev/null +++ b/blockcrafter/custom_assets/minecraft/models/block/warped_wall_sign.json @@ -0,0 +1,23 @@ +{ + "textures": { + "post": "entity/signs/warped/post", + "front": "entity/signs/warped/front", + "back" : "entity/signs/warped/back", + "side": "entity/signs/warped/side", + "top": "entity/signs/warped/top" + }, + "elements": [ + { + "comment" : "sign", + "from": [ 0, 4, 0 ], + "to": [ 16, 12, 2 ], + "faces": { + "up" : { "texture": "#top" }, + "north": { "texture": "#back" }, + "south": { "texture": "#front" }, + "east": { "texture": "#side" }, + "west": { "texture": "#side" } + } + } + ] +} diff --git a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json index 595f48f..70129be 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json +++ b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json @@ -5,7 +5,7 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 16, 16 ], + "to": [ 16, 10, 16 ], "faces": { "up": { "uv" : [0, 0, 16, 16], "texture": "#water", "cullface": "up" } } diff --git a/blockcrafter/export.py b/blockcrafter/export.py index d5efb9c..90aca1f 100644 --- a/blockcrafter/export.py +++ b/blockcrafter/export.py @@ -132,15 +132,19 @@ def write_block_info(blockstate, variant, indices): actual_rotation = rotation if name == "minecraft:full_water": actual_rotation = 0 - if name == "minecraft:ice": + if blockstate.disable_blending or mode=="uv": render.set_blending("opaque") else: render.set_blending("premultiplied") + if blockstate.disable_culling: + render.apply_face_culling(on=False) + else: + render.apply_face_culling(on=True) actual_model = render.apply_model_rotation(model, rotation=0) glblock.render(variant, actual_model, view, projection, rotation=actual_rotation, mode=mode) array = np.array(fbo.read("color")) - if name == "minecraft:ice": + if blockstate.disable_blending: # make image opaque if mode == "color": array[:, :, 3] = (array[:, :, 3] > 0) * 255 diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index 53b1a97..c159e79 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -322,6 +322,24 @@ def create_bed_files(self, source, path): files[base_name + "stand_inner.png"] = pack_image(image.crop((int(f * 56), int(f * 3), int(f * 59), int(f * 6)))) return files + def create_conduit_files(self, source, path): + base_name = path.replace(".png", "/") + if len(source.glob_files(path)) == 0: + return {} + image = Image.open(source.open_file(path)).convert("RGBA") + w, h = image.size + assert w == h * 2 + f = w / 32 + + files = {} + files[base_name + "up.png"] = pack_image(image.crop((int(f * 8), int(f * 0), int(f * 16), int(f * 8)))) + files[base_name + "down.png"] = pack_image(image.crop((int(f * 16), int(f * 0), int(f * 24), int(f * 8)))) + files[base_name + "north.png"] = pack_image(image.crop((int(f * 0), int(f * 8), int(f * 8), int(f * 16)))) + files[base_name + "west.png"] = pack_image(image.crop((int(f * 8), int(f * 8), int(f * 16), int(f * 16)))) + files[base_name + "south.png"] = pack_image(image.crop((int(f * 16), int(f * 8), int(f * 24), int(f * 16)))) + files[base_name + "east.png"] = pack_image(image.crop((int(f * 24), int(f * 8), int(f * 32), int(f * 16)))) + return files + def create_files(self, source): files = {} files.update(self.create_chest_files(source, "minecraft/textures/entity/chest/normal.png")) @@ -330,6 +348,7 @@ def create_files(self, source): files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/normal_left.png", "minecraft/textures/entity/chest/normal_right.png")) files.update(self.create_double_chest_files(source, "minecraft/textures/entity/chest/trapped_left.png", "minecraft/textures/entity/chest/trapped_right.png")) files.update(self.create_bell_files(source, "minecraft/textures/entity/bell/bell_body.png")) + files.update(self.create_conduit_files(source, "minecraft/textures/entity/conduit/cage.png")) for path in source.glob_files("minecraft/textures/entity/signs/*.png"): files.update(self.create_sign_files(source, path)) for path in source.glob_files("minecraft/textures/entity/shulker/shulker*.png"): @@ -468,6 +487,8 @@ def __init__(self, assets, prefix, name, data, properties={}): self.extra_properties = properties self.waterloggable = properties.get("is_waterloggable", "") == "true" self.inherently_waterlogged = properties.get("inherently_waterlogged", "") == "true" + self.disable_blending = properties.get("disable_blending", "") == "true" + self.disable_culling = properties.get("disable_culling", "") == "true" if "biome_colormap" in self.extra_properties: def load_colormap(colormap): diff --git a/blockcrafter/render.py b/blockcrafter/render.py index 47ffff1..3a1484b 100644 --- a/blockcrafter/render.py +++ b/blockcrafter/render.py @@ -124,7 +124,15 @@ } float face = float(u_face_index) / 6.0; - gl_FragColor = vec4(vec3(v_texcoord.xy, face), 1.0); + + // Process the value of the Z position adn scale it to be + // stored in the alpha channel of pixel, hence why + // the blending is disabled for UV mode. + // It's purpose is mainly to merge blocks, such as waterlog + vec4 t_rot = u_model * vec4(v_position, 1.0); + float t_z = min( 1/256 + max((t_rot.z + 1.0) * 0.5, 0), 1.0); + + gl_FragColor = vec4(vec3(v_texcoord.xy, face), t_z); } """ @@ -410,7 +418,7 @@ def load_faces(model, element): data = np.array(image) semi_transparent = np.all((data[:, :, 3] == 0) | (data[:, :, 3] == 255)) w, h = image.size - image = image.resize((w*2, h*2), resample=Image.BILINEAR) + image = image.resize((w*2, h*2), resample=Image.NEAREST) data = np.array(image) if semi_transparent: data[:, :, 3] = (data[:, :, 3] > 255/2.0) * 255 @@ -420,7 +428,7 @@ def load_faces(model, element): data[:, :, 0] = data[:, :, 0] * r data[:, :, 1] = data[:, :, 1] * g data[:, :, 2] = data[:, :, 2] * b - faces[direction] = (gloo.Texture2D(data=data, interpolation="nearest"), (uv0, uv1)) + faces[direction] = (gloo.Texture2D(data=data, interpolation="linear"), (uv0, uv1)) f.close() # gather faces in order for cube sides @@ -516,6 +524,12 @@ def apply_model_rotation(model, rotation=0, phi=0.0): rotation = transforms.rotate(-rotation * 90 + phi, (0, 1, 0)) return np.dot(rotation, model) +def apply_face_culling(on=True): + if on: + gloo.set_state(cull_face=True) + else: + gloo.set_state(cull_face=False) + def set_blending(mode): if mode == "premultiplied": gloo.set_state(blend=True, depth_test=True) diff --git a/fractions.patch b/fractions.patch new file mode 100644 index 0000000..e8e5ad4 --- /dev/null +++ b/fractions.patch @@ -0,0 +1,8 @@ +4c4 +< #from fractions import gcd +--- +> from fractions import gcd +91c91 +< return math.gcd(self._p, self._q) +--- +> return gcd(self._p, self._q) diff --git a/setup.py b/setup.py index 71ff2b4..8ab18fc 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ ], keywords="", packages=find_packages(), - install_requires=["numpy", "vispy", "Pillow"], + install_requires=["numpy==1.17.5", "vispy==0.5.3", "Pillow==6.2.2"], extras_require={}, package_data={ "blockcrafter" : ["custom_assets", "blockstates.properties"] From 9352c237697ef2046f43b066e4d643749b4fb1ad Mon Sep 17 00:00:00 2001 From: mlavaire Date: Sun, 28 Feb 2021 21:27:03 -0500 Subject: [PATCH 09/12] Remove hacked default variant and add a configurable default variant + Make the atlas wider to reduce the crazy height of the png + Clean up blockstates --- blockcrafter/blockstates.properties | 107 +++-------------- .../minecraft/blockstates/andesite_wall.json | 110 ------------------ .../blockstates/blackstone_wall.json | 110 ------------------ .../minecraft/blockstates/brick_wall.json | 110 ------------------ .../blockstates/cobblestone_wall.json | 110 ------------------ .../minecraft/blockstates/diorite_wall.json | 110 ------------------ .../blockstates/end_stone_brick_wall.json | 110 ------------------ .../minecraft/blockstates/granite_wall.json | 110 ------------------ .../blockstates/mossy_cobblestone_wall.json | 110 ------------------ .../blockstates/mossy_stone_brick_wall.json | 110 ------------------ .../blockstates/nether_brick_wall.json | 110 ------------------ .../polished_blackstone_brick_wall.json | 110 ------------------ .../blockstates/polished_blackstone_wall.json | 110 ------------------ .../blockstates/prismarine_wall.json | 110 ------------------ .../blockstates/red_nether_brick_wall.json | 110 ------------------ .../blockstates/red_sandstone_wall.json | 110 ------------------ .../minecraft/blockstates/sandstone_wall.json | 110 ------------------ .../blockstates/stone_brick_wall.json | 110 ------------------ .../models/block/full_water_south_up.json | 4 +- .../minecraft/models/block/full_water_up.json | 2 +- .../models/block/full_water_west_up.json | 4 +- .../minecraft/models/block/waterlog.json | 4 +- blockcrafter/export.py | 2 +- blockcrafter/mcmodel.py | 16 +-- blockcrafter/render.py | 4 +- 25 files changed, 32 insertions(+), 1981 deletions(-) delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json delete mode 100644 blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index c10d0e8..036223c 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -8,7 +8,7 @@ minecraft:jungle_leaves biome_type=simple,biome_colors=foliage,biome_colormap=fo minecraft:oak_leaves biome_type=simple,biome_colors=foliage,biome_colormap=foliage minecraft:birch_leaves biome_type=simple,biome_colors=foliage_flipped,biome_colormap=foliage_flipped minecraft:acacia_leaves biome_type=simple,biome_colors=foliage,biome_colormap=foliage -minecraft:vine biome_type=simple,biome_colors=grass,biome_colormap=grass +minecraft:vine biome_type=simple,biome_colors=grass,biome_colormap=grass,default_variant=east:false;north:false;south:false;west:false;up:false minecraft:lily_pad* biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:grass biome_type=simple,biome_colors=grass,biome_colormap=grass minecraft:tall_grass biome_type=simple,biome_colors=grass,biome_colormap=grass @@ -24,100 +24,19 @@ minecraft:kelp is_waterloggable=true,inherently_waterlogged=true minecraft:kelp_plant is_waterloggable=true,inherently_waterlogged=true minecraft:bubble_column is_waterloggable=true,inherently_waterlogged=true -#minecraft:glass_pane is_waterloggable=true -#minecraft:white_stained_glass_pane is_waterloggable=true -#minecraft:orange_stained_glass_pane is_waterloggable=true -#minecraft:magenta_stained_glass_pane is_waterloggable=true -#minecraft:light_blue_stained_glass_pane is_waterloggable=true -#minecraft:yellow_stained_glass_pane is_waterloggable=true -#minecraft:lime_stained_glass_pane is_waterloggable=true -#minecraft:pink_stained_glass_pane is_waterloggable=true -#minecraft:gray_stained_glass_pane is_waterloggable=true -#minecraft:light_gray_stained_glass_pane is_waterloggable=true -#minecraft:cyan_stained_glass_pane is_waterloggable=true -#minecraft:purple_stained_glass_pane is_waterloggable=true -#minecraft:blue_stained_glass_pane is_waterloggable=true -#minecraft:brown_stained_glass_pane is_waterloggable=true -#minecraft:green_stained_glass_pane is_waterloggable=true -#minecraft:red_stained_glass_pane is_waterloggable=true -#minecraft:black_stained_glass_pane is_waterloggable=true minecraft:*glass_pane is_waterloggable=true +minecraft:*_stained_glass partial=true -#minecraft:acacia_fence is_waterloggable=true -#minecraft:acacia_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:acacia_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:acacia_trapdoor is_waterloggable=true -#minecraft:birch_fence is_waterloggable=true -#minecraft:birch_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:birch_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:birch_trapdoor is_waterloggable=true -#minecraft:dark_oak_fence is_waterloggable=true -#minecraft:dark_oak_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_oak_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_oak_trapdoor is_waterloggable=true -#minecraft:jungle_fence is_waterloggable=true -#minecraft:jungle_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:jungle_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:jungle_trapdoor is_waterloggable=true -#minecraft:oak_fence is_waterloggable=true -#minecraft:oak_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:oak_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:oak_trapdoor is_waterloggable=true -#minecraft:spruce_fence is_waterloggable=true -#minecraft:spruce_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:spruce_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:spruce_trapdoor is_waterloggable=true -minecraft:*_fence is_waterloggable=true +minecraft:*_fence is_waterloggable=true,default_variant=east:false;north:false;south:false;west:false minecraft:*_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true minecraft:*_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true minecraft:*_trapdoor is_waterloggable=true -#minecraft:brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:cobblestone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:cobblestone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_prismarine_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dark_prismarine_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:nether_brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:nether_brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:purpur_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:purpur_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:red_sandstone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:red_sandstone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:sandstone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:sandstone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_brick_slab is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:stone_brick_stairs is_waterloggable=true,lighting_type=smooth,faulty_lighting=true -#minecraft:dead_brain_coral is_waterloggable=true -#minecraft:dead_brain_coral_fan is_waterloggable=true -#minecraft:dead_bubble_coral is_waterloggable=true -#minecraft:dead_bubble_coral_fan is_waterloggable=true -#minecraft:dead_fire_coral is_waterloggable=true -#minecraft:dead_fire_coral_fan is_waterloggable=true -#minecraft:dead_horn_coral is_waterloggable=true -#minecraft:dead_horn_coral_fan is_waterloggable=true -#minecraft:dead_tube_coral is_waterloggable=true -#minecraft:dead_tube_coral_fan is_waterloggable=true -#minecraft:brain_coral is_waterloggable=true -#minecraft:brain_coral_fan is_waterloggable=true -#minecraft:bubble_coral is_waterloggable=true -#minecraft:bubble_coral_fan is_waterloggable=true -#minecraft:fire_coral is_waterloggable=true -#minecraft:fire_coral_fan is_waterloggable=true -#minecraft:horn_coral is_waterloggable=true -#minecraft:horn_coral_fan is_waterloggable=true -#minecraft:tube_coral is_waterloggable=true -#minecraft:tube_coral_fan is_waterloggable=true minecraft:*_coral is_waterloggable=true minecraft:*_coral_fan is_waterloggable=true minecraft:*_coral_wall_fan is_waterloggable=true -#minecraft:chest is_waterloggable=true -#minecraft:ender_chest is_waterloggable=true -#minecraft:trapped_chest is_waterloggable=true minecraft:*chest is_waterloggable=true minecraft:*sign is_waterloggable=true minecraft:*shulker_box is_waterloggable=true @@ -125,8 +44,7 @@ minecraft:*shulker_box is_waterloggable=true minecraft:iron_bars is_waterloggable=true minecraft:iron_trapdoor is_waterloggable=true minecraft:ladder is_waterloggable=true -minecraft:*_wall is_waterloggable=true -minecraft:nether_brick_fence is_waterloggable=true +minecraft:*_wall is_waterloggable=true,default_variant=east:none;north:none;south:none;west:none;up:false minecraft:sea_pickle is_waterloggable=true minecraft:conduit is_waterloggable=true,disable_culling=true @@ -141,7 +59,7 @@ minecraft:grass_path lighting_type=smooth,shadow_edges=1 minecraft:water lighting_type=smooth,biome_type=simple,biome_colors=water minecraft:flowing_water lighting_type=smooth,biome_type=simple,biome_colors=water -minecraft:full_water lighting_type=smooth,biome_type=simple,biome_colors=water +minecraft:full_water lighting_type=smooth,biome_type=simple,biome_colors=water,default_variant=south:true;west:true minecraft:waterlog lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 minecraft:water_cauldron lighting_type=smooth,biome_type=simple,biome_colors=water,shadow_edges=1 @@ -155,13 +73,16 @@ minecraft:*rail is_waterloggable=true minecraft:*campfire is_waterloggable=true minecraft:scaffolding is_waterloggable=true minecraft:*lantern is_waterloggable=true +minecraft:glow_lichen is_waterloggable=true,default_variant=east:false;north:false;south:false;west:false;up:false;down:false +minecraft:*grimstone* is_waterloggable=true +minecraft:*blackstone* is_waterloggable=true +minecraft:*_dripleaf* is_waterloggable=true -# minecraft:ice disable_blending=true -# minecraft:respawn_anchor disable_blending=true -# minecraft:honey_block disable_blending=true - -minecraft:snow shadow_edges=1 -minecraft:*_leaves shadow_edges=5 +minecraft:ice partial=true +minecraft:honey_block partial=true +minecraft:snow shadow_edges=1,partial=true +# minecraft:*_leaves* shadow_edges=5,partial=true +minecraft:*_leaves* shadow_edges=5 minecraft:full_water shadow_edges=1 minecraft:water shadow_edges=1 minecraft:*_slab shadow_edges=1 diff --git a/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json deleted file mode 100644 index 13e3394..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/andesite_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/andesite_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/andesite_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json deleted file mode 100644 index 826884e..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/blackstone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/blackstone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json deleted file mode 100644 index fa989bc..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json deleted file mode 100644 index 216ab1a..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/cobblestone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/cobblestone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json deleted file mode 100644 index 40b1c86..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/diorite_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/diorite_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/diorite_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json deleted file mode 100644 index 7c9c1e9..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/end_stone_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/end_stone_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json deleted file mode 100644 index 85cdc9b..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/granite_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/granite_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/granite_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/granite_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/granite_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/granite_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/granite_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/granite_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/granite_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/granite_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json deleted file mode 100644 index 3af060b..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/mossy_cobblestone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_cobblestone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json deleted file mode 100644 index ec6db86..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/mossy_stone_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/mossy_stone_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json deleted file mode 100644 index d6636f5..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/nether_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/nether_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json deleted file mode 100644 index 2a63b0a..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json deleted file mode 100644 index d37b1ae..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/polished_blackstone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/polished_blackstone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json deleted file mode 100644 index d0213e5..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/prismarine_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/prismarine_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json deleted file mode 100644 index 76b7088..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/red_nether_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/red_nether_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json deleted file mode 100644 index edba9a6..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/red_sandstone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/red_sandstone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json deleted file mode 100644 index 0ca1f69..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/sandstone_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/sandstone_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json b/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json deleted file mode 100644 index 798d8f9..0000000 --- a/blockcrafter/custom_assets/minecraft/blockstates/stone_brick_wall.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "multipart": [ - { - "when": { - "east": "none" - } - }, - { - "when": { - "west": "none" - } - }, - { - "when": { - "north": "none" - } - }, - { - "when": { - "south": "none" - } - }, - { - "when": { - "up": "true" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_post" - } - }, - { - "when": { - "north": "low" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side", - "uvlock": true - } - }, - { - "when": { - "east": "low" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "low" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "low" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side", - "y": 270, - "uvlock": true - } - }, - { - "when": { - "north": "tall" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side_tall", - "uvlock": true - } - }, - { - "when": { - "east": "tall" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side_tall", - "y": 90, - "uvlock": true - } - }, - { - "when": { - "south": "tall" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side_tall", - "y": 180, - "uvlock": true - } - }, - { - "when": { - "west": "tall" - }, - "apply": { - "model": "minecraft:block/stone_brick_wall_side_tall", - "y": 270, - "uvlock": true - } - } - ] -} \ No newline at end of file diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json index c75b720..def00fd 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_south_up.json @@ -5,9 +5,9 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 10, 16 ], + "to": [ 16, 13, 16 ], "faces": { - "south": { "uv" : [0, 6, 16, 16], "texture": "#water", "cullface": "south" } + "south": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "south" } } } ] diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json index 5f1b711..1c63042 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_up.json @@ -5,7 +5,7 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 10, 16 ], + "to": [ 16, 13, 16 ], "faces": { "up": { "texture": "#water", "cullface": "up"} } diff --git a/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json index f5773f8..0733daf 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json +++ b/blockcrafter/custom_assets/minecraft/models/block/full_water_west_up.json @@ -5,9 +5,9 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 10, 16 ], + "to": [ 16, 13, 16 ], "faces": { - "west": { "uv" : [0, 6, 16, 16], "texture": "#water", "cullface": "west" } + "west": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "west" } } } ] diff --git a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json index 70129be..71147e5 100644 --- a/blockcrafter/custom_assets/minecraft/models/block/waterlog.json +++ b/blockcrafter/custom_assets/minecraft/models/block/waterlog.json @@ -5,9 +5,9 @@ }, "elements": [ { "from": [ 0, 0, 0 ], - "to": [ 16, 10, 16 ], + "to": [ 16, 13, 16 ], "faces": { - "up": { "uv" : [0, 0, 16, 16], "texture": "#water", "cullface": "up" } + "up": { "uv" : [0, 3, 16, 16], "texture": "#water", "cullface": "up" } } } ] diff --git a/blockcrafter/export.py b/blockcrafter/export.py index 90aca1f..d033e30 100644 --- a/blockcrafter/export.py +++ b/blockcrafter/export.py @@ -28,7 +28,7 @@ from blockcrafter import mcmodel from blockcrafter import render -COLUMNS = 32 +COLUMNS = 128 class BlockImages: def __init__(self): diff --git a/blockcrafter/mcmodel.py b/blockcrafter/mcmodel.py index c159e79..851f6d9 100644 --- a/blockcrafter/mcmodel.py +++ b/blockcrafter/mcmodel.py @@ -486,6 +486,9 @@ def __init__(self, assets, prefix, name, data, properties={}): self.extra_properties = properties self.waterloggable = properties.get("is_waterloggable", "") == "true" + self.default_variant = properties.get("default_variant", None) + if self.default_variant != None: + self.default_variant = dict(map(lambda pair: pair.split(":"), self.default_variant.split(";"))) self.inherently_waterlogged = properties.get("inherently_waterlogged", "") == "true" self.disable_blending = properties.get("disable_blending", "") == "true" self.disable_culling = properties.get("disable_culling", "") == "true" @@ -557,19 +560,16 @@ def apply_condition(condition): for key, value in condition.items(): if key not in variables: variables[key] = set() - + if self.default_variant != None and key in self.default_variant: + variables[key].add(self.default_variant[key]) + if type(value) == bool: value = "true" if value else "false" values = set([value]) if "|" in value: values = set(value.split("|")) - # TODO this is a bit hacky - # (just assume there must be true to false value, and vice versa) - if "true" in values: - values.add("false") - if "false" in values: - values.add("true") + variables[key].update(values) if "variants" in self.data: @@ -663,7 +663,7 @@ def parse_variant(condition): def encode_variant(variant): if len(variant) == 0: return "-" - items = list(variant.items()) + items = list(filter(lambda x: (x[0] != "default_variant"), list(variant.items()))) items.sort(key = lambda i: i[0]) return ",".join(map(lambda i: "=".join(i), items)) diff --git a/blockcrafter/render.py b/blockcrafter/render.py index 3a1484b..f670a9f 100644 --- a/blockcrafter/render.py +++ b/blockcrafter/render.py @@ -125,12 +125,12 @@ float face = float(u_face_index) / 6.0; - // Process the value of the Z position adn scale it to be + // Process the value of the Z position and scale it to be // stored in the alpha channel of pixel, hence why // the blending is disabled for UV mode. // It's purpose is mainly to merge blocks, such as waterlog vec4 t_rot = u_model * vec4(v_position, 1.0); - float t_z = min( 1/256 + max((t_rot.z + 1.0) * 0.5, 0), 1.0); + float t_z = min(max(((t_rot.z + 1.0) * 0.5) * 255.0/256.0 + 1.0/256.0, 1.0/256.0), 1.0); gl_FragColor = vec4(vec3(v_texcoord.xy, face), t_z); } From c63df6d4f74391160781c63184115b77bbda3025 Mon Sep 17 00:00:00 2001 From: Bart Kuivenhoven Date: Sat, 12 Jun 2021 23:59:55 +0200 Subject: [PATCH 10/12] Apply a temporary fix to one of the dependencies It's a dirty little hack to do this in the Dockerfile, but for now this means the end of my yak shaving. --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index f9a490b..65202c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,7 @@ COPY entrypoint.sh / ENV VISPY_GL_LIB /usr/lib/libGLESv2.so.2 ENV OSMESA_LIBRARY /usr/lib/libOSMesa.so.8 +# If this line starts failing, hopefully that means the dependency was fixed. That should be your cue to remove this line +RUN sed -i 's/from fractions import gcd/from math import gcd/' /usr/local/lib/python3.9/site-packages/vispy/geometry/torusknot.py + ENTRYPOINT ["/entrypoint.sh"] From 0b77b75efecae002238e77814e154951e28c8f69 Mon Sep 17 00:00:00 2001 From: mlavaire Date: Wed, 10 Mar 2021 16:16:04 -0500 Subject: [PATCH 11/12] waterlogged lighting_rod + chain --- blockcrafter/blockstates.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index 036223c..2efc552 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -42,6 +42,7 @@ minecraft:*sign is_waterloggable=true minecraft:*shulker_box is_waterloggable=true minecraft:iron_bars is_waterloggable=true +minecraft:chain is_waterloggable=true minecraft:iron_trapdoor is_waterloggable=true minecraft:ladder is_waterloggable=true minecraft:*_wall is_waterloggable=true,default_variant=east:none;north:none;south:none;west:none;up:false @@ -77,6 +78,7 @@ minecraft:glow_lichen is_waterloggable=true,default_variant=east:false;north:fal minecraft:*grimstone* is_waterloggable=true minecraft:*blackstone* is_waterloggable=true minecraft:*_dripleaf* is_waterloggable=true +minecraft:lightning_rod is_waterloggable=true minecraft:ice partial=true minecraft:honey_block partial=true From 9ae5e3c40af671fec35689de1da82354391030da Mon Sep 17 00:00:00 2001 From: Bart Kuivenhoven Date: Mon, 14 Jun 2021 11:07:19 +0200 Subject: [PATCH 12/12] The block grass_path was renamed to block_path in 1.17 --- blockcrafter/blockstates.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blockcrafter/blockstates.properties b/blockcrafter/blockstates.properties index 036223c..bdecb41 100644 --- a/blockcrafter/blockstates.properties +++ b/blockcrafter/blockstates.properties @@ -50,12 +50,12 @@ minecraft:conduit is_waterloggable=true,disable_culling=true minecraft:farmland faulty_lighting=true minecraft:anvil faulty_lighting=true -minecraft:grass_path faulty_lighting=true +minecraft:dirt_path faulty_lighting=true minecraft:cocoa faulty_lighting=true minecraft:dragon_egg faulty_lighting=true minecraft:snow lighting_type=smooth_bottom -minecraft:grass_path lighting_type=smooth,shadow_edges=1 +minecraft:dirt_path lighting_type=smooth,shadow_edges=1 minecraft:water lighting_type=smooth,biome_type=simple,biome_colors=water minecraft:flowing_water lighting_type=smooth,biome_type=simple,biome_colors=water