From a33960dcfa70fa6ffe154036b531166fc93b5d32 Mon Sep 17 00:00:00 2001 From: kyeiti Date: Mon, 21 May 2018 00:44:14 +0200 Subject: [PATCH] Replace generated cobblestone with UB Cobblestone and bumped version. Related #3 --- build.gradle | 2 +- .../exterminatorjeff/undergroundbiomes/api/ModInfo.java | 2 +- .../undergroundbiomes/api/common/UBSettings.java | 2 ++ .../undergroundbiomes/config/UBConfig.java | 7 +++++++ .../undergroundbiomes/world/UBStoneReplacer.java | 9 +++++++++ src/main/resources/mcmod.info | 2 +- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 68ed2e32..d5e6669e 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.0.2" +version = "1.1.0" group = "exterminatorjeff.undergroundbiomes" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "UndergroundBiomesConstructs-1.12" diff --git a/src/main/java/exterminatorjeff/undergroundbiomes/api/ModInfo.java b/src/main/java/exterminatorjeff/undergroundbiomes/api/ModInfo.java index d88ebe18..ba1007cd 100755 --- a/src/main/java/exterminatorjeff/undergroundbiomes/api/ModInfo.java +++ b/src/main/java/exterminatorjeff/undergroundbiomes/api/ModInfo.java @@ -9,7 +9,7 @@ public final class ModInfo { public static final String MODID = "undergroundbiomes"; public static final String NAME = "Underground Biomes"; - public static final String VERSION = "1.0.2"; + public static final String VERSION = "1.1.0"; private ModInfo() { } diff --git a/src/main/java/exterminatorjeff/undergroundbiomes/api/common/UBSettings.java b/src/main/java/exterminatorjeff/undergroundbiomes/api/common/UBSettings.java index 5b197166..65b4a992 100755 --- a/src/main/java/exterminatorjeff/undergroundbiomes/api/common/UBSettings.java +++ b/src/main/java/exterminatorjeff/undergroundbiomes/api/common/UBSettings.java @@ -46,6 +46,8 @@ public interface UBSettings { boolean ubifyVillages(); + boolean replaceCobblestone(); + boolean buttonsOn(); boolean igneousButtonsOn(); diff --git a/src/main/java/exterminatorjeff/undergroundbiomes/config/UBConfig.java b/src/main/java/exterminatorjeff/undergroundbiomes/config/UBConfig.java index bb93b455..b5110fdf 100755 --- a/src/main/java/exterminatorjeff/undergroundbiomes/config/UBConfig.java +++ b/src/main/java/exterminatorjeff/undergroundbiomes/config/UBConfig.java @@ -63,6 +63,7 @@ public class UBConfig implements UBSettings { public Set excludedDimensionsSet; public final BooleanSetting dimensionSpecificSeeds = new BooleanSetting(CATEGORY_GENERATION, "DimensionSpecificSeeds"); public final BooleanSetting ubifyVillages = new BooleanSetting(CATEGORY_GENERATION, "UBifyVillages"); + public final BooleanSetting replaceCobblestone = new BooleanSetting(CATEGORY_GENERATION, "ReplaceCobblestone"); private static final String CATEGORY_VISUAL = "Visual"; public final BooleanSetting plainSlabTextures = new BooleanSetting(CATEGORY_VISUAL, "PlainSlabTextures"); @@ -152,6 +153,7 @@ public void init(File file) { excludedDimensions.initProperty(configuration, "-1,1", "Comma-separated list of dimension IDs, used only if include list is *"); dimensionSpecificSeeds.initProperty(configuration, false, "Use a different seed for each dimensions"); ubifyVillages.initProperty(configuration, true, "Use UB stones in villages structures"); + replaceCobblestone.initProperty(configuration, false, "Replace vanilla cobblestone with UB variants"); plainSlabTextures.initProperty(configuration, false, "Use normal stone textures for slabs"); @@ -388,6 +390,11 @@ public boolean ubifyVillages() { return ubifyVillages.getValue(); } + @Override + public boolean replaceCobblestone() { + return replaceCobblestone.getValue(); + } + /* * Visual (Client only) */ diff --git a/src/main/java/exterminatorjeff/undergroundbiomes/world/UBStoneReplacer.java b/src/main/java/exterminatorjeff/undergroundbiomes/world/UBStoneReplacer.java index c74b9bf0..ddeba241 100644 --- a/src/main/java/exterminatorjeff/undergroundbiomes/world/UBStoneReplacer.java +++ b/src/main/java/exterminatorjeff/undergroundbiomes/world/UBStoneReplacer.java @@ -4,9 +4,13 @@ package exterminatorjeff.undergroundbiomes.world; import exterminatorjeff.undergroundbiomes.api.*; +import exterminatorjeff.undergroundbiomes.api.enums.UBStoneStyle; +import exterminatorjeff.undergroundbiomes.common.block.IgneousStone; +import exterminatorjeff.undergroundbiomes.common.block.MetamorphicStone; import exterminatorjeff.undergroundbiomes.common.block.UBStone; import exterminatorjeff.undergroundbiomes.config.UBConfig; import exterminatorjeff.undergroundbiomes.intermod.OresRegistry; +import exterminatorjeff.undergroundbiomes.intermod.StonesRegistry; import exterminatorjeff.undergroundbiomes.world.noise.NoiseGenerator; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; @@ -75,6 +79,11 @@ public void replaceStoneInChunk(Chunk chunk) { if (currentBlock == Blocks.STONE) { // Replace with UBified version storage.set(x, y, z, currentBiome.getStrataBlockAtLayer(yPos + y + variation)); + } else if (currentBlock == Blocks.COBBLESTONE && API.SETTINGS.replaceCobblestone()) { + // Replace with UBified version + IBlockState strata = currentBiome.getStrataBlockAtLayer(yPos + y + variation); + UBStone block = (UBStone) strata.getBlock(); + storage.set(x, y, z, (StonesRegistry.INSTANCE.stoneFor(block.getStoneType(), UBStoneStyle.COBBLE).getBlock()).getStateFromMeta(block.getMetaFromState(strata))); } else { /* * Ore diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 5e700fee..0b06e641 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "undergroundbiomes", "name": "Underground Biomes", "description": "24 different kinds of stones with slabs, stairs, walls, and buttons", - "version": "1.0.0", + "version": "1.1.0", "mcversion": "1.12.2", "url": "", "updateUrl": "",