From 36985288a8815b48e1b3ffbf1042ee867076e36f Mon Sep 17 00:00:00 2001 From: Adrien1106 Date: Fri, 16 Feb 2024 15:45:09 +0100 Subject: [PATCH] fixed models and added generation of the outer models just missing outer top --- .../reframed/block/ReFramedStairsBlock.java | 126 +++++++++++++++++- .../reframed/client/ReFramedClient.java | 1 + .../models/block/double_outer_stairs.json | 13 +- .../models/block/outer_side_stairs.json | 39 ++++++ 4 files changed, 161 insertions(+), 18 deletions(-) create mode 100644 src/main/resources/assets/reframed/models/block/outer_side_stairs.json diff --git a/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java index 7871729..a5e08f8 100644 --- a/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java +++ b/src/main/java/fr/adrien1106/reframed/block/ReFramedStairsBlock.java @@ -265,6 +265,7 @@ public class ReFramedStairsBlock extends WaterloggableReFramedBlock implements M Identifier double_outer_id = ReFramed.id("double_outer_stairs_special"); Identifier inner_id = ReFramed.id("inner_stairs_special"); Identifier outer_id = ReFramed.id("outer_stairs_special"); + Identifier outer_side_id = ReFramed.id("outer_side_stairs_special"); return MultipartBlockStateSupplier.create(this) /* STRAIGHT X AXIS */ .with(GBlockstate.when(FACING, DOWN_EAST, SHAPE, STRAIGHT), @@ -336,14 +337,127 @@ public class ReFramedStairsBlock extends WaterloggableReFramedBlock implements M GBlockstate.when(FACING, UP_WEST, SHAPE, INNER_LEFT)), GBlockstate.variant(inner_id, true, R180, R270)) /* OUTER BOTTOM */ - .with(GBlockstate.when(FACING, DOWN_EAST, SHAPE, FIRST_OUTER_RIGHT), + .with(When.anyOf( + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, SECOND_OUTER_RIGHT)), GBlockstate.variant(outer_id, true, R0, R0)) - .with(GBlockstate.when(FACING, DOWN_EAST, SHAPE, FIRST_OUTER_RIGHT), - GBlockstate.variant(inner_id, true, R0, R270)) - /* OUTER DOUBLE */ - .with(GBlockstate.when(FACING, NORTH_DOWN, SHAPE, OUTER_LEFT), + .with(When.anyOf( + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_id, true, R0, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_id, true, R0, R180)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_id, true, R0, R270)) + /* OUTER TOP */ + .with(When.anyOf( + GBlockstate.when(FACING, UP_NORTH, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, EAST_UP, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_id, true, R180, R0)) + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_UP, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, EAST_UP, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_id, true, R180, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_UP, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, UP_WEST, SHAPE, SECOND_OUTER_RIGHT)), + GBlockstate.variant(outer_id, true, R180, R180)) + .with(When.anyOf( + GBlockstate.when(FACING, UP_NORTH, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, UP_WEST, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_id, true, R180, R270)) + /* OUTER EAST */ + .with(When.anyOf( + GBlockstate.when(FACING, EAST_SOUTH, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R0, R0)) + .with(When.anyOf( + GBlockstate.when(FACING, EAST_SOUTH, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, EAST_UP, SHAPE, SECOND_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R90, R0)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_EAST, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, EAST_UP, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R180, R0)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_EAST, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R270, R0)) + /* OUTER SOUTH */ + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_WEST, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R0, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_WEST, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, SOUTH_UP, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R90, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, EAST_SOUTH, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, SOUTH_UP, SHAPE, SECOND_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R180, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, EAST_SOUTH, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R270, R90)) + /* OUTER WEST */ + .with(When.anyOf( + GBlockstate.when(FACING, WEST_NORTH, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R0, R180)) + .with(When.anyOf( + GBlockstate.when(FACING, WEST_NORTH, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, UP_WEST, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R90, R180)) + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_WEST, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, UP_WEST, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R180, R180)) + .with(When.anyOf( + GBlockstate.when(FACING, SOUTH_WEST, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, SECOND_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R270, R180)) + /* OUTER NORTH */ + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_EAST, SHAPE, SECOND_OUTER_RIGHT), + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, SECOND_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R0, R270)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_EAST, SHAPE, SECOND_OUTER_LEFT), + GBlockstate.when(FACING, UP_NORTH, SHAPE, FIRST_OUTER_RIGHT)), + GBlockstate.variant(outer_side_id, true, R90, R270)) + .with(When.anyOf( + GBlockstate.when(FACING, WEST_NORTH, SHAPE, FIRST_OUTER_LEFT), + GBlockstate.when(FACING, UP_NORTH, SHAPE, FIRST_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R180, R270)) + .with(When.anyOf( + GBlockstate.when(FACING, WEST_NORTH, SHAPE, FIRST_OUTER_RIGHT), + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, SECOND_OUTER_LEFT)), + GBlockstate.variant(outer_side_id, true, R270, R270)) + /* OUTER BOTTOM */ + .with(When.anyOf( + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, OUTER_RIGHT), + GBlockstate.when(FACING, EAST_SOUTH, SHAPE, OUTER_RIGHT)), + GBlockstate.variant(double_outer_id, true, R0, R0)) + .with(When.anyOf( + GBlockstate.when(FACING, DOWN_SOUTH, SHAPE, OUTER_LEFT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, OUTER_RIGHT), + GBlockstate.when(FACING, SOUTH_WEST, SHAPE, OUTER_RIGHT)), + GBlockstate.variant(double_outer_id, true, R0, R90)) + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, OUTER_LEFT), + GBlockstate.when(FACING, WEST_DOWN, SHAPE, OUTER_LEFT), + GBlockstate.when(FACING, WEST_NORTH, SHAPE, OUTER_RIGHT)), GBlockstate.variant(double_outer_id, true, R0, R180)) - .with(GBlockstate.when(FACING, NORTH_DOWN, SHAPE, OUTER_RIGHT), + .with(When.anyOf( + GBlockstate.when(FACING, NORTH_DOWN, SHAPE, OUTER_RIGHT), + GBlockstate.when(FACING, DOWN_EAST, SHAPE, OUTER_LEFT), + GBlockstate.when(FACING, NORTH_EAST, SHAPE, OUTER_RIGHT)), GBlockstate.variant(double_outer_id, true, R0, R270)); } diff --git a/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java index eb5980b..b37ced6 100644 --- a/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java +++ b/src/main/java/fr/adrien1106/reframed/client/ReFramedClient.java @@ -57,6 +57,7 @@ public class ReFramedClient implements ClientModInitializer { HELPER.addReFramedModel(ReFramed.id("double_outer_stairs_special") , HELPER.auto(ReFramed.id("block/double_outer_stairs"))); HELPER.addReFramedModel(ReFramed.id("inner_stairs_special") , HELPER.auto(new Identifier("block/inner_stairs"))); HELPER.addReFramedModel(ReFramed.id("outer_stairs_special") , HELPER.auto(new Identifier("block/outer_stairs"))); + HELPER.addReFramedModel(ReFramed.id("outer_side_stairs_special") , HELPER.auto(ReFramed.id("block/outer_side_stairs"))); HELPER.addReFramedModel(ReFramed.id("trapdoor_bottom_special") , HELPER.auto(new Identifier("block/template_trapdoor_bottom"))); HELPER.addReFramedModel(ReFramed.id("trapdoor_top_special") , HELPER.auto(new Identifier("block/template_trapdoor_top"))); HELPER.addReFramedModel(ReFramed.id("wall_post_special") , HELPER.auto(new Identifier("block/template_wall_post"))); diff --git a/src/main/resources/assets/reframed/models/block/double_outer_stairs.json b/src/main/resources/assets/reframed/models/block/double_outer_stairs.json index afe8136..bc62650 100644 --- a/src/main/resources/assets/reframed/models/block/double_outer_stairs.json +++ b/src/main/resources/assets/reframed/models/block/double_outer_stairs.json @@ -1,21 +1,10 @@ { + "credit": "Made with Blockbench", "parent": "minecraft:block/block", "textures": { "particle": "#side" }, "elements": [ - { - "from": [0, 0, 0], - "to": [16, 8, 16], - "faces": { - "north": {"uv": [0, 8, 16, 16], "texture": "#side", "cullface": "north"}, - "east": {"uv": [0, 8, 16, 16], "texture": "#side", "cullface": "east"}, - "south": {"uv": [0, 8, 16, 16], "texture": "#side", "cullface": "south"}, - "west": {"uv": [0, 8, 16, 16], "texture": "#side", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#top"}, - "down": {"uv": [0, 0, 16, 16], "texture": "#bottom", "cullface": "down"} - } - }, { "from": [8, 0, 0], "to": [16, 8, 16], diff --git a/src/main/resources/assets/reframed/models/block/outer_side_stairs.json b/src/main/resources/assets/reframed/models/block/outer_side_stairs.json new file mode 100644 index 0000000..f7838f8 --- /dev/null +++ b/src/main/resources/assets/reframed/models/block/outer_side_stairs.json @@ -0,0 +1,39 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "particle": "#side" + }, + "elements": [ + { + "from": [8, 0, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 8, 16], "texture": "#side", "cullface": "north"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "east"}, + "south": {"uv": [8, 0, 16, 16], "texture": "#side", "cullface": "south"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#side"}, + "up": {"uv": [8, 0, 16, 16], "texture": "#top", "cullface": "up"}, + "down": {"uv": [8, 0, 16, 16], "texture": "#bottom", "cullface": "down"} + } + }, + { + "from": [0, 0, 8], + "to": [8, 8, 16], + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#side"}, + "south": {"uv": [0, 8, 8, 16], "texture": "#side", "cullface": "south"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#side", "cullface": "west"}, + "up": {"uv": [0, 8, 8, 16], "texture": "#top"}, + "down": {"uv": [0, 0, 8, 8], "texture": "#bottom", "cullface": "down"} + } + } + ], + "groups": [ + { + "name": "outer_stairs", + "origin": [8, 8, 8], + "color": 0, + "children": [0, 1] + } + ] +} \ No newline at end of file