diff options
| author | Onyx <sor1n.iliutza16@gmail.com> | 2015-12-01 20:55:30 +0000 |
|---|---|---|
| committer | Onyx <sor1n.iliutza16@gmail.com> | 2015-12-01 20:55:30 +0000 |
| commit | 01c8701b68986ccfa83e902515716838d6829311 (patch) | |
| tree | b21aa78f4df6ca9bac90e2726221114a41f2294a /src/main/java/darkknight/jewelrycraft/worldGen/Generation.java | |
| parent | 35da479288f75d6686c64a00e1dc77e7e7fd50e1 (diff) | |
- Fixed all of the bugs mentioned on github
- Added new config options
- Rabbits paw now increases the chance of spawning hearts, rather than
itself spawning some
- Hearts now have a much lower chance to spawn by default
- You can no longer increase your health past 20 hearts (aka double the
default health)
- The guide now also shows the total number of pages on each tab
- A new luck stat has been added to the Curse API
- Cleaned up the code a bit (removed unused methods, imports etc)
- The displayer's info now has a purple solid color background; the text
also has a much closer shadow and now shrinks in height as well as in
width when too big
- I have modified the potion list to use Mithion's code, credits have
been given
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/worldGen/Generation.java')
| -rw-r--r-- | src/main/java/darkknight/jewelrycraft/worldGen/Generation.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java index 11d053e..93310df 100644 --- a/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java +++ b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java @@ -1,5 +1,6 @@ package darkknight.jewelrycraft.worldGen;
+import java.lang.reflect.Field;
import java.util.Random;
import cpw.mods.fml.common.IWorldGenerator;
import darkknight.jewelrycraft.block.BlockList;
@@ -43,12 +44,17 @@ public class Generation implements IWorldGenerator { if (!world.getWorldInfo().getTerrainType().equals(WorldType.FLAT)) {
if (ConfigHandler.ORE_GEN) generateShadowOre(world, random, i, j);
if (ConfigHandler.CRYSTAL_GEN) generateCrystals(world, random, i, j);
- if (ConfigHandler.STRUCTURES[0]) generateStructureOverground(STRUCTURE_1, world, random, i, j, 6, false, true);
- if (ConfigHandler.STRUCTURES[1]) generateStructureUnderground(STRUCTURE_2, world, random, i, j, 5, false, true);
- if (ConfigHandler.STRUCTURES[2]) generateStructureUnderground(STRUCTURE_3, world, random, i, j, 7, false, true);
- if (ConfigHandler.STRUCTURES[3]) generateStructureOverground(STRUCTURE_4, world, random, i, j, 10, false, true);
- if (ConfigHandler.STRUCTURES[4]) generateStructureUnderground(STRUCTURE_5, world, random, i, j, 6, false, true);
- if (ConfigHandler.STRUCTURES[5]) generateStructureOverground(STRUCTURE_6, world, random, i, j, 10, false, true);
+ try{
+ for(Field f: this.getClass().getDeclaredFields()){
+ Object obj = f.get(null);
+ if (obj instanceof WorldGenStructure && ConfigHandler.STRUCTURES[((WorldGenStructure)obj).structureNo() - 1])
+ if(((WorldGenStructure)obj).isUnderground()) generateStructureUnderground((WorldGenStructure)obj, world, random, i, j, ConfigHandler.STRUCTURES_SPAWN_CHANCE[((WorldGenStructure)obj).structureNo()-1], false, true);
+ else generateStructureOverground((WorldGenStructure)obj, world, random, i, j, ConfigHandler.STRUCTURES_SPAWN_CHANCE[((WorldGenStructure)obj).structureNo()-1], false, true);
+ }
+ }
+ catch(IllegalAccessException e){
+ throw new RuntimeException(e);
+ }
}
}
}
|
