Skip to content

Commit

Permalink
配置文件😓
Browse files Browse the repository at this point in the history
  • Loading branch information
Tesseract4D committed Aug 24, 2024
1 parent 369976b commit 0119072
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ plugins {
id 'com.gtnewhorizons.gtnhconvention'
}

version = 1.0
version = "1.5.2"
32 changes: 22 additions & 10 deletions src/main/java/mods/tesseract/worleycaves/Main.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
12 changes: 6 additions & 6 deletions src/main/java/mods/tesseract/worleycaves/config/Configs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 0 additions & 10 deletions src/main/java/mods/tesseract/worleycaves/util/Reference.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0119072

Please sign in to comment.