diff --git a/build.gradle b/build.gradle index 30f7aff..ec7f51a 100644 --- a/build.gradle +++ b/build.gradle @@ -3,4 +3,4 @@ plugins { id 'com.gtnewhorizons.gtnhconvention' } -version = 1.0 +version = "1.5.2" diff --git a/src/main/java/mods/tesseract/worleycaves/Main.java b/src/main/java/mods/tesseract/worleycaves/Main.java index 88cf165..b58ad22 100644 --- a/src/main/java/mods/tesseract/worleycaves/Main.java +++ b/src/main/java/mods/tesseract/worleycaves/Main.java @@ -1,26 +1,38 @@ package mods.tesseract.worleycaves; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import mods.tesseract.worleycaves.config.Configs; import mods.tesseract.worleycaves.event.CaveEvent; -import mods.tesseract.worleycaves.util.Reference; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, acceptableRemoteVersions="*") +@Mod(modid = "worleycaves", name = "Worley Caves", version = "1.5.2", acceptableRemoteVersions = "*") public class Main { - public static final Logger LOGGER = LogManager.getLogger(Reference.MOD_ID); + public static final Logger LOGGER = LogManager.getLogger("worleycaves"); @EventHandler public static void preInit(FMLPreInitializationEvent e) { MinecraftForge.TERRAIN_GEN_BUS.register(new CaveEvent()); - } + Configuration cfg = new Configuration(e.getSuggestedConfigurationFile()); + Configs.noiseCutoffValue = cfg.getFloat("noiseCutoffValue", "cave", Configs.noiseCutoffValue, -1f, 1f, "Controls size of caves. Smaller values = larger caves. Between -1.0 and 1.0"); + Configs.surfaceCutoffValue = cfg.getFloat("surfaceCutoffValue", "cave", Configs.surfaceCutoffValue, -1f, 1f, "Controls size of caves at the surface. Smaller values = more caves break through the surface. Between -1.0 and 1.0"); + Configs.warpAmplifier = cfg.getFloat("warpAmplifier", "cave", Configs.warpAmplifier, 0f, Float.MAX_VALUE, "Controls how much to warp caves. Lower values = straighter caves"); + Configs.easeInDepth = cfg.getInt("warpAmplifier", "cave", Configs.easeInDepth, 0, Integer.MAX_VALUE, "Reduces number of caves at surface level, becoming more common until caves generate normally X number of blocks below the surface"); + Configs.verticalCompressionMultiplier = cfg.getFloat("verticalCompressionMultiplier", "cave", Configs.verticalCompressionMultiplier, 0, Float.MAX_VALUE, "Squishes caves on the Y axis. Lower values = taller caves and more steep drops"); + Configs.horizonalCompressionMultiplier = cfg.getFloat("horizonalCompressionMultiplier", "cave", Configs.horizonalCompressionMultiplier, 0, Float.MAX_VALUE, "Streches (when < 1.0) or compresses (when > 1.0) cave generation along X and Z axis"); + Configs.blackListedDims = cfg.get("cave", "blackListedDims", Configs.blackListedDims, "Dimension IDs that will use Vanilla cave generation rather than Worley's Caves").getIntList(); + Configs.maxCaveHeight = cfg.getInt("maxCaveHeight", "cave", Configs.maxCaveHeight, 1, 256, "Caves will not attempt to generate above this y level. Range 1-256"); + Configs.minCaveHeight = cfg.getInt("minCaveHeight", "cave", Configs.minCaveHeight, 1, 256, "Caves will not attempt to generate below this y level. Range 1-256"); + Configs.lavaBlock = cfg.getString("lavaBlock", "cave", Configs.lavaBlock, "Block to use when generating large lava lakes below lavaDepth (usually y=10)"); + Configs.lavaDepth = cfg.getInt("lavaDepth", "cave", Configs.lavaDepth, 1, 256, "Air blocks at or below this y level will generate as lavaBlock"); + Configs.allowReplaceMoreBlocks = cfg.getBoolean("allowReplaceMoreBlocks", "cave", Configs.allowReplaceMoreBlocks, "Allow replacing more blocks with caves (useful for mods which completely overwrite world gen)"); + if (cfg.hasChanged()) cfg.save(); + } } diff --git a/src/main/java/mods/tesseract/worleycaves/config/Configs.java b/src/main/java/mods/tesseract/worleycaves/config/Configs.java index 29dd566..f4d0edc 100644 --- a/src/main/java/mods/tesseract/worleycaves/config/Configs.java +++ b/src/main/java/mods/tesseract/worleycaves/config/Configs.java @@ -3,19 +3,19 @@ public class Configs { - public static double noiseCutoffValue = -0.18; + public static float noiseCutoffValue = -0.18f; - public static double surfaceCutoffValue = -0.081; + public static float surfaceCutoffValue = -0.081f; - public static double warpAmplifier = 8.0; + public static float warpAmplifier = 8.0f; public static int easeInDepth = 15; - public static double verticalCompressionMultiplier = 2.0; + public static float verticalCompressionMultiplier = 2.0f; - public static double horizonalCompressionMultiplier = 1.0; + public static float horizonalCompressionMultiplier = 1.0f; - public static int[] blackListedDims = {}; + public static int[] blackListedDims = {-1}; public static int maxCaveHeight = 128; diff --git a/src/main/java/mods/tesseract/worleycaves/util/Reference.java b/src/main/java/mods/tesseract/worleycaves/util/Reference.java deleted file mode 100644 index a96e4a2..0000000 --- a/src/main/java/mods/tesseract/worleycaves/util/Reference.java +++ /dev/null @@ -1,10 +0,0 @@ -package mods.tesseract.worleycaves.util; - -public class Reference { - - public static final String MOD_ID = "worleycaves"; - public static final String NAME = "Worley Caves"; - public static final String VERSION = "1.5.2"; - public static final String CLIENT_PROXY_CLASS = "fluke.worleycaves.proxy.ClientProxy"; - public static final String COMMON_PROXY_CLASS = "fluke.worleycaves.proxy.CommonProxy"; -} diff --git a/src/main/java/mods/tesseract/worleycaves/world/WorleyCaveGenerator.java b/src/main/java/mods/tesseract/worleycaves/world/WorleyCaveGenerator.java index bddd16f..ac90085 100644 --- a/src/main/java/mods/tesseract/worleycaves/world/WorleyCaveGenerator.java +++ b/src/main/java/mods/tesseract/worleycaves/world/WorleyCaveGenerator.java @@ -46,12 +46,12 @@ public WorleyCaveGenerator() { maxCaveHeight = Configs.maxCaveHeight; minCaveHeight = Configs.minCaveHeight; - noiseCutoff = (float) Configs.noiseCutoffValue; - warpAmplifier = (float) Configs.warpAmplifier; - easeInDepth = (float) Configs.easeInDepth; - yCompression = (float) Configs.verticalCompressionMultiplier; - xzCompression = (float) Configs.horizonalCompressionMultiplier; - surfaceCutoff = (float) Configs.surfaceCutoffValue; + noiseCutoff = Configs.noiseCutoffValue; + warpAmplifier = Configs.warpAmplifier; + easeInDepth = Configs.easeInDepth; + yCompression = Configs.verticalCompressionMultiplier; + xzCompression = Configs.horizonalCompressionMultiplier; + surfaceCutoff = Configs.surfaceCutoffValue; lavaDepth = Configs.lavaDepth; lava = (Block) Block.blockRegistry.getObject(Configs.lavaBlock);