Skip to content

Commit

Permalink
Switch the worldgen of Tainted Soil and Heat Sand to use WorldGenMina…
Browse files Browse the repository at this point in the history
…ble instead of overriding the nether. Fixes #352
  • Loading branch information
alexbegt committed Jul 21, 2017
1 parent 3843a2f commit 842026c
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 718 deletions.
36 changes: 26 additions & 10 deletions src/main/java/com/progwml6/natura/common/config/Config.java
Expand Up @@ -6,7 +6,6 @@

import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import slimeknights.mantle.pulsar.config.ForgeCFG;

Expand Down Expand Up @@ -46,12 +45,6 @@ public static boolean syncConfig()
doRetrogen = configFile.get(RETROGEN, "Retroactive Generation", doRetrogen).getBoolean(doRetrogen);
// Retrogen End

boolean BoP = false;
if (Loader.isModLoaded("BiomesOPlenty"))
{
BoP = true;
}

babyHeatscarMinimum = configFile.get(MOB_CHANGES, "Minimum Baby Heatscar Spiders on Spider Death", babyHeatscarMinimum).getInt(babyHeatscarMinimum);
if (babyHeatscarMinimum < 0)
{
Expand All @@ -64,7 +57,6 @@ public static boolean syncConfig()
babyHeatscarMaximum = 0;
}

overrideNether = configFile.get(ENABLE_DISABLE, "Override Nether", !BoP).getBoolean(!BoP);
canRespawnInNether = configFile.get(ENABLE_DISABLE, "Obelisks let players respawn in the Nether", canRespawnInNether).getBoolean(canRespawnInNether);

// Trees Start
Expand Down Expand Up @@ -204,6 +196,17 @@ public static boolean syncConfig()
ashSpawnRange = configFile.get(WORLDGEN, "Ash Cloud Spawn Range", ashSpawnRange).getInt(ashSpawnRange);
// Cloud End

// Mineable Start
generateTaintedSoil = configFile.get(ENABLE_DISABLE, "Generate Tained Soil", generateTaintedSoil).getBoolean(generateTaintedSoil);
generateHeatSand = configFile.get(ENABLE_DISABLE, "Generate Heat Sand", generateHeatSand).getBoolean(generateHeatSand);

tainedSoilClusterCount = configFile.get(WORLDGEN, "Tainted Soil Cluster Count", tainedSoilClusterCount).getInt(tainedSoilClusterCount);
heatSandClusterCount = configFile.get(WORLDGEN, "Heat Sand Cluster Count", heatSandClusterCount).getInt(heatSandClusterCount);

tainedSoilClusterSize = configFile.get(WORLDGEN, "Tainted Soil Cluster Size", tainedSoilClusterSize).getInt(tainedSoilClusterSize);
heatSandClusterSize = configFile.get(WORLDGEN, "Heat Sand Cluster Size", heatSandClusterSize).getInt(heatSandClusterSize);
// Mineable End

thornSpawnRarity = configFile.get(WORLDGEN, "Thornvines Spawn Rarity", thornSpawnRarity).getInt(thornSpawnRarity);

enableHeatscarSpider = configFile.get(ENTITIES, "Enable Heatscar Spiders", enableHeatscarSpider).getBoolean(enableHeatscarSpider);
Expand All @@ -213,11 +216,13 @@ public static boolean syncConfig()

// save changes if any
boolean changed = false;

if (configFile.hasChanged())
{
configFile.save();
changed = true;
}

return changed;
}

Expand Down Expand Up @@ -264,7 +269,6 @@ public static boolean syncConfig()
public static int seaLevel = 64;
public static int flatSeaLevel = 1;

public static boolean overrideNether = true;
public static boolean canRespawnInNether = true;

// Trees Start
Expand Down Expand Up @@ -336,10 +340,22 @@ public static boolean syncConfig()
public static int stingberrySpawnRange = 100;
// Berries End

//Overworld
// Mineables Start
public static boolean generateTaintedSoil = true;
public static boolean generateHeatSand = true;

public static int tainedSoilClusterCount = 4;
public static int heatSandClusterCount = 4;

public static int tainedSoilClusterSize = 33;
public static int heatSandClusterSize = 33;
// Mineables End

// Overworld Start
public static boolean generateBarley = true;
public static boolean generateCotton = true;
public static boolean generateBluebells = true;
// Overworld End

public static boolean generateGreenglowshroom = true;
public static boolean generatePurpleglowshroom = true;
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/progwml6/natura/world/NaturaWorld.java
Expand Up @@ -7,19 +7,17 @@
import com.progwml6.natura.common.NaturaPulse;
import com.progwml6.natura.common.config.Config;
import com.progwml6.natura.library.Util;
import com.progwml6.natura.world.dimension.WorldProviderNetherite;
import com.progwml6.natura.world.worldgen.CloudGenerator;
import com.progwml6.natura.world.worldgen.CropGenerator;
import com.progwml6.natura.world.worldgen.GlowshroomGenerator;
import com.progwml6.natura.world.worldgen.NetherBerryBushesGenerator;
import com.progwml6.natura.world.worldgen.NetherMinableGenerator;
import com.progwml6.natura.world.worldgen.NetherTreesGenerator;
import com.progwml6.natura.world.worldgen.OverworldBerryBushesGenerator;
import com.progwml6.natura.world.worldgen.OverworldTreesGenerator;
import com.progwml6.natura.world.worldgen.VineGenerator;
import com.progwml6.natura.world.worldgen.retrogen.TickHandlerWorldRetrogen;

import net.minecraft.world.DimensionType;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
Expand Down Expand Up @@ -74,11 +72,7 @@ public void postInit(FMLPostInitializationEvent event)
GameRegistry.registerWorldGenerator(GlowshroomGenerator.INSTANCE, 0);
GameRegistry.registerWorldGenerator(VineGenerator.INSTANCE, 0);

if (Config.overrideNether)
{
DimensionManager.unregisterDimension(-1);
DimensionManager.registerDimension(-1, DimensionType.register("Nether", "_nether", -1, WorldProviderNetherite.class, false));
}
GameRegistry.registerWorldGenerator(NetherMinableGenerator.INSTANCE, 0);
}

MinecraftForge.EVENT_BUS.register(TickHandlerWorldRetrogen.INSTANCE);
Expand Down

This file was deleted.

0 comments on commit 842026c

Please sign in to comment.