diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-05-27 20:25:29 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-05-27 20:25:29 +1000 |
commit | adbbae7548069d7182fe9e581c8f52932f31852c (patch) | |
tree | ca81a3984dff797503c56f9253326167c5c19f49 /src/Java/gtPlusPlus | |
parent | 1f3af24b5094447bc1e62347d947f8ef02c4c130 (diff) | |
download | GT5-Unofficial-adbbae7548069d7182fe9e581c8f52932f31852c.tar.gz GT5-Unofficial-adbbae7548069d7182fe9e581c8f52932f31852c.tar.bz2 GT5-Unofficial-adbbae7548069d7182fe9e581c8f52932f31852c.zip |
% More work on the new Dimension.
Diffstat (limited to 'src/Java/gtPlusPlus')
4 files changed, 100 insertions, 89 deletions
diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/world/ChunkProviderForest.java b/src/Java/gtPlusPlus/core/world/dimensionA/world/ChunkProviderForest.java index 2fcc8c69af..d6dd8e0222 100644 --- a/src/Java/gtPlusPlus/core/world/dimensionA/world/ChunkProviderForest.java +++ b/src/Java/gtPlusPlus/core/world/dimensionA/world/ChunkProviderForest.java @@ -159,7 +159,7 @@ public class ChunkProviderForest implements IChunkProvider { if ((d15 += d16) > 0.0D) { blocks[j3 += short1] = Blocks.stone;//these can be set to custom blocks } else if (k2 * 8 + l2 < b0) { - blocks[j3 += short1] = Blocks.water;//these can be set to custom blocks + blocks[j3 += short1] = TF_Blocks.blockFluidEnder;//these can be set to custom blocks } else { blocks[j3 += short1] = null;//this is the air block i think. } diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeDarkForest.java b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeDarkForest.java index f64ca7faf5..9167189bcc 100644 --- a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeDarkForest.java +++ b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/BiomeDarkForest.java @@ -2,10 +2,15 @@ package gtPlusPlus.core.world.dimensionA.world.biomes; import java.util.Random; +import gtPlusPlus.core.world.dimensionA.world.biomes.decorators.BiomeDecoratorMod; import net.minecraft.init.Blocks; import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenTallGrass; +import net.minecraft.world.gen.feature.WorldGenerator; public class BiomeDarkForest extends ModBiomes{ + + protected BiomeDecoratorMod decorator; public BiomeDarkForest(int biomeId) { super(biomeId); @@ -18,6 +23,14 @@ public class BiomeDarkForest extends ModBiomes{ } /** + * Gets a WorldGen appropriate for this biome. + */ + @Override + public WorldGenerator getRandomWorldGenForGrass(Random random){ + return random.nextInt(2) == 0 ? new WorldGenTallGrass(Blocks.tallgrass, 1) : new WorldGenTallGrass(Blocks.tallgrass, 2); + } + + /** * Remove this to remove vines from dimension */ @Override diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorHelper.java b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorHelper.java index 3f0443ec74..d45f5e0256 100644 --- a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorHelper.java +++ b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorHelper.java @@ -1,6 +1,6 @@ package gtPlusPlus.core.world.dimensionA.world.biomes.decorators; -import gtPlusPlus.core.world.dimensionA.world.biomes.BiomeLightForest; +import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.world.dimensionA.world.biomes.ModBiomes; import net.minecraft.block.Block; import net.minecraft.init.Blocks; @@ -12,94 +12,91 @@ import net.minecraftforge.event.terraingen.DecorateBiomeEvent; public class BiomeDecoratorHelper { - private static WorldGenerator glowStone; + private static WorldGenerator Fluorite; - public BiomeDecoratorHelper(){ - // glowStone = new WorldGenMinable(Blocks.glowstone, 30, Blockss.lightStone); - } + public BiomeDecoratorHelper(){ + // glowStone = new WorldGenMinable(Blocks.glowstone, 30, Blockss.lightStone); + } - protected static void decorateBiome(BiomeGenBase biome) { - MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, BiomeDecoratorMod.chunk_X, BiomeDecoratorMod.chunk_Z)); - //perpere ores for generation - initOres(); - //GenerateOres - generateOreInBiome(biome); + protected static void decorateBiome(BiomeGenBase biome) { + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, BiomeDecoratorMod.chunk_X, BiomeDecoratorMod.chunk_Z)); + //perpere ores for generation + initOres(); + //GenerateOres + generateOreInBiome(biome); - if(biome == ModBiomes.forestLight){ - BiomeDecoratorMod.howMenyTrees = BiomeLightForest.treesPerChunk; - int i = BiomeDecoratorMod.howMenyTrees; - /** Chunk Postions **/ - int chunkX; - int chunkZ; - int y; - /** get blocks at the given locations **/ - Block block; - Block blockA; - /** Generates Small tree **/ - for(int a = 0; a < i; ++a){ - if(i == BiomeDecoratorMod.randomGenerator.nextInt(8)){ - chunkX = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; - chunkZ = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; - y = BiomeDecoratorMod.currentWorld.getTopSolidOrLiquidBlock(chunkX, chunkZ); - block = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y, chunkZ); - blockA = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y - 1, chunkZ); - if(block != Blocks.air || block != Blocks.water){ - if(blockA != Blocks.air || blockA != Blocks.water){ - BiomeDecoratorMod.smallTree.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, chunkX, y, chunkZ); - } - } - } - /** Generates Big tree **/ - if(i == BiomeDecoratorMod.randomGenerator.nextInt(15)){ - chunkX = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; - chunkZ = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; - y = BiomeDecoratorMod.currentWorld.getTopSolidOrLiquidBlock(chunkX, chunkZ); - block = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y, chunkZ); - blockA = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y - 1, chunkZ); - if(block != Blocks.air || block != Blocks.water){ - if(blockA != Blocks.air || blockA != Blocks.water){ - BiomeDecoratorMod.bigTree.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, chunkX, y, chunkZ); - } - } - } - } - if(biome == ModBiomes.forestDark){ - //GENERARTE DARK FOREST STUFF HERE - } - } - } + if(biome == ModBiomes.forestLight || biome == ModBiomes.forestDark){ + BiomeDecoratorMod.howMenyTrees = 20; + int i = BiomeDecoratorMod.howMenyTrees; + /** Chunk Postions **/ + int chunkX; + int chunkZ; + int y; + /** get blocks at the given locations **/ + Block block; + Block blockA; + /** Generates Small tree **/ + for(int a = 0; a < i; ++a){ + if(i == BiomeDecoratorMod.randomGenerator.nextInt(8)){ + chunkX = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; + chunkZ = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; + y = BiomeDecoratorMod.currentWorld.getTopSolidOrLiquidBlock(chunkX, chunkZ); + block = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y, chunkZ); + blockA = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y - 1, chunkZ); + if(block != Blocks.air || block != Blocks.water){ + if(blockA != Blocks.air || blockA != Blocks.water){ + BiomeDecoratorMod.smallTree.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, chunkX, y, chunkZ); + } + } + } + /** Generates Big tree **/ + if(i == BiomeDecoratorMod.randomGenerator.nextInt(15)){ + chunkX = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; + chunkZ = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16) + 8; + y = BiomeDecoratorMod.currentWorld.getTopSolidOrLiquidBlock(chunkX, chunkZ); + block = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y, chunkZ); + blockA = BiomeDecoratorMod.currentWorld.getBlock(chunkX, y - 1, chunkZ); + if(block != Blocks.air || block != Blocks.water){ + if(blockA != Blocks.air || blockA != Blocks.water){ + BiomeDecoratorMod.bigTree.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, chunkX, y, chunkZ); + } + } + } + } + } + } - /** - * Prepare ores for generation - */ - private static void initOres() { - //glowstone used fotr testing generation - glowStone = new WorldGenMinable(Blocks.glowstone, 30, Blocks.stone); - } + /** + * Prepare ores for generation + */ + private static void initOres() { + //glowstone used fotr testing generation + Fluorite = new WorldGenMinable(ModBlocks.blockOreFluorite, 5, Blocks.stone); + } - /** - * Geberate Ores In a Biome - * @param biome - */ - private static void generateOreInBiome(BiomeGenBase biome){ - if(biome == ModBiomes.forestLight){ - genStandardOre(20, glowStone, 0, 128); - } - } + /** + * Geberate Ores In a Biome + * @param biome + */ + private static void generateOreInBiome(BiomeGenBase biome){ + if(biome == ModBiomes.forestLight || biome == ModBiomes.forestDark){ + genStandardOre(5, Fluorite, 0, 255); + } + } - /** - * Generate ores in chunks. - * @param spawnWeight - * @param generatorToSpawn - * @param minSpawnHeight - * @param maxYSpawnHeight - */ - private static void genStandardOre(int spawnWeight, WorldGenerator generatorToSpawn, int minSpawnHeight, int maxYSpawnHeight) { - for (int l = 0; l < spawnWeight; ++l) { - int i1 = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16); - int j1 = BiomeDecoratorMod.randomGenerator.nextInt(maxYSpawnHeight - minSpawnHeight) + minSpawnHeight; - int k1 = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16); - generatorToSpawn.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, i1, j1, k1); - } - } + /** + * Generate ores in chunks. + * @param spawnWeight + * @param generatorToSpawn + * @param minSpawnHeight + * @param maxYSpawnHeight + */ + private static void genStandardOre(int spawnWeight, WorldGenerator generatorToSpawn, int minSpawnHeight, int maxYSpawnHeight) { + for (int l = 0; l < spawnWeight; ++l) { + int i1 = BiomeDecoratorMod.chunk_X + BiomeDecoratorMod.randomGenerator.nextInt(16); + int j1 = BiomeDecoratorMod.randomGenerator.nextInt(maxYSpawnHeight - minSpawnHeight) + minSpawnHeight; + int k1 = BiomeDecoratorMod.chunk_Z + BiomeDecoratorMod.randomGenerator.nextInt(16); + generatorToSpawn.generate(BiomeDecoratorMod.currentWorld, BiomeDecoratorMod.randomGenerator, i1, j1, k1); + } + } } diff --git a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorMod.java b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorMod.java index f80f9b0093..4c9b040e3a 100644 --- a/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorMod.java +++ b/src/Java/gtPlusPlus/core/world/dimensionA/world/biomes/decorators/BiomeDecoratorMod.java @@ -2,8 +2,8 @@ package gtPlusPlus.core.world.dimensionA.world.biomes.decorators; import java.util.Random; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.world.dimensionA.world.gen.*; -import gtPlusPlus.xmod.gregtech.api.objects.XSTR; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeDecorator; @@ -15,7 +15,7 @@ public class BiomeDecoratorMod extends BiomeDecorator /** The world the BiomeDecorator is currently decorating */ public static World currentWorld; /** The Biome Decorator's random number generator. */ - public static XSTR randomGenerator; + public static Random randomGenerator; /** The X-coordinate of the chunk currently being decorated */ public static int chunk_X; /** The Z-coordinate of the chunk currently being decorated */ @@ -53,7 +53,7 @@ public class BiomeDecoratorMod extends BiomeDecorator throw new RuntimeException("Already decorating!!"); } else { currentWorld = world; - randomGenerator = (XSTR) random; + randomGenerator = random; chunk_X = chunkX; chunk_Z = chunkZ; genDecorationsForBiome(biomeGenBase); @@ -68,6 +68,7 @@ public class BiomeDecoratorMod extends BiomeDecorator * @param biome */ protected void genDecorationsForBiome(BiomeGenBase biome) { + Utils.LOG_INFO("Decorating Chunk"); BiomeDecoratorHelper.decorateBiome(biome); } }
\ No newline at end of file |