diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java index b2c10199..e905147f 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/ResourceModelBuilder.java @@ -46,6 +46,7 @@ import de.bluecolored.bluemap.core.util.math.VectorM2f; import de.bluecolored.bluemap.core.util.math.VectorM3f; import de.bluecolored.bluemap.core.world.BlockNeighborhood; +import de.bluecolored.bluemap.core.world.BlockProperties; import de.bluecolored.bluemap.core.world.ExtendedBlock; import de.bluecolored.bluemap.core.world.LightData; @@ -186,7 +187,9 @@ private void createElementFace(Element element, Direction faceDir, VectorM3f c0, // face culling if (face.getCullface() != null) { ExtendedBlock b = getRotationRelativeBlock(face.getCullface()); - if (b.getProperties().isCulling()) return; + BlockProperties p = b.getProperties(); + if (p.isCulling()) return; + if (p.getCullingIdentical() && b.getBlockState().equals(block.getBlockState())) return; } // light calculation diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/BlockPropertiesConfig.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/BlockPropertiesConfig.java index 50dc4325..495bfd14 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/BlockPropertiesConfig.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/BlockPropertiesConfig.java @@ -66,6 +66,7 @@ public void load(Path configFile) throws IOException { case "occluding": bsValueBuilder.occluding(json.nextBoolean()); break; case "alwaysWaterlogged": bsValueBuilder.alwaysWaterlogged(json.nextBoolean()); break; case "randomOffset": bsValueBuilder.randomOffset(json.nextBoolean()); break; + case "cullingIdentical": bsValueBuilder.cullingIdentical(json.nextBoolean()); break; default: break; } } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/BlockProperties.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/BlockProperties.java index 0a5fbadc..527360da 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/BlockProperties.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/BlockProperties.java @@ -32,25 +32,28 @@ public class BlockProperties { public static final BlockProperties DEFAULT = new BlockProperties(); - private Tristate culling, occluding, alwaysWaterlogged, randomOffset; + private Tristate culling, occluding, alwaysWaterlogged, randomOffset, cullingIdentical; public BlockProperties() { this.culling = Tristate.UNDEFINED; this.occluding = Tristate.UNDEFINED; this.alwaysWaterlogged = Tristate.UNDEFINED; this.randomOffset = Tristate.UNDEFINED; + this.cullingIdentical = Tristate.UNDEFINED; } public BlockProperties( Tristate culling, Tristate occluding, Tristate alwaysWaterlogged, - Tristate randomOffset + Tristate randomOffset, + Tristate cullingIdentical ) { this.culling = culling; this.occluding = occluding; this.alwaysWaterlogged = alwaysWaterlogged; this.randomOffset = randomOffset; + this.cullingIdentical = cullingIdentical; } public boolean isCulling() { @@ -69,12 +72,17 @@ public boolean isRandomOffset() { return randomOffset.getOr(false); } + public boolean getCullingIdentical() { + return cullingIdentical.getOr(false); + } + public Builder toBuilder() { return new BlockProperties( culling, occluding, alwaysWaterlogged, - randomOffset + randomOffset, + cullingIdentical ).new Builder(); } @@ -104,11 +112,17 @@ public Builder randomOffset(boolean randomOffset) { return this; } + public Builder cullingIdentical(boolean cullingIdentical) { + BlockProperties.this.cullingIdentical = cullingIdentical ? Tristate.TRUE : Tristate.FALSE; + return this; + } + public Builder from(BlockProperties other) { culling = other.culling.getOr(culling); occluding = other.occluding.getOr(occluding); alwaysWaterlogged = other.alwaysWaterlogged.getOr(alwaysWaterlogged); randomOffset = other.randomOffset.getOr(randomOffset); + cullingIdentical = other.cullingIdentical.getOr(cullingIdentical); return this; } @@ -132,6 +146,10 @@ public Tristate isRandomOffset() { return randomOffset; } + public Tristate isCullingIdentical() { + return cullingIdentical; + } + } @Override @@ -141,6 +159,7 @@ public String toString() { ", occluding=" + occluding + ", alwaysWaterlogged=" + alwaysWaterlogged + ", randomOffset=" + randomOffset + + ", cullingIdentical=" + cullingIdentical + '}'; } diff --git a/BlueMapCore/src/main/resourceExtensions/mc1_13/assets/minecraft/blockProperties.json b/BlueMapCore/src/main/resourceExtensions/mc1_13/assets/minecraft/blockProperties.json index b7395bdc..d319683a 100644 --- a/BlueMapCore/src/main/resourceExtensions/mc1_13/assets/minecraft/blockProperties.json +++ b/BlueMapCore/src/main/resourceExtensions/mc1_13/assets/minecraft/blockProperties.json @@ -31,22 +31,24 @@ "minecraft:hanging_roots": { "randomOffset": true }, "minecraft:small_dripleaf": { "randomOffset": true }, - "minecraft:glass": { "occluding": false }, - "minecraft:tinted_glass": { "occluding": false }, - "minecraft:white_stained_glass": { "occluding": false }, - "minecraft:orange_stained_glass": { "occluding": false }, - "minecraft:magenta_stained_glass": { "occluding": false }, - "minecraft:light_blue_stained_glass": { "occluding": false }, - "minecraft:yellow_stained_glass": { "occluding": false }, - "minecraft:lime_stained_glass": { "occluding": false }, - "minecraft:pink_stained_glass": { "occluding": false }, - "minecraft:gray_stained_glass": { "occluding": false }, - "minecraft:light_gray_stained_glass": { "occluding": false }, - "minecraft:cyan_stained_glass": { "occluding": false }, - "minecraft:purple_stained_glass": { "occluding": false }, - "minecraft:blue_stained_glass": { "occluding": false }, - "minecraft:brown_stained_glass": { "occluding": false }, - "minecraft:green_stained_glass": { "occluding": false }, - "minecraft:red_stained_glass": { "occluding": false }, - "minecraft:black_stained_glass": { "occluding": false } + "minecraft:glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:tinted_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:white_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:orange_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:magenta_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:yellow_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:lime_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:pink_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:cyan_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:purple_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:brown_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:green_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:red_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:black_stained_glass": { "occluding": false, "cullingIdentical": true }, + + "minecraft:ice": { "cullingIdentical": true } } \ No newline at end of file diff --git a/BlueMapCore/src/main/resourceExtensions/mc1_15/assets/minecraft/blockProperties.json b/BlueMapCore/src/main/resourceExtensions/mc1_15/assets/minecraft/blockProperties.json index b7395bdc..d319683a 100644 --- a/BlueMapCore/src/main/resourceExtensions/mc1_15/assets/minecraft/blockProperties.json +++ b/BlueMapCore/src/main/resourceExtensions/mc1_15/assets/minecraft/blockProperties.json @@ -31,22 +31,24 @@ "minecraft:hanging_roots": { "randomOffset": true }, "minecraft:small_dripleaf": { "randomOffset": true }, - "minecraft:glass": { "occluding": false }, - "minecraft:tinted_glass": { "occluding": false }, - "minecraft:white_stained_glass": { "occluding": false }, - "minecraft:orange_stained_glass": { "occluding": false }, - "minecraft:magenta_stained_glass": { "occluding": false }, - "minecraft:light_blue_stained_glass": { "occluding": false }, - "minecraft:yellow_stained_glass": { "occluding": false }, - "minecraft:lime_stained_glass": { "occluding": false }, - "minecraft:pink_stained_glass": { "occluding": false }, - "minecraft:gray_stained_glass": { "occluding": false }, - "minecraft:light_gray_stained_glass": { "occluding": false }, - "minecraft:cyan_stained_glass": { "occluding": false }, - "minecraft:purple_stained_glass": { "occluding": false }, - "minecraft:blue_stained_glass": { "occluding": false }, - "minecraft:brown_stained_glass": { "occluding": false }, - "minecraft:green_stained_glass": { "occluding": false }, - "minecraft:red_stained_glass": { "occluding": false }, - "minecraft:black_stained_glass": { "occluding": false } + "minecraft:glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:tinted_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:white_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:orange_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:magenta_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:yellow_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:lime_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:pink_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:cyan_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:purple_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:brown_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:green_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:red_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:black_stained_glass": { "occluding": false, "cullingIdentical": true }, + + "minecraft:ice": { "cullingIdentical": true } } \ No newline at end of file diff --git a/BlueMapCore/src/main/resourceExtensions/mc1_16/assets/minecraft/blockProperties.json b/BlueMapCore/src/main/resourceExtensions/mc1_16/assets/minecraft/blockProperties.json index b7395bdc..d319683a 100644 --- a/BlueMapCore/src/main/resourceExtensions/mc1_16/assets/minecraft/blockProperties.json +++ b/BlueMapCore/src/main/resourceExtensions/mc1_16/assets/minecraft/blockProperties.json @@ -31,22 +31,24 @@ "minecraft:hanging_roots": { "randomOffset": true }, "minecraft:small_dripleaf": { "randomOffset": true }, - "minecraft:glass": { "occluding": false }, - "minecraft:tinted_glass": { "occluding": false }, - "minecraft:white_stained_glass": { "occluding": false }, - "minecraft:orange_stained_glass": { "occluding": false }, - "minecraft:magenta_stained_glass": { "occluding": false }, - "minecraft:light_blue_stained_glass": { "occluding": false }, - "minecraft:yellow_stained_glass": { "occluding": false }, - "minecraft:lime_stained_glass": { "occluding": false }, - "minecraft:pink_stained_glass": { "occluding": false }, - "minecraft:gray_stained_glass": { "occluding": false }, - "minecraft:light_gray_stained_glass": { "occluding": false }, - "minecraft:cyan_stained_glass": { "occluding": false }, - "minecraft:purple_stained_glass": { "occluding": false }, - "minecraft:blue_stained_glass": { "occluding": false }, - "minecraft:brown_stained_glass": { "occluding": false }, - "minecraft:green_stained_glass": { "occluding": false }, - "minecraft:red_stained_glass": { "occluding": false }, - "minecraft:black_stained_glass": { "occluding": false } + "minecraft:glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:tinted_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:white_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:orange_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:magenta_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:yellow_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:lime_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:pink_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:cyan_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:purple_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:brown_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:green_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:red_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:black_stained_glass": { "occluding": false, "cullingIdentical": true }, + + "minecraft:ice": { "cullingIdentical": true } } \ No newline at end of file diff --git a/BlueMapCore/src/main/resourceExtensions/mc1_18/assets/minecraft/blockProperties.json b/BlueMapCore/src/main/resourceExtensions/mc1_18/assets/minecraft/blockProperties.json index b7395bdc..d319683a 100644 --- a/BlueMapCore/src/main/resourceExtensions/mc1_18/assets/minecraft/blockProperties.json +++ b/BlueMapCore/src/main/resourceExtensions/mc1_18/assets/minecraft/blockProperties.json @@ -31,22 +31,24 @@ "minecraft:hanging_roots": { "randomOffset": true }, "minecraft:small_dripleaf": { "randomOffset": true }, - "minecraft:glass": { "occluding": false }, - "minecraft:tinted_glass": { "occluding": false }, - "minecraft:white_stained_glass": { "occluding": false }, - "minecraft:orange_stained_glass": { "occluding": false }, - "minecraft:magenta_stained_glass": { "occluding": false }, - "minecraft:light_blue_stained_glass": { "occluding": false }, - "minecraft:yellow_stained_glass": { "occluding": false }, - "minecraft:lime_stained_glass": { "occluding": false }, - "minecraft:pink_stained_glass": { "occluding": false }, - "minecraft:gray_stained_glass": { "occluding": false }, - "minecraft:light_gray_stained_glass": { "occluding": false }, - "minecraft:cyan_stained_glass": { "occluding": false }, - "minecraft:purple_stained_glass": { "occluding": false }, - "minecraft:blue_stained_glass": { "occluding": false }, - "minecraft:brown_stained_glass": { "occluding": false }, - "minecraft:green_stained_glass": { "occluding": false }, - "minecraft:red_stained_glass": { "occluding": false }, - "minecraft:black_stained_glass": { "occluding": false } + "minecraft:glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:tinted_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:white_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:orange_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:magenta_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:yellow_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:lime_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:pink_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:light_gray_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:cyan_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:purple_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:blue_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:brown_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:green_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:red_stained_glass": { "occluding": false, "cullingIdentical": true }, + "minecraft:black_stained_glass": { "occluding": false, "cullingIdentical": true }, + + "minecraft:ice": { "cullingIdentical": true } } \ No newline at end of file