From 5715a32d2901922503fd850f3a68503fb77467c3 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Wed, 20 Dec 2017 23:39:49 +1000 Subject: - Disabled some logging. % Minor Project Clean-up, added missing Override annotations to 100+ methods & removed pointless casts. % Moved Logging to it's own class. $ Fixed Multi-block handling of Pollution. $ Fixed the GT 5.09 material enabler system. (From My Side, it's still borked on GTs). + Added a Dynamic Proxy invocation for IMaterialHandler. + Added an AutoMap data type, which is a Auto-incremental ID'd Hashmap wrapper. --- .../darkworld/biome/BiomeGenerator_Custom.java | 37 +++++++++------------- .../world/darkworld/biome/Biome_DarkWorld.java | 4 +-- .../block/blockDarkWorldPollutedDirt.java | 4 ++- .../world/darkworld/chunk/ChunkProviderModded.java | 6 ++-- .../world/darkworld/gen/WorldGenDeadLilly.java | 4 ++- .../darkworld/gen/WorldGenMinable_Custom.java | 34 ++++++++++---------- 6 files changed, 44 insertions(+), 45 deletions(-) (limited to 'src/Java/gtPlusPlus/core/world') diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java index 7bb47e4e24..0dc84b8aa3 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java @@ -1,5 +1,8 @@ package gtPlusPlus.core.world.darkworld.biome; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; + import java.util.Random; import gtPlusPlus.core.block.ModBlocks; @@ -11,23 +14,8 @@ import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeDecorator; import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.WorldGenAbstractTree; -import net.minecraft.world.gen.feature.WorldGenBigMushroom; -import net.minecraft.world.gen.feature.WorldGenCactus; -import net.minecraft.world.gen.feature.WorldGenClay; -import net.minecraft.world.gen.feature.WorldGenDeadBush; -import net.minecraft.world.gen.feature.WorldGenFlowers; -import net.minecraft.world.gen.feature.WorldGenLiquids; -import net.minecraft.world.gen.feature.WorldGenMinable; -import net.minecraft.world.gen.feature.WorldGenPumpkin; -import net.minecraft.world.gen.feature.WorldGenReed; -import net.minecraft.world.gen.feature.WorldGenSand; -import net.minecraft.world.gen.feature.WorldGenWaterlily; -import net.minecraft.world.gen.feature.WorldGenerator; - -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; -import net.minecraftforge.common.*; +import net.minecraft.world.gen.feature.*; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.*; public class BiomeGenerator_Custom extends BiomeDecorator { @@ -144,7 +132,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { this.generateLakes = true; } - public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) + @Override + public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) { if (this.currentWorld != null) { @@ -162,7 +151,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } } - protected void genDecorations(BiomeGenBase p_150513_1_) + @Override + protected void genDecorations(BiomeGenBase p_150513_1_) { MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); this.generateOres(); @@ -373,7 +363,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Standard ore generation helper. Generates most ores. */ - protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) + @Override + protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) { for (int l = 0; l < p_76795_1_; ++l) { @@ -387,7 +378,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Standard ore generation helper. Generates Lapis Lazuli. */ - protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) + @Override + protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) { for (int l = 0; l < p_76793_1_; ++l) { @@ -401,7 +393,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { /** * Generates ores in the current chunk */ - protected void generateOres() + @Override + protected void generateOres() { MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java index ccd977a87e..f90966714e 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java @@ -6,10 +6,10 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityCaveSpider; @@ -66,7 +66,7 @@ public class Biome_DarkWorld { public BiomeGenbiomeDarkWorld() { super(CORE.DARKBIOME_ID); this.theBiomeDecorator = new BiomeGenerator_Custom(); - Utils.LOG_INFO("Dark World Temperature Category: "+getTempCategory()); + Logger.INFO("Dark World Temperature Category: "+getTempCategory()); this.setBiomeName("Dark World"); this.topBlock = Dimension_DarkWorld.blockTopLayer; this.fillerBlock = Dimension_DarkWorld.blockSecondLayer; diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java index 2168677d56..5f3f7e0bfd 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldPollutedDirt.java @@ -5,7 +5,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.creative.AddToCreativeTab; import net.minecraft.block.BlockDirt; -import net.minecraft.block.BlockGrass; import net.minecraft.world.ColorizerGrass; import net.minecraft.world.IBlockAccess; @@ -19,6 +18,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { LanguageRegistry.addName(this, "Polluted Soil"); } + @Override @SideOnly(Side.CLIENT) public int getBlockColor() { @@ -30,6 +30,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { /** * Returns the color this block should be rendered. Used by leaves. */ + @Override @SideOnly(Side.CLIENT) public int getRenderColor(int p_149741_1_) { @@ -40,6 +41,7 @@ public class blockDarkWorldPollutedDirt extends BlockDirt { * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ + @Override @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { diff --git a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java index 2e5ce4510e..1695714eff 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java @@ -3,7 +3,7 @@ package gtPlusPlus.core.world.darkworld.chunk; import java.util.List; import java.util.Random; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; @@ -391,7 +391,7 @@ public class ChunkProviderModded implements IChunkProvider { } catch (NullPointerException n){ n.getStackTrace(); (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); - Utils.LOG_INFO("Error while generating DarkWorld Lake."); + Logger.INFO("Error while generating DarkWorld Lake."); } } @@ -406,7 +406,7 @@ public class ChunkProviderModded implements IChunkProvider { try{ (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); } catch (NullPointerException n){ - Utils.LOG_INFO("Error while generating DarkWorld Lake. [2]"); + Logger.INFO("Error while generating DarkWorld Lake. [2]"); } } } diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java index 292eff3289..22c3b5a090 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java @@ -1,13 +1,15 @@ package gtPlusPlus.core.world.darkworld.gen; import java.util.Random; + import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenWaterlily; public class WorldGenDeadLilly extends WorldGenWaterlily { - public boolean generate(World world, Random rand, int x, int y, int z) + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { for (int l = 0; l < 10; ++l) { diff --git a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java index 4dc033214f..f78ace8a16 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java @@ -1,6 +1,7 @@ package gtPlusPlus.core.world.darkworld.gen; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; @@ -34,24 +35,25 @@ public class WorldGenMinable_Custom extends WorldGenMinable this.mineableBlockMeta = meta; } - public boolean generate(World world, Random rand, int x, int y, int z) + @Override + public boolean generate(World world, Random rand, int x, int y, int z) { float f = rand.nextFloat() * (float)Math.PI; - double d0 = (double)((float)(x + 16) + MathHelper.sin(f) * (float)this.numberOfBlocks / 4.0F); - double d1 = (double)((float)(x + 16) - MathHelper.sin(f) * (float)this.numberOfBlocks / 4.0F); - double d2 = (double)((float)(z + 16) + MathHelper.cos(f) * (float)this.numberOfBlocks / 4.0F); - double d3 = (double)((float)(z + 16) - MathHelper.cos(f) * (float)this.numberOfBlocks / 4.0F); - double d4 = (double)(y + rand.nextInt(5) - 2); - double d5 = (double)(y + rand.nextInt(5) - 2); + double d0 = x + 16 + MathHelper.sin(f) * this.numberOfBlocks / 4.0F; + double d1 = x + 16 - MathHelper.sin(f) * this.numberOfBlocks / 4.0F; + double d2 = z + 16 + MathHelper.cos(f) * this.numberOfBlocks / 4.0F; + double d3 = z + 16 - MathHelper.cos(f) * this.numberOfBlocks / 4.0F; + double d4 = y + rand.nextInt(5) - 2; + double d5 = y + rand.nextInt(5) - 2; for (int l = 0; l <= this.numberOfBlocks; ++l) { - double d6 = d0 + (d1 - d0) * (double)l / (double)this.numberOfBlocks; - double d7 = d4 + (d5 - d4) * (double)l / (double)this.numberOfBlocks; - double d8 = d2 + (d3 - d2) * (double)l / (double)this.numberOfBlocks; - double d9 = rand.nextDouble() * (double)this.numberOfBlocks / 8.0D; - double d10 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; - double d11 = (double)(MathHelper.sin((float)l * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + double d6 = d0 + (d1 - d0) * l / this.numberOfBlocks; + double d7 = d4 + (d5 - d4) * l / this.numberOfBlocks; + double d8 = d2 + (d3 - d2) * l / this.numberOfBlocks; + double d9 = rand.nextDouble() * this.numberOfBlocks / 8.0D; + double d10 = (MathHelper.sin(l * (float)Math.PI / this.numberOfBlocks) + 1.0F) * d9 + 1.0D; + double d11 = (MathHelper.sin(l * (float)Math.PI / this.numberOfBlocks) + 1.0F) * d9 + 1.0D; int i1 = MathHelper.floor_double(d6 - d10 / 2.0D); int j1 = MathHelper.floor_double(d7 - d11 / 2.0D); int k1 = MathHelper.floor_double(d8 - d10 / 2.0D); @@ -61,19 +63,19 @@ public class WorldGenMinable_Custom extends WorldGenMinable for (int k2 = i1; k2 <= l1; ++k2) { - double d12 = ((double)k2 + 0.5D - d6) / (d10 / 2.0D); + double d12 = (k2 + 0.5D - d6) / (d10 / 2.0D); if (d12 * d12 < 1.0D) { for (int l2 = j1; l2 <= i2; ++l2) { - double d13 = ((double)l2 + 0.5D - d7) / (d11 / 2.0D); + double d13 = (l2 + 0.5D - d7) / (d11 / 2.0D); if (d12 * d12 + d13 * d13 < 1.0D) { for (int i3 = k1; i3 <= j2; ++i3) { - double d14 = ((double)i3 + 0.5D - d8) / (d10 / 2.0D); + double d14 = (i3 + 0.5D - d8) / (d10 / 2.0D); if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && world.getBlock(k2, l2, i3).isReplaceableOreGen(world, k2, l2, i3, blockToReplace)) { -- cgit From ecc60485f31011bf9cc6a02edb985fb683793bb7 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 21 Dec 2017 15:48:47 +1000 Subject: + Added a dimension ID config option which it now will try use if available. % More work on the Dimension again. $ Fixed NPE caused by disabled material handler. $ Fixed bad fluid used in world generation. # Fixed spawn rate of mobs in custom dimension. --- .../core/world/darkworld/Dimension_DarkWorld.java | 11 +-- .../world/darkworld/biome/Biome_DarkWorld.java | 84 ++++++++++--------- .../darkworld/block/DarkWorldContentLoader.java | 68 +++++++++++++++ .../darkworld/block/blockDarkWorldSludgeFluid.java | 98 ++++++++++++++++++++++ .../world/darkworld/chunk/ChunkProviderModded.java | 7 +- 5 files changed, 221 insertions(+), 47 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java (limited to 'src/Java/gtPlusPlus/core/world') diff --git a/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java index 71d0e59492..22b8973cdb 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java @@ -5,23 +5,20 @@ import java.util.Random; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.world.darkworld.block.*; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.world.darkworld.block.blockDarkWorldPortal; import gtPlusPlus.core.world.darkworld.item.itemDarkWorldPortalTrigger; import gtPlusPlus.core.world.darkworld.world.WorldProviderMod; import net.minecraft.block.Block; import net.minecraft.init.Blocks; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; -@SuppressWarnings("unchecked") public class Dimension_DarkWorld { public Object instance; - public static int DIMID = 227; + public static int DIMID = CORE.DARKWORLD_ID; public static blockDarkWorldPortal portalBlock; public static itemDarkWorldPortalTrigger portalItem; @@ -29,7 +26,7 @@ public class Dimension_DarkWorld { public static Block blockSecondLayer; public static Block blockMainFiller = Blocks.stone; public static Block blockSecondaryFiller; - public static Block blockFluidLakes = ModBlocks.blockFluidSludge; + public static Block blockFluidLakes; public static Block blockPortalFrame; diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java index f90966714e..2970a2c3de 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.world.darkworld.biome; +import java.lang.reflect.Field; import java.util.Random; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @@ -10,16 +11,10 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.core.world.darkworld.Dimension_DarkWorld; -import net.minecraft.entity.monster.EntityBlaze; -import net.minecraft.entity.monster.EntityCaveSpider; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.monster.EntityEnderman; -import net.minecraft.entity.monster.EntityGhast; -import net.minecraft.entity.monster.EntitySkeleton; -import net.minecraft.entity.monster.EntitySpider; -import net.minecraft.entity.monster.EntityZombie; -import net.minecraft.entity.passive.*; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -28,7 +23,7 @@ import net.minecraftforge.common.BiomeManager; public class Biome_DarkWorld { - public static BiomeGenbiomeDarkWorld biome = new BiomeGenbiomeDarkWorld(); + public static BiomeGenDarkWorld biome = new BiomeGenDarkWorld(); public Object instance; @@ -38,8 +33,6 @@ public class Biome_DarkWorld { public void load() { BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DEAD); BiomeManager.addSpawnBiome(biome); - // BiomeManager.desertBiomes.add(new BiomeManager.BiomeEntry(biome, - // 10)); } public void generateNether(World world, Random random, int chunkX, int chunkZ) { @@ -61,10 +54,11 @@ public class Biome_DarkWorld { public void preInit(FMLPreInitializationEvent event) { } - static class BiomeGenbiomeDarkWorld extends BiomeGenBase { + static class BiomeGenDarkWorld extends BiomeGenBase { @SuppressWarnings("unchecked") - public BiomeGenbiomeDarkWorld() { + public BiomeGenDarkWorld() { super(CORE.DARKBIOME_ID); + this.setBiomeID(); this.theBiomeDecorator = new BiomeGenerator_Custom(); Logger.INFO("Dark World Temperature Category: "+getTempCategory()); this.setBiomeName("Dark World"); @@ -82,29 +76,41 @@ public class Biome_DarkWorld { this.spawnableCreatureList.clear(); this.spawnableWaterCreatureList.clear(); this.spawnableCaveCreatureList.clear(); - - //Enemies - this.spawnableMonsterList.add(new SpawnListEntry(EntitySickBlaze.class, 10, 4, 10)); - this.spawnableMonsterList.add(new SpawnListEntry(EntitySickBlaze.class, 60, 1, 2)); - this.spawnableMonsterList.add(new SpawnListEntry(EntityStaballoyConstruct.class, 30, 1, 2)); - //this.spawnableMonsterList.add(new SpawnListEntry(EntityStaballoyConstruct.class, 5, 1, 5)); - - addToMonsterSpawnLists(EntityBlaze.class, 5, 1, 5); - addToMonsterSpawnLists(EntityCaveSpider.class, 5, 1, 5); - addToMonsterSpawnLists(EntityCreeper.class, 4, 1, 2); - addToMonsterSpawnLists(EntityEnderman.class, 5, 1, 5); - addToMonsterSpawnLists(EntitySkeleton.class, 5, 1, 5); - addToMonsterSpawnLists(EntitySpider.class, 5, 1, 5); - addToMonsterSpawnLists(EntityZombie.class, 5, 1, 5); - - //Passive - this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5, 5, 10)); - this.spawnableCreatureList.add(new SpawnListEntry(EntityBat.class, 4, 4, 8)); - this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 10)); - - //Water - this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 5, 1, 10)); - + + //Enemies + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySickBlaze.class, 100, 4, 4)); + this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityStaballoyConstruct.class, 80, 1, 2)); + + //Animals + this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); + this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8)); + + } + + private synchronized boolean setBiomeID() { + BiomeGenBase[] mTempList; + try { + Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); + Field mClone = mInternalBiomeList; + mTempList = (BiomeGenBase[]) mInternalBiomeList.get(null); + if (mTempList != null){ + mTempList[CORE.DARKBIOME_ID] = this; + mInternalBiomeList.set(null, mTempList); + if (mClone != mInternalBiomeList && mClone.hashCode() != mInternalBiomeList.hashCode()){ + ReflectionUtils.setFinalStatic(mInternalBiomeList, mTempList); + Logger.REFLECTION("Set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); + return true; + } + else { + Logger.REFLECTION("Failed to set Biome ID for Dark World Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); + } + } + return false; + } + catch (Exception e) { + Logger.REFLECTION("Could not access 'biomeList' field in "+BiomeGenBase.class.getCanonicalName()+"."); + return false; + } } @SideOnly(Side.CLIENT) @@ -122,8 +128,8 @@ public class Biome_DarkWorld { public int getSkyColorByTemp(float par1) { return 0xF67A14; } - - @SuppressWarnings("unchecked") + + @SuppressWarnings({ "unchecked", "unused" }) private boolean addToMonsterSpawnLists(Class EntityClass, int a, int b, int c){ //this.spawnableMonsterList.add(new SpawnListEntry(EntityClass, a, b, c)); this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c)); diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java b/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java new file mode 100644 index 0000000000..1af92c0d3f --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java @@ -0,0 +1,68 @@ +package gtPlusPlus.core.world.darkworld.block; + +import static gtPlusPlus.core.world.darkworld.Dimension_DarkWorld.*; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.block.base.BlockBaseFluid; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.world.darkworld.item.itemDarkWorldPortalTrigger; +import net.minecraft.init.Blocks; +import net.minecraftforge.fluids.FluidRegistry; + +public class DarkWorldContentLoader { + + //Static Vars + public static blockDarkWorldSludgeFluid SLUDGE; + + + public synchronized static void run() { + initMisc(); + initItems(); + initBlocks(); + } + + public synchronized static boolean initMisc(){ + + //Fluids + SLUDGE = (blockDarkWorldSludgeFluid) new blockDarkWorldSludgeFluid( + "sludge", + Utils.rgbtoHexValue(30, 130, 30)) + .setDensity(1800) + .setGaseous(false) + .setLuminosity(2) + .setViscosity(25000) + .setTemperature(300); + FluidRegistry.registerFluid(SLUDGE); + + return true; + } + + public synchronized static boolean initItems(){ + portalItem = (itemDarkWorldPortalTrigger) (new itemDarkWorldPortalTrigger().setUnlocalizedName("dimensionDarkWorld_trigger")); + GameRegistry.registerItem(portalItem, "dimensionDarkWorld_trigger"); + + return true; + } + + public synchronized static boolean initBlocks(){ + + //Create Block Instances + blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, blockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f).setLightOpacity(1); + portalBlock = new blockDarkWorldPortal(); + blockTopLayer = new blockDarkWorldGround(); + blockSecondLayer = new blockDarkWorldPollutedDirt(); + blockPortalFrame = new blockDarkWorldPortalFrame(); + + //Registry + GameRegistry.registerBlock(blockTopLayer, "blockDarkWorldGround"); + GameRegistry.registerBlock(blockSecondLayer, "blockDarkWorldGround2"); + GameRegistry.registerBlock(blockPortalFrame, "blockDarkWorldPortalFrame"); + + //Make Flammable + Blocks.fire.setFireInfo(blockTopLayer, 30, 20); + + return true; + } + + +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java new file mode 100644 index 0000000000..c3c9beddc8 --- /dev/null +++ b/src/Java/gtPlusPlus/core/world/darkworld/block/blockDarkWorldSludgeFluid.java @@ -0,0 +1,98 @@ +package gtPlusPlus.core.world.darkworld.block; + +import net.minecraft.block.material.*; +import net.minecraftforge.fluids.Fluid; + +public class blockDarkWorldSludgeFluid extends Fluid { + + + public static final Material SLUDGE = new MaterialLiquid(MapColor.dirtColor); + + protected static int mapColor = 0xFFFFFFFF; + protected static float overlayAlpha = 0.2F; + //protected static SoundEvent emptySound = SoundEvents.ITEM_BUCKET_EMPTY; + //protected static SoundEvent fillSound = SoundEvents.ITEM_BUCKET_FILL; + protected static Material material = SLUDGE; + + + public blockDarkWorldSludgeFluid(String fluidName, int rgbColour) { + this(fluidName, rgbColour, null); + } + + public blockDarkWorldSludgeFluid(String fluidName, int rgbColour, Float overlayAlpha) { + super(fluidName); + setColor(rgbColour); + if (overlayAlpha != null){ + setAlpha(overlayAlpha.floatValue()); + } + else { + setAlpha(0); + } + } + + @Override + public int getColor() + { + return mapColor; + } + + public blockDarkWorldSludgeFluid setColor(int parColor) + { + mapColor = parColor; + return this; + } + + public float getAlpha() + { + return overlayAlpha; + } + + public blockDarkWorldSludgeFluid setAlpha(float parOverlayAlpha) + { + overlayAlpha = parOverlayAlpha; + return this; + } + + /*public blockDarkWorldSludgeFluid setEmptySound(SoundEvent parSound) + { + emptySound = parSound; + return this; + } + + public SoundEvent getEmptySound() + { + return emptySound; + } + + @Override + public blockDarkWorldSludgeFluid setFillSound(SoundEvent parSound) + { + fillSound = parSound; + return this; + } + + @Override + public SoundEvent getFillSound() + { + return fillSound; + }*/ + + public blockDarkWorldSludgeFluid setMaterial(Material parMaterial) + { + material = parMaterial; + return this; + } + + public Material getMaterial() + { + return material; + } + + /*@Override + public boolean doesVaporize(FluidStack fluidStack) + { + if (block == null) + return false; + return block.getDefaultState().getMaterial() == getMaterial(); + }*/ +} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java index 1695714eff..82b21d7c0d 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java @@ -171,7 +171,12 @@ public class ChunkProviderModded implements IChunkProvider { p_147424_3_[j3 += short1] = Dimension_DarkWorld.blockMainFiller; } else if (k2 * 8 + l2 < b0) { - p_147424_3_[j3 += short1] = Blocks.water; //River Fluid + try { + p_147424_3_[j3 += short1] = Dimension_DarkWorld.blockFluidLakes; //River Fluid . + } + catch (Throwable t){ + p_147424_3_[j3 += short1] = Blocks.water; //River Fluid Fallback + } } else { p_147424_3_[j3 += short1] = null; -- cgit From cf044120cad3ff1aa2fd40b4ae8989f7e898546e Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Thu, 21 Dec 2017 19:16:36 +1000 Subject: + Added a better Ai and combat mechanics to the Staballoy Constructs. + Tried to implement new World generation for my dimension. % Small tweak to gitignore. --- .../darkworld/biome/BiomeGenerator_Custom.java | 803 +++++++++++---------- .../world/darkworld/biome/Biome_DarkWorld.java | 9 +- .../darkworld/block/DarkWorldContentLoader.java | 2 +- .../darkworld/gen/WorldGenMinable_Custom.java | 142 ++-- .../world/darkworld/gen/gt/WorldGen_GT_Base.java | 412 +++++++++++ .../darkworld/gen/gt/WorldGen_GT_Ore_Layer.java | 272 +++++++ 6 files changed, 1172 insertions(+), 468 deletions(-) create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java create mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Ore_Layer.java (limited to 'src/Java/gtPlusPlus/core/world') diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java index 0dc84b8aa3..e6425ca4cb 100644 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java +++ b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java @@ -5,11 +5,9 @@ import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.Ev import java.util.Random; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.world.darkworld.gen.WorldGenDeadLilly; import gtPlusPlus.core.world.darkworld.gen.WorldGenMinable_Custom; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeDecorator; @@ -19,406 +17,429 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.*; public class BiomeGenerator_Custom extends BiomeDecorator { - /** The world the BiomeDecorator is currently decorating */ - public World currentWorld; - /** The Biome Decorator's random number generator. */ - public Random randomGenerator; - /** The X-coordinate of the chunk currently being decorated */ - public int chunk_X; - /** The Z-coordinate of the chunk currently being decorated */ - public int chunk_Z; - /** The clay generator. */ - public WorldGenerator clayGen = new WorldGenClay(4); - /** The sand generator. */ - public WorldGenerator sandGen; - /** The gravel generator. */ - public WorldGenerator gravelAsSandGen; - /** The dirt generator. */ - public WorldGenerator dirtGen; - public WorldGenerator gravelGen; - public WorldGenerator coalGen; - public WorldGenerator ironGen; - /** Field that holds gold WorldGenMinable */ - public WorldGenerator goldGen; - /** Field that holds redstone WorldGenMinable */ - public WorldGenerator redstoneGen; - /** Field that holds diamond WorldGenMinable */ - public WorldGenerator diamondGen; - /** Field that holds Lapis WorldGenMinable */ - public WorldGenerator lapisGen; - public WorldGenFlowers yellowFlowerGen; - /** Field that holds mushroomBrown WorldGenFlowers */ - public WorldGenerator mushroomBrownGen; - /** Field that holds mushroomRed WorldGenFlowers */ - public WorldGenerator mushroomRedGen; - /** Field that holds big mushroom generator */ - public WorldGenerator bigMushroomGen; - /** Field that holds WorldGenReed */ - public WorldGenerator reedGen; - /** Field that holds WorldGenCactus */ - public WorldGenerator cactusGen; - /** The water lily generation! */ - public WorldGenerator waterlilyGen; - /** Amount of waterlilys per chunk. */ - public int waterlilyPerChunk; - /** The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. */ - public int treesPerChunk; - /** - * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since - * it attempts to generate them at a random altitude. - */ - public int flowersPerChunk; - /** The amount of tall grass to generate per chunk. */ - public int grassPerChunk; - /** The number of dead bushes to generate per chunk. Used in deserts and swamps. */ - public int deadBushPerChunk; - /** - * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 - * this number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. - */ - public int mushroomsPerChunk; - /** The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. */ - public int reedsPerChunk; - /** The number of cactus plants to generate per chunk. Cacti only work on sand. */ - public int cactiPerChunk; - /** The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. */ - public int sandPerChunk; - /** - * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There - * appear to be two separate fields for this. - */ - public int sandPerChunk2; - /** The number of clay patches to generate per chunk. Only generates when part of it is underwater. */ - public int clayPerChunk; - /** Amount of big mushrooms per chunk */ - public int bigMushroomsPerChunk; - /** True if decorator should generate surface lava & water */ - public boolean generateLakes; - - public WorldGenerator fluoriteGen; - - public BiomeGenerator_Custom(){ - //Basic Blocks - this.sandGen = new WorldGenMinable_Custom(Blocks.sand, 12); - this.gravelAsSandGen = new WorldGenMinable_Custom(Blocks.gravel, 8); - this.dirtGen = new WorldGenMinable_Custom(Blocks.dirt, 32); - this.gravelGen = new WorldGenMinable_Custom(Blocks.gravel, 12); - - - //Oregen - this.coalGen = new WorldGenMinable_Custom(Blocks.coal_ore, 16); - this.ironGen = new WorldGenMinable_Custom(Blocks.iron_ore, 12); - this.goldGen = new WorldGenMinable_Custom(Blocks.gold_ore, 12); - this.redstoneGen = new WorldGenMinable_Custom(Blocks.redstone_ore, 10); - this.diamondGen = new WorldGenMinable_Custom(Blocks.diamond_ore, 12); - this.lapisGen = new WorldGenMinable_Custom(Blocks.lapis_ore, 8); - this.fluoriteGen = new WorldGenMinable_Custom(ModBlocks.blockOreFluorite, 20); - - //Nature - this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower); - this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom); - this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom); - this.bigMushroomGen = new WorldGenBigMushroom(); - this.reedGen = new WorldGenReed(); - this.cactusGen = new WorldGenCactus(); - this.waterlilyGen = new WorldGenDeadLilly(); - - this.flowersPerChunk = 1; - this.grassPerChunk = 5; - this.sandPerChunk = 3; - this.sandPerChunk2 = 5; - this.clayPerChunk = 7; - - this.generateLakes = true; - } - - @Override - public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) - { - if (this.currentWorld != null) - { - throw new RuntimeException("Already decorating!!"); - } - else - { - this.currentWorld = p_150512_1_; - this.randomGenerator = p_150512_2_; - this.chunk_X = p_150512_4_; - this.chunk_Z = p_150512_5_; - this.genDecorations(p_150512_3_); - this.currentWorld = null; - this.randomGenerator = null; - } - } - - @Override - protected void genDecorations(BiomeGenBase p_150513_1_) - { - MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); - this.generateOres(); - int i; - int j; - int k; - - boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); - for (i = 0; doGen && i < this.sandPerChunk2; ++i) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.sandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); - for (i = 0; doGen && i < this.clayPerChunk; ++i) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.clayGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); - for (i = 0; doGen && i < this.sandPerChunk; ++i) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); - } - - i = this.treesPerChunk; - - if (this.randomGenerator.nextInt(10) == 0) - { - ++i; - } - - int l; - int i1; + /** The world the BiomeDecorator is currently decorating */ + public World currentWorld; + /** The Biome Decorator's random number generator. */ + public Random randomGenerator; + /** The X-coordinate of the chunk currently being decorated */ + public int chunk_X; + /** The Z-coordinate of the chunk currently being decorated */ + public int chunk_Z; + /** The clay generator. */ + public WorldGenerator clayGen = new WorldGenClay(4); + /** The sand generator. */ + public WorldGenerator sandGen; + /** The gravel generator. */ + public WorldGenerator gravelAsSandGen; + /** The dirt generator. */ + public WorldGenerator dirtGen; + public WorldGenerator gravelGen; + public WorldGenerator coalGen; + public WorldGenerator ironGen; + /** Field that holds gold WorldGenMinable */ + public WorldGenerator goldGen; + /** Field that holds redstone WorldGenMinable */ + public WorldGenerator redstoneGen; + /** Field that holds diamond WorldGenMinable */ + public WorldGenerator diamondGen; + /** Field that holds Lapis WorldGenMinable */ + public WorldGenerator lapisGen; + public WorldGenFlowers yellowFlowerGen; + /** Field that holds mushroomBrown WorldGenFlowers */ + public WorldGenerator mushroomBrownGen; + /** Field that holds mushroomRed WorldGenFlowers */ + public WorldGenerator mushroomRedGen; + /** Field that holds big mushroom generator */ + public WorldGenerator bigMushroomGen; + /** Field that holds WorldGenReed */ + public WorldGenerator reedGen; + /** Field that holds WorldGenCactus */ + public WorldGenerator cactusGen; + /** The water lily generation! */ + public WorldGenerator waterlilyGen; + /** Amount of waterlilys per chunk. */ + public int waterlilyPerChunk; + /** The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. */ + public int treesPerChunk; + /** + * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since + * it attempts to generate them at a random altitude. + */ + public int flowersPerChunk; + /** The amount of tall grass to generate per chunk. */ + public int grassPerChunk; + /** The number of dead bushes to generate per chunk. Used in deserts and swamps. */ + public int deadBushPerChunk; + /** + * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 + * this number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. + */ + public int mushroomsPerChunk; + /** The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. */ + public int reedsPerChunk; + /** The number of cactus plants to generate per chunk. Cacti only work on sand. */ + public int cactiPerChunk; + /** The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. */ + public int sandPerChunk; + /** + * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There + * appear to be two separate fields for this. + */ + public int sandPerChunk2; + /** The number of clay patches to generate per chunk. Only generates when part of it is underwater. */ + public int clayPerChunk; + /** Amount of big mushrooms per chunk */ + public int bigMushroomsPerChunk; + /** True if decorator should generate surface lava & water */ + public boolean generateLakes; + + public WorldGenerator fluoriteGen; + + public BiomeGenerator_Custom(){ + //Basic Blocks + this.sandGen = new WorldGenMinable(Blocks.sand, 12); + this.gravelAsSandGen = new WorldGenMinable(Blocks.gravel, 8); + this.dirtGen = new WorldGenMinable(Blocks.dirt, 32); + this.gravelGen = new WorldGenMinable(Blocks.gravel, 12); + + + //Oregen + this.coalGen = new WorldGenMinable_Custom(Blocks.coal_ore, 32); + this.ironGen = new WorldGenMinable_Custom(Blocks.iron_ore, 16); + this.goldGen = new WorldGenMinable_Custom(Blocks.gold_ore, 16); + this.redstoneGen = new WorldGenMinable_Custom(Blocks.redstone_ore, 16); + this.diamondGen = new WorldGenMinable_Custom(Blocks.diamond_ore, 24); + this.lapisGen = new WorldGenMinable_Custom(Blocks.lapis_ore, 24); + this.fluoriteGen = new WorldGenMinable_Custom(ModBlocks.blockOreFluorite, 24); + +/* //Nature + this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower); + this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom); + this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom); + this.bigMushroomGen = new WorldGenBigMushroom(); + this.reedGen = new WorldGenReed(); + this.cactusGen = new WorldGenCactus(); + this.waterlilyGen = new WorldGenDeadLilly(); +*/ + + this.grassPerChunk = 1; + this.sandPerChunk = 6; + this.sandPerChunk2 = 8; + this.clayPerChunk = 4; + this.treesPerChunk = 12; + + this.generateLakes = true; + } - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); - for (j = 0; doGen && j < i; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = this.currentWorld.getHeightValue(k, l); - WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator); - worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D); - - if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) - { - worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l); - } - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM); - for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l); - } + @Override + public void decorateChunk(World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) + { + Logger.WORLD("Trying to decorate world, using BBS randomization."); + if (this.currentWorld != null) + { + //throw new RuntimeException("Already decorating!!"); + } + else + { + this.currentWorld = p_150512_1_; + //this.randomGenerator = CSPRNG.generate(); + this.randomGenerator = p_150512_2_; + this.chunk_X = p_150512_4_; + this.chunk_Z = p_150512_5_; + this.genDecorations(p_150512_3_); + this.currentWorld = null; + this.randomGenerator = null; + } + } - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); - for (j = 0; doGen && j < this.flowersPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32); - String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l); - BlockFlower blockflower = BlockFlower.func_149857_e(s); - - if (blockflower.getMaterial() != Material.air) - { - this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s)); - this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); + @Override + protected void genDecorations(BiomeGenBase p_150513_1_) + { + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); + this.generateOres(); + Logger.WORLD("Just Tried to generate ores."); + int i; + int j; + int k; + + boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); + for (i = 0; doGen && i < this.sandPerChunk2; ++i) + { + Logger.WORLD("Sand generation."); + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.sandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); + for (i = 0; doGen && i < this.clayPerChunk; ++i) + { + Logger.WORLD("Clay generation."); + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.clayGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); + for (i = 0; doGen && i < this.sandPerChunk; ++i) + { + Logger.WORLD("Sand generation 2."); + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.gravelAsSandGen.generate(this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); + } + + i = this.treesPerChunk; + + if (this.randomGenerator.nextInt(10) == 0) + { + ++i; + } + + int l; + int i1; + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); + for (j = 0; doGen && j < i; ++j) + { + Logger.WORLD("Tree generation."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = this.currentWorld.getHeightValue(k, l); + WorldGenAbstractTree worldgenabstracttree = p_150513_1_.func_150567_a(this.randomGenerator); + worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D); + + if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, k, i1, l)) + { + worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, k, i1, l); + } + } + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, BIG_SHROOM); + for (j = 0; doGen && j < this.bigMushroomsPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l); + }*/ + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); + for (j = 0; doGen && j < this.flowersPerChunk; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) + 32); + String s = p_150513_1_.func_150572_a(this.randomGenerator, k, i1, l); + BlockFlower blockflower = BlockFlower.func_149857_e(s); + + if (blockflower.getMaterial() != Material.air) + { + this.yellowFlowerGen.func_150550_a(blockflower, BlockFlower.func_149856_f(s)); + this.yellowFlowerGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + }*/ + + /* doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS); for (j = 0; doGen && j < this.grassPerChunk; ++j) { + Logger.WORLD("Grass generation."); k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); WorldGenerator worldgenerator = p_150513_1_.getRandomWorldGenForGrass(this.randomGenerator); worldgenerator.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); - for (j = 0; doGen && j < this.deadBushPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); - (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); - for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - - for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) - { - ; - } - - this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); - for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) - { - if (this.randomGenerator.nextInt(4) == 0) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = this.currentWorld.getHeightValue(k, l); - this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - - if (this.randomGenerator.nextInt(8) == 0) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); - this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - } - - if (doGen && this.randomGenerator.nextInt(4) == 0) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); - this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); - } - - if (doGen && this.randomGenerator.nextInt(8) == 0) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); - this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); - for (j = 0; doGen && j < this.reedsPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); - this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } - - for (j = 0; doGen && j < 10; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); - this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } + }*/ + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); + for (j = 0; doGen && j < this.deadBushPerChunk; ++j) + { + Logger.WORLD("Dead Bush generation."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + (new WorldGenDeadBush(Blocks.deadbush)).generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); + for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) + { + Logger.WORLD("WaterLilly generation."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + + for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) + { + ; + } + + this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + }*/ + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); + for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) + { + if (this.randomGenerator.nextInt(4) == 0) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = this.currentWorld.getHeightValue(k, l); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + if (this.randomGenerator.nextInt(8) == 0) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + }*/ + + /*if (doGen && this.randomGenerator.nextInt(4) == 0) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + } + + if (doGen && this.randomGenerator.nextInt(8) == 0) + { + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, j, l, k); + }*/ + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); + for (j = 0; doGen && j < this.reedsPerChunk; ++j) + { + Logger.WORLD("Reed generation."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + } + + for (j = 0; doGen && j < 10; ++j) + { + Logger.WORLD("Reed generation 2."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.reedGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + }*/ + + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN); + if (doGen && this.randomGenerator.nextInt(32) == 0) + { + Logger.WORLD("Pumpkin generation."); + j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); + (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k); + } +*/ + /*doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); + for (j = 0; doGen && j < this.cactiPerChunk; ++j) + { + Logger.WORLD("Cactus generation."); + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); + }*/ + + doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); + if (doGen && this.generateLakes) + { + Logger.WORLD("Lake generation."); + for (j = 0; j < 50; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); + i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1); + } + + for (j = 0; j < 20; ++j) + { + k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; + l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); + i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1); + } + } + + MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); + } - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN); - if (doGen && this.randomGenerator.nextInt(32) == 0) - { - j = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - k = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - l = nextInt(this.currentWorld.getHeightValue(j, k) * 2); - (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, j, l, k); - } - - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); - for (j = 0; doGen && j < this.cactiPerChunk; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); - this.cactusGen.generate(this.currentWorld, this.randomGenerator, k, i1, l); - } + /** + * Standard ore generation helper. Generates most ores. + */ + @Override + protected void genStandardOre1(int passes, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) + { + for (int l = 0; l < passes; ++l) + { + int i1 = this.chunk_X + this.randomGenerator.nextInt(16); + int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_; + int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76795_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); + } + } - doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); - if (doGen && this.generateLakes) - { - for (j = 0; j < 50; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(248) + 8); - i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - (new WorldGenLiquids(Blocks.flowing_water)).generate(this.currentWorld, this.randomGenerator, k, l, i1); - } - - for (j = 0; j < 20; ++j) - { - k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; - l = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(240) + 8) + 8); - i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - (new WorldGenLiquids(Blocks.flowing_lava)).generate(this.currentWorld, this.randomGenerator, k, l, i1); - } - } - - MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); - } - - /** - * Standard ore generation helper. Generates most ores. - */ - @Override - protected void genStandardOre1(int p_76795_1_, WorldGenerator p_76795_2_, int p_76795_3_, int p_76795_4_) - { - for (int l = 0; l < p_76795_1_; ++l) - { - int i1 = this.chunk_X + this.randomGenerator.nextInt(16); - int j1 = this.randomGenerator.nextInt(p_76795_4_ - p_76795_3_) + p_76795_3_; - int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); - p_76795_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); - } - } - - /** - * Standard ore generation helper. Generates Lapis Lazuli. - */ - @Override + /** + * Standard ore generation helper. Generates Lapis Lazuli. + */ + @Override protected void genStandardOre2(int p_76793_1_, WorldGenerator p_76793_2_, int p_76793_3_, int p_76793_4_) - { - for (int l = 0; l < p_76793_1_; ++l) - { - int i1 = this.chunk_X + this.randomGenerator.nextInt(16); - int j1 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_) + (p_76793_3_ - p_76793_4_); - int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); - p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); - } - } - - /** - * Generates ores in the current chunk - */ - @Override + { + for (int l = 0; l < p_76793_1_; ++l) + { + int i1 = this.chunk_X + this.randomGenerator.nextInt(16); + int j1 = this.randomGenerator.nextInt(p_76793_4_) + this.randomGenerator.nextInt(p_76793_4_) + (p_76793_3_ - p_76793_4_); + int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); + p_76793_2_.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); + } + } + + /** + * Generates ores in the current chunk + */ + @Override protected void generateOres() - { - MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); - if (TerrainGen.generateOre(currentWorld, randomGenerator, dirtGen, chunk_X, chunk_Z, DIRT)) - this.genStandardOre1(20, this.dirtGen, 0, 256); - if (TerrainGen.generateOre(currentWorld, randomGenerator, gravelGen,