From 0ad875bb74ae4b8ed0d2805293a2879c5c288f64 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Wed, 22 Feb 2023 16:58:12 +0100 Subject: [PATCH] Cull me maybe - Improved face occlusion for scaffolds --- .../deco/MetalScaffoldingBlock.java | 4 ++- .../create/models/block/scaffold/block.json | 28 +++++++++++----- .../block/scaffold/block_horizontal.json | 33 ++++++++++++------- 3 files changed, 45 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/curiosities/deco/MetalScaffoldingBlock.java b/src/main/java/com/simibubi/create/content/curiosities/deco/MetalScaffoldingBlock.java index b604550f5..e8cf7476e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/deco/MetalScaffoldingBlock.java +++ b/src/main/java/com/simibubi/create/content/curiosities/deco/MetalScaffoldingBlock.java @@ -64,7 +64,9 @@ public class MetalScaffoldingBlock extends ScaffoldingBlock implements IWrenchab Direction dir) { if (!neighborState.is(this)) return false; - return dir.getAxis() != Axis.Y && neighborState.getValue(BOTTOM); + if (!neighborState.getValue(BOTTOM) && state.getValue(BOTTOM)) + return false; + return dir.getAxis() != Axis.Y; } } diff --git a/src/main/resources/assets/create/models/block/scaffold/block.json b/src/main/resources/assets/create/models/block/scaffold/block.json index c32ef31ab..c14a29c27 100644 --- a/src/main/resources/assets/create/models/block/scaffold/block.json +++ b/src/main/resources/assets/create/models/block/scaffold/block.json @@ -8,15 +8,27 @@ "top": "create:block/funnel/brass_funnel_frame" }, "elements": [ + { + "name": "outside_nocull", + "from": [0, 0, 0], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "down"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "down"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "down"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "down"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#top"} + } + }, { "name": "outside", "from": [0, 0, 0], "to": [16, 16, 16], "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#side"}, - "east": {"uv": [0, 0, 16, 16], "texture": "#side"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#side"}, - "west": {"uv": [0, 0, 16, 16], "texture": "#side"}, + "north": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "north"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "east"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "south"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#side", "cullface": "west"}, "up": {"uv": [0, 0, 16, 16], "texture": "#top"} } }, @@ -25,10 +37,10 @@ "from": [0, 0, 16], "to": [16, 16, 0], "faces": { - "north": {"uv": [0, 0, 16, 16], "texture": "#2"}, - "east": {"uv": [0, 0, 16, 16], "texture": "#2"}, - "south": {"uv": [0, 0, 16, 16], "texture": "#2"}, - "west": {"uv": [0, 0, 16, 16], "texture": "#2"}, + "north": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "south"}, + "east": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "east"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "north"}, + "west": {"uv": [0, 0, 16, 16], "texture": "#2", "cullface": "west"}, "up": {"uv": [0, 0, 16, 16], "texture": "#top"} } } diff --git a/src/main/resources/assets/create/models/block/scaffold/block_horizontal.json b/src/main/resources/assets/create/models/block/scaffold/block_horizontal.json index 63e73678f..b28afd619 100644 --- a/src/main/resources/assets/create/models/block/scaffold/block_horizontal.json +++ b/src/main/resources/assets/create/models/block/scaffold/block_horizontal.json @@ -7,15 +7,27 @@ }, "elements": [ { - "name": "outside", - "from": [0, 8, 0], + "name": "top", + "from": [0, 13, 0], "to": [16, 16, 16], "faces": { - "north": {"uv": [16, 0, 0, 8], "texture": "#side", "cullface": "north"}, - "east": {"uv": [16, 0, 0, 8], "texture": "#side", "cullface": "east"}, - "south": {"uv": [16, 0, 0, 8], "texture": "#side", "cullface": "south"}, - "west": {"uv": [16, 0, 0, 8], "texture": "#side", "cullface": "west"}, - "up": {"uv": [0, 0, 16, 16], "texture": "#particle"} + "north": {"uv": [16, 0, 0, 3], "texture": "#side", "cullface": "north"}, + "east": {"uv": [16, 0, 0, 3], "texture": "#side", "cullface": "east"}, + "south": {"uv": [16, 0, 0, 3], "texture": "#side", "cullface": "south"}, + "west": {"uv": [16, 0, 0, 3], "texture": "#side", "cullface": "west"}, + "up": {"uv": [0, 0, 16, 16], "texture": "#particle"}, + "down": {"uv": [0, 0, 16, 16], "texture": "#particle"} + } + }, + { + "name": "outside", + "from": [0, 8, 0], + "to": [16, 13, 16], + "faces": { + "north": {"uv": [16, 3, 0, 8], "texture": "#side", "cullface": "north"}, + "east": {"uv": [16, 3, 0, 8], "texture": "#side", "cullface": "east"}, + "south": {"uv": [16, 3, 0, 8], "texture": "#side", "cullface": "south"}, + "west": {"uv": [16, 3, 0, 8], "texture": "#side", "cullface": "west"} } }, { @@ -24,10 +36,9 @@ "to": [0, 13, 16], "faces": { "north": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "north"}, - "east": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "north"}, - "south": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "north"}, - "west": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "north"}, - "up": {"uv": [0, 0, 16, 16], "rotation": 180, "texture": "#particle"} + "east": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "west"}, + "south": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "south"}, + "west": {"uv": [16, 3, 0, 8], "texture": "#2", "cullface": "east"} } } ]