diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-07-07 00:43:18 +1000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-07-07 00:43:18 +1000 |
commit | 9ebf5647af0834e57e5ebbb66aa14c87df30a7aa (patch) | |
tree | 737396bb37d5b8e9bb9a8e80a905ae4f8ad106ea /src/Java/gtPlusPlus/australia | |
parent | 0d30becbc219fc2c86234e84dae306276dafe4c6 (diff) | |
download | GT5-Unofficial-9ebf5647af0834e57e5ebbb66aa14c87df30a7aa.tar.gz GT5-Unofficial-9ebf5647af0834e57e5ebbb66aa14c87df30a7aa.tar.bz2 GT5-Unofficial-9ebf5647af0834e57e5ebbb66aa14c87df30a7aa.zip |
$ Work on Australia world generator.
Diffstat (limited to 'src/Java/gtPlusPlus/australia')
5 files changed, 469 insertions, 259 deletions
diff --git a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java index 954c25e897..dd40fccf9c 100644 --- a/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java +++ b/src/Java/gtPlusPlus/australia/GTplusplus_Australia.java @@ -2,6 +2,8 @@ package gtPlusPlus.australia; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.io.File; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.*; @@ -17,7 +19,10 @@ import gtPlusPlus.australia.gen.gt.WorldGen_Australia_Ores; import gtPlusPlus.australia.gen.gt.WorldGen_GT_Australia_Base; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.Australia; +import gtPlusPlus.xmod.gregtech.HANDLER_GT; +import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.config.Configuration; @MCVersion(value = "1.7.10") @Mod(modid = Australia.MODID, name = Australia.NAME, version = Australia.VERSION, dependencies = "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;") @@ -26,6 +31,7 @@ public class GTplusplus_Australia implements ActionListener { //Mod Instance @Mod.Instance(Australia.MODID) public static GTplusplus_Australia instance; + public static GTPP_Config sCustomWorldgenFile = null; // Dark World Handler protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1; @@ -52,6 +58,10 @@ public class GTplusplus_Australia implements ActionListener { Australian_Desert_Biome_1.preInit(event); Australian_Desert_Biome_2.preInit(event); + + + //Load/Set Custom Ore Gen + sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); } @@ -73,7 +83,10 @@ public class GTplusplus_Australia implements ActionListener { } - protected synchronized void setVars(FMLPreInitializationEvent event){ + protected synchronized void setVars(FMLPreInitializationEvent event){ + + sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); + if (DimensionManager.isDimensionRegistered(Dimension_Australia.DIMID)){ Dimension_Australia.DIMID = DimensionManager.getNextFreeDimId(); } diff --git a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java index f4d49203cd..b491928ac6 100644 --- a/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java +++ b/src/Java/gtPlusPlus/australia/chunk/ChunkProviderAustralia.java @@ -26,10 +26,11 @@ import net.minecraftforge.event.terraingen.TerrainGen; public class ChunkProviderAustralia implements IChunkProvider { private Random rand; - private NoiseGeneratorOctaves field_147431_j; - private NoiseGeneratorOctaves field_147432_k; - private NoiseGeneratorOctaves field_147429_l; - private NoiseGeneratorPerlin field_147430_m; + private NoiseGeneratorOctaves noiseGen1; + private NoiseGeneratorOctaves noiseGen2; + private NoiseGeneratorOctaves noiseGen3; + private NoiseGeneratorPerlin noiseGen4; + /** * A NoiseGeneratorOctaves used in generating terrain */ @@ -43,7 +44,7 @@ public class ChunkProviderAustralia implements IChunkProvider { * Reference to the World object. */ private World worldObj; - private WorldType field_147435_p; + private WorldType worldType; private final double[] field_147434_q; private final float[] parabolicField; private double[] stoneNoise = new double[256]; @@ -70,10 +71,11 @@ public class ChunkProviderAustralia implements IChunkProvider { * The biomes that are used to generate the chunk */ private BiomeGenBase[] biomesForGeneration; - double[] field_147427_d; - double[] field_147428_e; - double[] field_147425_f; - double[] field_147426_g; + double[] doubleArray1; + double[] doubleArray2; + double[] doubleArray3; + double[] doubleArray4; + int[][] field_73219_j = new int[32][32]; { caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, @@ -90,16 +92,16 @@ public class ChunkProviderAustralia implements IChunkProvider { public ChunkProviderAustralia(World par1World, long par2) { this.worldObj = par1World; - this.field_147435_p = par1World.getWorldInfo().getTerrainType(); + this.worldType = par1World.getWorldInfo().getTerrainType(); this.rand = new Random(par2); - this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); - this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); - this.field_147429_l = new NoiseGeneratorOctaves(this.rand, 8); - this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); + this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); + this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); + this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8); + this.noiseGen4 = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); - this.field_147434_q = new double['?']; + this.field_147434_q = new double[2500]; this.parabolicField = new float[25]; for (int j = -2; j <= 2; j++) { for (int k = -2; k <= 2; k++) @@ -108,96 +110,96 @@ public class ChunkProviderAustralia implements IChunkProvider { this.parabolicField[(j + 2 + (k + 2) * 5)] = f; } } - NoiseGenerator[] noiseGens = { this.field_147431_j, this.field_147432_k, this.field_147429_l, this.field_147430_m, this.noiseGen5, this.noiseGen6, this.mobSpawnerNoise }; + NoiseGenerator[] noiseGens = { this.noiseGen1, this.noiseGen2, this.noiseGen3, this.noiseGen4, this.noiseGen5, this.noiseGen6, this.mobSpawnerNoise }; noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens); - this.field_147431_j = ((NoiseGeneratorOctaves)noiseGens[0]); - this.field_147432_k = ((NoiseGeneratorOctaves)noiseGens[1]); - this.field_147429_l = ((NoiseGeneratorOctaves)noiseGens[2]); - this.field_147430_m = ((NoiseGeneratorPerlin)noiseGens[3]); + this.noiseGen1 = ((NoiseGeneratorOctaves)noiseGens[0]); + this.noiseGen2 = ((NoiseGeneratorOctaves)noiseGens[1]); + this.noiseGen3 = ((NoiseGeneratorOctaves)noiseGens[2]); + this.noiseGen4 = ((NoiseGeneratorPerlin)noiseGens[3]); this.noiseGen5 = ((NoiseGeneratorOctaves)noiseGens[4]); this.noiseGen6 = ((NoiseGeneratorOctaves)noiseGens[5]); this.mobSpawnerNoise = ((NoiseGeneratorOctaves)noiseGens[6]); } public void func_147424_a(int p_147424_1_, int p_147424_2_, Block[] p_147424_3_) { - byte b0 = 63; - this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10); - - func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4); - for (int k = 0; k < 4; k++) - { - int l = k * 5; - int i1 = (k + 1) * 5; - for (int j1 = 0; j1 < 4; j1++) - { - int k1 = (l + j1) * 33; - int l1 = (l + j1 + 1) * 33; - int i2 = (i1 + j1) * 33; - int j2 = (i1 + j1 + 1) * 33; - for (int k2 = 0; k2 < 32; k2++) - { - double d0 = 0.125D; - double d1 = this.field_147434_q[(k1 + k2)]; - double d2 = this.field_147434_q[(l1 + k2)]; - double d3 = this.field_147434_q[(i2 + k2)]; - double d4 = this.field_147434_q[(j2 + k2)]; - double d5 = (this.field_147434_q[(k1 + k2 + 1)] - d1) * d0; - double d6 = (this.field_147434_q[(l1 + k2 + 1)] - d2) * d0; - double d7 = (this.field_147434_q[(i2 + k2 + 1)] - d3) * d0; - double d8 = (this.field_147434_q[(j2 + k2 + 1)] - d4) * d0; - for (int l2 = 0; l2 < 8; l2++) - { - double d9 = 0.25D; - double d10 = d1; - double d11 = d2; - double d12 = (d3 - d1) * d9; - double d13 = (d4 - d2) * d9; - for (int i3 = 0; i3 < 4; i3++) - { - int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2; - short short1 = 256; - j3 -= short1; - double d14 = 0.25D; - double d16 = (d11 - d10) * d14; - double d15 = d10 - d16; - for (int k3 = 0; k3 < 4; k3++) { - if ((d15 += d16) > 0.0D) { - p_147424_3_[(j3 += short1)] = Blocks.stone; - } else if (k2 * 8 + l2 < b0) { - p_147424_3_[(j3 += short1)] = Blocks.water; - } else { - p_147424_3_[(j3 += short1)] = null; - } - } - d10 += d12; - d11 += d13; - } - d1 += d5; - d2 += d6; - d3 += d7; - d4 += d8; - } - } - } - } - } + byte b0 = 63; + this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, p_147424_1_ * 4 - 2, p_147424_2_ * 4 - 2, 10, 10); + + func_147423_a(p_147424_1_ * 4, 0, p_147424_2_ * 4); + for (int k = 0; k < 4; k++) + { + int l = k * 5; + int i1 = (k + 1) * 5; + for (int j1 = 0; j1 < 4; j1++) + { + int k1 = (l + j1) * 33; + int l1 = (l + j1 + 1) * 33; + int i2 = (i1 + j1) * 33; + int j2 = (i1 + j1 + 1) * 33; + for (int k2 = 0; k2 < 32; k2++) + { + double d0 = 0.125D; + double d1 = this.field_147434_q[(k1 + k2)]; + double d2 = this.field_147434_q[(l1 + k2)]; + double d3 = this.field_147434_q[(i2 + k2)]; + double d4 = this.field_147434_q[(j2 + k2)]; + double d5 = (this.field_147434_q[(k1 + k2 + 1)] - d1) * d0; + double d6 = (this.field_147434_q[(l1 + k2 + 1)] - d2) * d0; + double d7 = (this.field_147434_q[(i2 + k2 + 1)] - d3) * d0; + double d8 = (this.field_147434_q[(j2 + k2 + 1)] - d4) * d0; + for (int l2 = 0; l2 < 8; l2++) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + for (int i3 = 0; i3 < 4; i3++) + { + int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2; + short short1 = 256; + j3 -= short1; + double d14 = 0.25D; + double d16 = (d11 - d10) * d14; + double d15 = d10 - d16; + for (int k3 = 0; k3 < 4; k3++) { + if ((d15 += d16) > 0.0D) { + p_147424_3_[(j3 += short1)] = Blocks.stone; + } else if (k2 * 8 + l2 < b0) { + p_147424_3_[(j3 += short1)] = Blocks.water; + } else { + p_147424_3_[(j3 += short1)] = null; + } + } + d10 += d12; + d11 += d13; + } + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } public void replaceBlocksForBiome(int p_147422_1_, int p_147422_2_, Block[] p_147422_3_, byte[] p_147422_4_, BiomeGenBase[] p_147422_5_) { - ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_); - MinecraftForge.EVENT_BUS.post(event); - if (event.getResult() == Result.DENY) { - return; - } - double d0 = 0.03125D; - this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); - for (int k = 0; k < 16; k++) { - for (int l = 0; l < 16; l++) - { - BiomeGenBase biomegenbase = p_147422_5_[(l + k * 16)]; - biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[(l + k * 16)]); - } - } - } + ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_147422_1_, p_147422_2_, p_147422_3_, p_147422_5_); + MinecraftForge.EVENT_BUS.post(event); + if (event.getResult() == Result.DENY) { + return; + } + double d0 = 0.03125D; + this.stoneNoise = this.noiseGen4.func_151599_a(this.stoneNoise, p_147422_1_ * 16, p_147422_2_ * 16, 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); + for (int k = 0; k < 16; k++) { + for (int l = 0; l < 16; l++) + { + BiomeGenBase biomegenbase = p_147422_5_[(l + k * 16)]; + biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_147422_3_, p_147422_4_, p_147422_1_ * 16 + k, p_147422_2_ * 16 + l, this.stoneNoise[(l + k * 16)]); + } + } + } /** * loads or generates the chunk at the chunk location specified @@ -212,16 +214,16 @@ public class ChunkProviderAustralia implements IChunkProvider { * it will generates all the blocks for the specified chunk from the map * seed and chunk seed */ - @Override + /*@Override public Chunk provideChunk(int par1, int par2) { this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L); Block[] ablock = new Block[65536]; byte[] abyte = new byte[65536]; func_147424_a(par1, par2, ablock); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); - + replaceBlocksForBiome(par1, par2, ablock, abyte, this.biomesForGeneration); - + Chunk chunk = new Chunk(this.worldObj, ablock, abyte, par1, par2); byte[] abyte1 = chunk.getBiomeArray(); for (int k = 0; k < abyte1.length; k++) { @@ -229,105 +231,301 @@ public class ChunkProviderAustralia implements IChunkProvider { } chunk.generateSkylightMap(); return chunk; - } + }*/ + + /** + * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the + * specified chunk from the map seed and chunk seed + */ + @Override + public Chunk provideChunk(int x, int z) + { + rand.setSeed(x * 341873128712L + z * 132897987541L); + Block[] ablock = new Block[65536]; + byte[] abyte = new byte[65536]; + generateTerrain(x, z, ablock); + biomesForGeneration = worldObj.getWorldChunkManager().loadBlockGeneratorData(biomesForGeneration, x * 16, z * 16, 16, 16); + replaceBlocksForBiome(x, z, ablock, abyte, biomesForGeneration); + caveGenerator.func_151539_a(this, worldObj, x, z, ablock); + ravineGenerator.func_151539_a(this, worldObj, x, z, ablock); + villageGenerator.func_151539_a(this, worldObj, x, z, ablock); + + Chunk chunk = new Chunk(worldObj, ablock, abyte, x, z); + byte[] abyte1 = chunk.getBiomeArray(); + + for (int k = 0; k < abyte1.length; ++k) + abyte1[k] = (byte)biomesForGeneration[k].biomeID; + + chunk.generateSkylightMap(); + return chunk; + } + + public void generateTerrain(int x, int z, Block[] par3BlockArray) + { + byte b0 = 63; + biomesForGeneration = worldObj.getWorldChunkManager().getBiomesForGeneration(biomesForGeneration, x * 4 - 2, z * 4 - 2, 10, 10); + generateNoise(x * 4, 0, z * 4); + + for (int k = 0; k < 4; ++k) + { + int l = k * 5; + int i1 = (k + 1) * 5; + + for (int j1 = 0; j1 < 4; ++j1) + { + int k1 = (l + j1) * 33; + int l1 = (l + j1 + 1) * 33; + int i2 = (i1 + j1) * 33; + int j2 = (i1 + j1 + 1) * 33; + + for (int k2 = 0; k2 < 32; ++k2) + { + double d0 = 0.125D; + double d1 = field_147434_q[k1 + k2]; + double d2 = field_147434_q[l1 + k2]; + double d3 = field_147434_q[i2 + k2]; + double d4 = field_147434_q[j2 + k2]; + double d5 = (field_147434_q[k1 + k2 + 1] - d1) * d0; + double d6 = (field_147434_q[l1 + k2 + 1] - d2) * d0; + double d7 = (field_147434_q[i2 + k2 + 1] - d3) * d0; + double d8 = (field_147434_q[j2 + k2 + 1] - d4) * d0; + + for (int l2 = 0; l2 < 8; ++l2) + { + double d9 = 0.25D; + double d10 = d1; + double d11 = d2; + double d12 = (d3 - d1) * d9; + double d13 = (d4 - d2) * d9; + + for (int i3 = 0; i3 < 4; ++i3) + { + int j3 = i3 + k * 4 << 12 | 0 + j1 * 4 << 8 | k2 * 8 + l2; + short short1 = 256; + j3 -= short1; + double d14 = 0.25D; + double d16 = (d11 - d10) * d14; + double d15 = d10 - d16; + + for (int k3 = 0; k3 < 4; ++k3) + if ((d15 += d16) > 0.0D) + par3BlockArray[j3 += short1] = Blocks.stone; + else if (k2 * 8 + l2 < b0) + par3BlockArray[j3 += short1] = Blocks.water; + else + par3BlockArray[j3 += short1] = null; + + d10 += d12; + d11 += d13; + } + + d1 += d5; + d2 += d6; + d3 += d7; + d4 += d8; + } + } + } + } + } + + private void generateNoise(int x, int y, int z) + { + doubleArray4 = noiseGen6.generateNoiseOctaves(doubleArray4, x, z, 5, 5, 200.0D, 200.0D, 0.5D); + doubleArray1 = noiseGen3.generateNoiseOctaves(doubleArray1, x, y, z, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D); + doubleArray2 = noiseGen1.generateNoiseOctaves(doubleArray2, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D); + doubleArray3 = noiseGen2.generateNoiseOctaves(doubleArray3, x, y, z, 5, 33, 5, 684.412D, 684.412D, 684.412D); + int l = 0; + int i1 = 0; + for (int j1 = 0; j1 < 5; ++j1) + for (int k1 = 0; k1 < 5; ++k1) + { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + byte b0 = 2; + BiomeGenBase biomegenbase = biomesForGeneration[j1 + 2 + (k1 + 2) * 10]; + + for (int l1 = -b0; l1 <= b0; ++l1) + for (int i2 = -b0; i2 <= b0; ++i2) + { + BiomeGenBase biomegenbase1 = biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10]; + float f3 = biomegenbase1.rootHeight; + float f4 = biomegenbase1.heightVariation; + + if (worldType == WorldType.AMPLIFIED && f3 > 0.0F) + { + f3 = 1.0F + f3 * 2.0F; + f4 = 1.0F + f4 * 4.0F; + } + + float f5 = parabolicField[l1 + 2 + (i2 + 2) * 5] / (f3 + 2.0F); + + if (biomegenbase1.rootHeight > biomegenbase.rootHeight) + f5 /= 2.0F; + + f += f4 * f5; + f1 += f3 * f5; + f2 += f5; + } + + f /= f2; + f1 /= f2; + f = f * 0.9F + 0.1F; + f1 = (f1 * 4.0F - 1.0F) / 8.0F; + double d13 = doubleArray4[i1] / 8000.0D; + + if (d13 < 0.0D) + d13 = -d13 * 0.3D; + + d13 = d13 * 3.0D - 2.0D; + + if (d13 < 0.0D) + { + d13 /= 2.0D; + + if (d13 < -1.0D) + d13 = -1.0D; + + d13 /= 1.4D; + d13 /= 2.0D; + } + else + { + if (d13 > 1.0D) + d13 = 1.0D; + + d13 /= 8.0D; + } + + ++i1; + double d12 = f1; + double d14 = f; + d12 += d13 * 0.2D; + d12 = d12 * 8.5D / 8.0D; + double d5 = 8.5D + d12 * 4.0D; + + for (int j2 = 0; j2 < 33; ++j2) + { + double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14; + + if (d6 < 0.0D) + d6 *= 4.0D; + + double d7 = doubleArray2[l] / 512.0D; + double d8 = doubleArray3[l] / 512.0D; + double d9 = (doubleArray1[l] / 10.0D + 1.0D) / 2.0D; + double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6; + + if (j2 > 29) + { + double d11 = (j2 - 29) / 3.0F; + d10 = d10 * (1.0D - d11) + -10.0D * d11; + } + + field_147434_q[l] = d10; + ++l; + } + } + } private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) { - double d0 = 684.412D; - double d1 = 684.412D; - double d2 = 512.0D; - double d3 = 512.0D; - this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D); - this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D); - - this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); - - this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); - - boolean flag1 = false; - boolean flag = false; - int l = 0; - int i1 = 0; - double d4 = 8.5D; - for (int j1 = 0; j1 < 5; j1++) { - for (int k1 = 0; k1 < 5; k1++) - { - float f = 0.0F; - float f1 = 0.0F; - float f2 = 0.0F; - byte b0 = 2; - BiomeGenBase biomegenbase = this.biomesForGeneration[(j1 + 2 + (k1 + 2) * 10)]; - for (int l1 = -b0; l1 <= b0; l1++) { - for (int i2 = -b0; i2 <= b0; i2++) - { - BiomeGenBase biomegenbase1 = this.biomesForGeneration[(j1 + l1 + 2 + (k1 + i2 + 2) * 10)]; - float f3 = biomegenbase1.rootHeight; - float f4 = biomegenbase1.heightVariation; - if ((this.field_147435_p == WorldType.AMPLIFIED) && (f3 > 0.0F)) - { - f3 = 1.0F + f3 * 2.0F; - f4 = 1.0F + f4 * 4.0F; - } - float f5 = this.parabolicField[(l1 + 2 + (i2 + 2) * 5)] / (f3 + 2.0F); - if (biomegenbase1.rootHeight > biomegenbase.rootHeight) { - f5 /= 2.0F; - } - f += f4 * f5; - f1 += f3 * f5; - f2 += f5; - } - } - f /= f2; - f1 /= f2; - f = f * 0.9F + 0.1F; - f1 = (f1 * 4.0F - 1.0F) / 8.0F; - double d13 = this.field_147426_g[i1] / 8000.0D; - if (d13 < 0.0D) { - d13 = -d13 * 0.3D; - } - d13 = d13 * 3.0D - 2.0D; - if (d13 < 0.0D) - { - d13 /= 2.0D; - if (d13 < -1.0D) { - d13 = -1.0D; - } - d13 /= 1.4D; - d13 /= 2.0D; - } - else - { - if (d13 > 1.0D) { - d13 = 1.0D; - } - d13 /= 8.0D; - } - i1++; - double d12 = f1; - double d14 = f; - d12 += d13 * 0.2D; - d12 = d12 * 8.5D / 8.0D; - double d5 = 8.5D + d12 * 4.0D; - for (int j2 = 0; j2 < 33; j2++) - { - double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14; - if (d6 < 0.0D) { - d6 *= 4.0D; - } - double d7 = this.field_147428_e[l] / 512.0D; - double d8 = this.field_147425_f[l] / 512.0D; - double d9 = (this.field_147427_d[l] / 10.0D + 1.0D) / 2.0D; - double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6; - if (j2 > 29) - { - double d11 = (j2 - 29) / 3.0F; - d10 = d10 * (1.0D - d11) + -10.0D * d11; - } - this.field_147434_q[l] = d10; - l++; - } - } - } - } + double d0 = 684.412D; + double d1 = 684.412D; + double d2 = 512.0D; + double d3 = 512.0D; + this.doubleArray4 = this.noiseGen6.generateNoiseOctaves(this.doubleArray4, p_147423_1_, p_147423_3_, 5, 5, 200.0D, 200.0D, 0.5D); + this.doubleArray1 = this.noiseGen3.generateNoiseOctaves(this.doubleArray1, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 8.555150000000001D, 4.277575000000001D, 8.555150000000001D); + + this.doubleArray2 = this.noiseGen1.generateNoiseOctaves(this.doubleArray2, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + + this.doubleArray3 = this.noiseGen2.generateNoiseOctaves(this.doubleArray3, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, 684.412D, 684.412D, 684.412D); + + boolean flag1 = false; + boolean flag = false; + int l = 0; + int i1 = 0; + double d4 = 8.5D; + for (int j1 = 0; j1 < 5; j1++) { + for (int k1 = 0; k1 < 5; k1++) + { + float f = 0.0F; + float f1 = 0.0F; + float f2 = 0.0F; + byte b0 = 2; + BiomeGenBase biomegenbase = this.biomesForGeneration[(j1 + 2 + (k1 + 2) * 10)]; + for (int l1 = -b0; l1 <= b0; l1++) { + for (int i2 = -b0; i2 <= b0; i2++) + { + BiomeGenBase biomegenbase1 = this.biomesForGeneration[(j1 + l1 + 2 + (k1 + i2 + 2) * 10)]; + float f3 = biomegenbase1.rootHeight; + float f4 = biomegenbase1.heightVariation; + if ((this.worldType == WorldType.AMPLIFIED) && (f3 > 0.0F)) + { + f3 = 1.0F + f3 * 2.0F; + f4 = 1.0F + f4 * 4.0F; + } + float f5 = this.parabolicField[(l1 + 2 + (i2 + 2) * 5)] / (f3 + 2.0F); + if (biomegenbase1.rootHeight > biomegenbase.rootHeight) { + f5 /= 2.0F; + } + f += f4 * f5; + f1 += f3 * f5; + f2 += f5; + } + } + f /= f2; + f1 /= f2; + f = f * 0.9F + 0.1F; + f1 = (f1 * 4.0F - 1.0F) / 8.0F; + double d13 = this.doubleArray4[i1] / 8000.0D; + if (d13 < 0.0D) { + d13 = -d13 * 0.3D; + } + d13 = d13 * 3.0D - 2.0D; + if (d13 < 0.0D) + { + d13 /= 2.0D; + if (d13 < -1.0D) { + d13 = -1.0D; + } + d13 /= 1.4D; + d13 /= 2.0D; + } + else + { + if (d13 > 1.0D) { + d13 = 1.0D; + } + d13 /= 8.0D; + } + i1++; + double d12 = f1; + double d14 = f; + d12 += d13 * 0.2D; + d12 = d12 * 8.5D / 8.0D; + double d5 = 8.5D + d12 * 4.0D; + for (int j2 = 0; j2 < 33; j2++) + { + double d6 = (j2 - d5) * 12.0D * 128.0D / 256.0D / d14; + if (d6 < 0.0D) { + d6 *= 4.0D; + } + double d7 = this.doubleArray2[l] / 512.0D; + double d8 = this.doubleArray3[l] / 512.0D; + double d9 = (this.doubleArray1[l] / 10.0D + 1.0D) / 2.0D; + double d10 = MathHelper.denormalizeClamp(d7, d8, d9) - d6; + if (j2 > 29) + { + double d11 = (j2 - 29) / 3.0F; + d10 = d10 * (1.0D - d11) + -10.0D * d11; + } + this.field_147434_q[l] = d10; + l++; + } + } + } + } /** * Checks to see if a chunk exists at x, y @@ -342,49 +540,49 @@ public class ChunkProviderAustralia implements IChunkProvider { */ @Override public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - net.minecraft.block.BlockFalling.fallInstantly = false; - int k = par2 * 16; - int l = par3 * 16; - BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); - this.rand.setSeed(this.worldObj.getSeed()); - long i1 = this.rand.nextLong() / 2L * 2L + 1L; - long j1 = this.rand.nextLong() / 2L * 2L + 1L; - this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed()); - boolean flag = false; - - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag)); - if ((biomegenbase != BiomeGenBase.desert) && (biomegenbase != BiomeGenBase.desertHills) && (!flag)) { - if ((this.rand.nextInt(4) == 0) && - (TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAKE))) - { - int k1 = k + this.rand.nextInt(16) + 8; - int l1 = this.rand.nextInt(256); - int i2 = l + this.rand.nextInt(16) + 8; - new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); - } - } - if ((TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAVA)) && (!flag) && - (this.rand.nextInt(8) == 0)) - { - int k1 = k + this.rand.nextInt(16) + 8; - int l1 = this.rand.nextInt(this.rand.nextInt(248) + 8); - int i2 = l + this.rand.nextInt(16) + 8; - if ((l1 < 63) || (this.rand.nextInt(10) == 0)) { - new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); - } - } - int var4 = par2 * 16; - int var5 = par3 * 16; - - biomegenbase.decorate(this.worldObj, this.rand, k, l); - SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); - k += 8; - l += 8; - - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag)); - - net.minecraft.block.BlockFalling.fallInstantly = false; - } + net.minecraft.block.BlockFalling.fallInstantly = false; + int k = par2 * 16; + int l = par3 * 16; + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); + this.rand.setSeed(this.worldObj.getSeed()); + long i1 = this.rand.nextLong() / 2L * 2L + 1L; + long j1 = this.rand.nextLong() / 2L * 2L + 1L; + this.rand.setSeed(par2 * i1 + par3 * j1 ^ this.worldObj.getSeed()); + boolean flag = false; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag)); + if ((biomegenbase != BiomeGenBase.desert) && (biomegenbase != BiomeGenBase.desertHills) && (!flag)) { + if ((this.rand.nextInt(4) == 0) && + (TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAKE))) + { + int k1 = k + this.rand.nextInt(16) + 8; + int l1 = this.rand.nextInt(256); + int i2 = l + this.rand.nextInt(16) + 8; + new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); + } + } + if ((TerrainGen.populate(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag, PopulateChunkEvent.Populate.EventType.LAVA)) && (!flag) && + (this.rand.nextInt(8) == 0)) + { + int k1 = k + this.rand.nextInt(16) + 8; + int l1 = this.rand.nextInt(this.rand.nextInt(248) + 8); + int i2 = l + this.rand.nextInt(16) + 8; + if ((l1 < 63) || (this.rand.nextInt(10) == 0)) { + new WorldGenLakes(Blocks.water).generate(this.worldObj, this.rand, k1, l1, i2); + } + } + int var4 = par2 * 16; + int var5 = par3 * 16; + + biomegenbase.decorate(this.worldObj, this.rand, k, l); + SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); + k += 8; + l += 8; + + MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, this.worldObj, this.rand, par2, par3, flag)); + + net.minecraft.block.BlockFalling.fallInstantly = false; + } /** * Two modes of operation: if passed true, save all Chunks in one go. If @@ -436,11 +634,11 @@ public class ChunkProviderAustralia implements IChunkProvider { @SuppressWarnings("rawtypes") @Override public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { - BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4); - return (par1EnumCreatureType == EnumCreatureType.monster) && (this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4)) ? this.scatteredFeatureGenerator - .getScatteredFeatureSpawnList() : biomegenbase - .getSpawnableList(par1EnumCreatureType); - } + BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4); + return (par1EnumCreatureType == EnumCreatureType.monster) && (this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4)) ? this.scatteredFeatureGenerator + .getScatteredFeatureSpawnList() : biomegenbase + .getSpawnableList(par1EnumCreatureType); + } @Override public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java index 3f35758491..aaa7dcb3f5 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_Australia_Ores.java @@ -303,7 +303,7 @@ public class WorldGen_Australia_Ores { static long ID = 0; public static void generateValidOreVeins(){ - validOreveins.put(ID++, BaseVein); + validOreveins.put(ID++, BaseVein);/* validOreveins.put(ID++, Vein1); validOreveins.put(ID++, Vein2); validOreveins.put(ID++, Vein3); @@ -321,7 +321,7 @@ public class WorldGen_Australia_Ores { validOreveins.put(ID++, Vein15); validOreveins.put(ID++, Vein16); validOreveins.put(ID++, Vein17); - validOreveins.put(ID++, Vein18); + validOreveins.put(ID++, Vein18);*/ } } diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java index 8d8769fa87..93d5524a66 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia.java @@ -7,8 +7,7 @@ import java.util.concurrent.ConcurrentHashMap; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; - -import gtPlusPlus.xmod.gregtech.HANDLER_GT; +import gtPlusPlus.australia.GTplusplus_Australia; public abstract class WorldGen_GT_Australia { public final String mWorldGenName; @@ -17,7 +16,7 @@ public abstract class WorldGen_GT_Australia { public WorldGen_GT_Australia(String aName, List aList, boolean aDefault) { this.mWorldGenName = aName; - this.mEnabled = HANDLER_GT.sCustomWorldgenFile.get("worldgen-aus", this.mWorldGenName, aDefault); + this.mEnabled = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen", this.mWorldGenName, aDefault); if (this.mEnabled) { aList.add(this); } @@ -38,7 +37,7 @@ public abstract class WorldGen_GT_Australia { String aDimName = aWorld.provider.getDimensionName(); Boolean tAllowed = (Boolean) this.mDimensionMap.get(aDimName); if (tAllowed == null) { - boolean tValue = HANDLER_GT.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName, + boolean tValue = GTplusplus_Australia.sCustomWorldgenFile.get("worldgen.dimensions." + this.mWorldGenName, aDimName, aDimensionType == aAllowedDimensionType); this.mDimensionMap.put(aDimName, Boolean.valueOf(tValue)); return tValue; diff --git a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java index db6bac6e60..4011d2ce48 100644 --- a/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java +++ b/src/Java/gtPlusPlus/australia/gen/gt/WorldGen_GT_Australia_Ore_Layer.java @@ -20,12 +20,12 @@ import gregtech.common.blocks.GT_Block_Ores; import gregtech.common.blocks.GT_TileEntity_Ores; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.australia.GTplusplus_Australia; import gtPlusPlus.australia.dimension.Dimension_Australia; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; public class WorldGen_GT_Australia_Ore_Layer extends WorldGen_GT_Australia { @@ -89,9 +89,9 @@ extends WorldGen_GT_Australia { public WorldGen_GT_Australia_Ore_Layer(String aName, boolean aDefault, int aMinY, int aMaxY, int aWeight, int aDensity, int aSize, boolean aOverworld, boolean aNether, boolean aEnd, boolean GC_UNUSED1, boolean GC_UNUSED2, boolean GC_UNUSED3, Material aPrimary, Material aSecondary, Material aBetween, Material aSporadic) { super(aName, sList, aDefault); Logger.WORLD("Creating Ore Layer Object"); - this.mOverworld = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); - this.mNether = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); - this.mEnd = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); + this.mOverworld = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Overworld", aOverworld); + this.mNether = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Nether", aNether); + this.mEnd = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "TheEnd", aEnd); //this.mMoon = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Moon", aMoon); //this.mMars = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Mars", aMars); //this.mAsteroid = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Asteroid", aAsteroid); @@ -105,9 +105,9 @@ extends WorldGen_GT_Australia { mMaxY = (short) (this.mMinY + 7); } this.mMaxY = mMaxY; - this.mWeight = ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); - this.mDensity = ((short) HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); - this.mSize = ((short) Math.max(1, HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); + this.mWeight = ((short) GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RandomWeight", aWeight)); + this.mDensity = ((short) GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Density", aDensity)); + this.mSize = ((short) Math.max(1, GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "Size", aSize))); this.mPrimary = aPrimary; this.mSecondary = aSecondary; this.mBetween = aBetween; @@ -116,7 +116,7 @@ extends WorldGen_GT_Australia { this.mSecondaryMeta = aSecondary.getOreBlock(1); this.mBetweenMeta = aBetween.getOreBlock(1); this.mSporadicMeta = aSporadic.getOreBlock(1); - this.mRestrictBiome = HANDLER_GT.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); + this.mRestrictBiome = GTplusplus_Australia.sCustomWorldgenFile.get(aTextWorldgen + this.mWorldGenName, "RestrictToBiomeName", "None"); //if (mPrimaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mPrimaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mPrimaryMeta + " for " + mWorldGenName + " does not exist"); //if (mSecondaryMeta != -1 && GregTech_API.sGeneratedMaterials[(mSecondaryMeta % 1000)] == null) throw new IllegalArgumentException("A Material for the supplied ID " + mSecondaryMeta + " for " + mWorldGenName + " does not exist"); |