configurable rift gen and monolith spawn density

This commit is contained in:
StevenRS11 2013-06-16 02:59:02 -04:00
parent 0752c032d3
commit cd4679c8fd
5 changed files with 16 additions and 8 deletions

View file

@ -99,6 +99,8 @@ public class DDProperties
public final int NonTntWeight; public final int NonTntWeight;
public final int RiftSpreadModifier; public final int RiftSpreadModifier;
public final int DungeonRiftGenDensity;
public final int MonolithSpawnDensity;
public final int LimboReturnRange; public final int LimboReturnRange;
public final String CustomSchematicDirectory; public final String CustomSchematicDirectory;
@ -198,6 +200,12 @@ public class DDProperties
WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true, WorldRiftGenerationEnabled = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", true,
"Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true); "Sets whether dungeon rifts generate in dimensions other than Limbo").getBoolean(true);
MonolithSpawnDensity = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", 7,
"Sets the chance that monoliths will not spawn in a give Limbo chunk- higher values mean fewer monoliths, must be greater than 0, default is 7.").getInt();
DungeonRiftGenDensity = config.get(Configuration.CATEGORY_GENERAL, "Enable Rift World Generation", 250,
"Sets the dungeon rift density in the overworld, higher values mean less rifts, must be greater than 0. Default is 250.").getInt();
RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3, RiftSpreadModifier = config.get(Configuration.CATEGORY_GENERAL, "Rift Spread Modifier", 3,
"Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " + "Sets the number of times a rift can spread. 0 prevents rifts from spreading at all. " +
"A value greater than 5 is not recommended as the growth is exponential.").getInt(); "A value greater than 5 is not recommended as the growth is exponential.").getInt();

View file

@ -51,8 +51,8 @@ public class RiftGenerator implements IWorldGenerator
if(this.shouldGenHere) if(this.shouldGenHere)
{ {
//TODO give this a clamp int type functionality
if(random.nextInt(3500)==0) if(random.nextInt(3000+properties.DungeonRiftGenDensity*4)==0)
{ {
i=chunkX*16-random.nextInt(16); i=chunkX*16-random.nextInt(16);
k=chunkZ*16-random.nextInt(16); k=chunkZ*16-random.nextInt(16);
@ -150,7 +150,7 @@ public class RiftGenerator implements IWorldGenerator
} }
if(random.nextInt(250)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote && properties.WorldRiftGenerationEnabled) if(random.nextInt(properties.DungeonRiftGenDensity)==0&&world.provider.getDimensionName()!="PocketDim"&&!world.isRemote && properties.WorldRiftGenerationEnabled)
{ {
// System.out.println("tryingToGen"); // System.out.println("tryingToGen");
int blockID=Block.stoneBrick.blockID; int blockID=Block.stoneBrick.blockID;

View file

@ -73,7 +73,7 @@ public class SchematicLoader
public void init(LinkData link) public void init(LinkData link)
{ {
//adding default pocket //adding default pocket
String filePath=DungeonHelper.defaultBreak.schematicPath; String filePath=DungeonHelper.instance().defaultBreak.schematicPath;
if(dimHelper.dimList.containsKey(link.destDimID)) if(dimHelper.dimList.containsKey(link.destDimID))
{ {
if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null) if(dimHelper.dimList.get(link.destDimID).dungeonGenerator!=null)

View file

@ -72,10 +72,10 @@ public class DungeonHelper
public ArrayList<Integer> metadataFlipList = new ArrayList<Integer>(); public ArrayList<Integer> metadataFlipList = new ArrayList<Integer>();
public ArrayList<Integer> metadataNextList = new ArrayList<Integer>(); public ArrayList<Integer> metadataNextList = new ArrayList<Integer>();
public static DungeonGenerator defaultBreak = new DungeonGenerator(0, "/schematic/somethingBroke.schematic", true);
public DungeonGenerator defaultBreak = new DungeonGenerator(0, "/schematic/somethingBroke.schematic", true);
public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true); public DungeonGenerator defaultUp = new DungeonGenerator(0, "/schematic/simpleStairsUp.schematic", true);
private HashSet<String> dungeonTypeChecker; private HashSet<String> dungeonTypeChecker;
private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping; private Hashtable<String, ArrayList<DungeonGenerator>> dungeonTypeMapping;

View file

@ -180,7 +180,7 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
if(rand.nextInt(7)>1) if(rand.nextInt(properties.MonolithSpawnDensity)>1)
{ {
return; return;
} }