diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigManager.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigManager.java index 74e92b18..c08bc70b 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigManager.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigManager.java @@ -31,6 +31,7 @@ import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; +import de.bluecolored.bluemap.core.resources.datapack.DataPack; import de.bluecolored.bluemap.core.util.FileHelper; import de.bluecolored.bluemap.core.util.Key; import lombok.Builder; @@ -222,19 +223,19 @@ public class BlueMapConfigManager implements BlueMapConfiguration { Files.writeString( mapConfigFolder.resolve("overworld.conf"), createOverworldMapTemplate("Overworld", worldFolder, - new Key("minecraft", "overworld"), 0).build(), + DataPack.DIMENSION_OVERWORLD, 0).build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); Files.writeString( mapConfigFolder.resolve("nether.conf"), createNetherMapTemplate("Nether", worldFolder, - new Key("minecraft", "the_nether"), 0).build(), + DataPack.DIMENSION_THE_NETHER, 0).build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); Files.writeString( mapConfigFolder.resolve("end.conf"), createEndMapTemplate("End", worldFolder, - new Key("minecraft", "the_end"), 0).build(), + DataPack.DIMENSION_THE_END, 0).build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); } else { @@ -252,7 +253,7 @@ public class BlueMapConfigManager implements BlueMapConfiguration { configFile = mapConfigFolder.resolve(id + '_' + (++i) + ".conf"); } - String name = worldFolder.getFileName() + " - " + dimensionName; + String name = worldFolder.getFileName() + " (" + dimensionName + ")"; if (i > 1) name = name + " (" + i + ")"; ConfigTemplate template; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/LiquidModelBuilder.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/LiquidModelBuilder.java index 0c05a6ca..c9929aa3 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/LiquidModelBuilder.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/hires/blockmodel/LiquidModelBuilder.java @@ -104,8 +104,14 @@ public class LiquidModelBuilder { private final Color tintcolor = new Color(); private void build() { + int blockLight = block.getBlockLightLevel(); + int sunLight = block.getSunLightLevel(); + // filter out blocks that are in a "cave" that should not be rendered - if (this.block.isCave() && (renderSettings.isCaveDetectionUsesBlockLight() ? block.getBlockLightLevel() : block.getSunLightLevel()) == 0f) return; + if ( + this.block.isRemoveIfCave() && + (renderSettings.isCaveDetectionUsesBlockLight() ? Math.max(blockLight, sunLight) : sunLight) == 0f + ) return; int level = blockState.getLiquidLevel(); if (level < 8 && !(level == 0 && isSameLiquid(block.getNeighborBlock(0, 1, 0)))){ @@ -160,7 +166,7 @@ public class LiquidModelBuilder { blockColor.multiply(tintcolor); // apply light - float combinedLight = Math.max(block.getSunLightLevel() / 15f, block.getBlockLightLevel() / 15f); + float combinedLight = Math.max(sunLight, blockLight) / 15f; combinedLight = (renderSettings.getAmbientLight() + combinedLight) / (renderSettings.getAmbientLight() + 1f); blockColor.r *= combinedLight; blockColor.g *= combinedLight; 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 b015c458..8396d051 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 @@ -196,7 +196,10 @@ public class ResourceModelBuilder { int blockLight = Math.max(blockLightData.getBlockLight(), facedLightData.getBlockLight()); // filter out faces that are in a "cave" that should not be rendered - if (block.isCave() && (renderSettings.isCaveDetectionUsesBlockLight() ? Math.max(blockLight, sunLight) : sunLight) == 0f) return; + if ( + block.isRemoveIfCave() && + (renderSettings.isCaveDetectionUsesBlockLight() ? Math.max(blockLight, sunLight) : sunLight) == 0f + ) return; // initialize the faces blockModel.initialize(); diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/block/ExtendedBlock.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/block/ExtendedBlock.java index 8870d50d..50e1b181 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/block/ExtendedBlock.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/world/block/ExtendedBlock.java @@ -109,12 +109,14 @@ public class ExtendedBlock> extends Block { return insideRenderBounds; } - public boolean isCave() { + public boolean isRemoveIfCave() { if (!isCaveCalculated) { isCave = getY() < renderSettings.getRemoveCavesBelowY() && - !getChunk().hasOceanFloorHeights() || + ( + !getChunk().hasOceanFloorHeights() || getY() < getChunk().getOceanFloorY(getX(), getZ()) + - renderSettings.getCaveDetectionOceanFloor(); + renderSettings.getCaveDetectionOceanFloor() + ); isCaveCalculated = true; }