From 55f64675b42ac8d3c557cc850f78664bee006f6f Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 28 Jan 2023 19:32:44 -0800 Subject: [ci skip] spotlessApply with the new settings --- .../everglades/GTplusplus_Everglades.java | 71 +- .../everglades/biome/BiomeGenerator_Custom.java | 44 +- .../everglades/biome/Biome_Everglades.java | 25 +- .../everglades/biome/GenLayerBiomes.java | 4 +- .../everglades/biome/GenLayerEverglades.java | 2 +- .../everglades/block/BlockDarkWorldGround.java | 3 +- .../block/BlockDarkWorldPollutedDirt.java | 10 +- .../block/BlockDarkWorldPortalFrame.java | 5 +- .../block/BlockDarkWorldSludgeFluid.java | 41 +- .../everglades/block/BlockEvergladesPortal.java | 93 +- .../everglades/block/DarkWorldContentLoader.java | 21 +- .../everglades/chunk/ChunkProviderModded.java | 1011 ++++++++++---------- .../everglades/dimension/Dimension_Everglades.java | 7 +- .../everglades/gen/WorldGenDeadLilly.java | 1 + .../everglades/gen/WorldGenMinable_Custom.java | 20 +- .../gtPlusPlus/everglades/gen/gt/WorldGen_GT.java | 31 +- .../everglades/gen/gt/WorldGen_GT_Base.java | 317 +++--- .../everglades/gen/gt/WorldGen_GT_Ore_Layer.java | 401 ++++---- .../everglades/gen/gt/WorldGen_Ores.java | 205 +++- .../everglades/item/ItemBlockToxicEverglades.java | 4 +- .../item/ItemEvergladesPortalTrigger.java | 45 +- .../gtPlusPlus/everglades/object/BoxedQuad.java | 12 +- .../everglades/world/CustomWorldType.java | 1 + .../everglades/world/EvergladesPortalPosition.java | 1 + .../everglades/world/TeleporterDimensionMod.java | 55 +- .../everglades/world/WorldChunkManagerCustom.java | 43 +- .../everglades/world/WorldProviderMod.java | 9 +- 27 files changed, 1360 insertions(+), 1122 deletions(-) (limited to 'src/main/java/gtPlusPlus/everglades') diff --git a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java b/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java index bc137390b6..ac3665e855 100644 --- a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java +++ b/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java @@ -1,5 +1,12 @@ package gtPlusPlus.everglades; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; + +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.config.Configuration; + import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -23,19 +30,13 @@ import gtPlusPlus.everglades.gen.gt.WorldGen_Ores; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.gregtech.HANDLER_GT; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.config.Configuration; @MCVersion(value = "1.7.10") @Mod( modid = Everglades.MODID, name = Everglades.NAME, version = Everglades.VERSION, - dependencies = - "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;") + dependencies = "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;") public class GTplusplus_Everglades implements ActionListener { // Mod Instance @@ -64,8 +65,9 @@ public class GTplusplus_Everglades implements ActionListener { getEvergladesBiome().preInit(event); // Load/Set Custom Ore Gen - HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration( - new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); + HANDLER_GT.sCustomWorldgenFile = new GTPP_Config( + new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); } @EventHandler @@ -128,14 +130,19 @@ public class GTplusplus_Everglades implements ActionListener { // Custom Ores if (LoadedMods.Big_Reactors) { MaterialGenerator.generateOreMaterial( - ELEMENT.getInstance().YELLORIUM, false, false, true, new short[] {255, 242, 10}); + ELEMENT.getInstance().YELLORIUM, + false, + false, + true, + new short[] { 255, 242, 10 }); } } protected synchronized void setVars(FMLPreInitializationEvent event) { // Init WorldGen config. - HANDLER_GT.sCustomWorldgenFile = new GTPP_Config(new Configuration( - new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); + HANDLER_GT.sCustomWorldgenFile = new GTPP_Config( + new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); if (DimensionManager.isDimensionRegistered(Dimension_Everglades.DIMID)) { Dimension_Everglades.DIMID = DimensionManager.getNextFreeDimId(); @@ -159,33 +166,19 @@ public class GTplusplus_Everglades implements ActionListener { getEvergladesBiome().serverLoad(event); } - /*@Override - public int getBurnTime(ItemStack fuel) { - if (DarkWorld_Biome.addFuel(fuel) != 0) - return DarkWorld_Biome.addFuel(fuel); - if (DarkWorld_Dimension.addFuel(fuel) != 0) - return DarkWorld_Dimension.addFuel(fuel); - return 0; - }*/ - - /*@Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { - chunkX = chunkX * 16; - chunkZ = chunkZ * 16; - - if (world.provider.dimensionId == Dimension_DarkWorld.DIMID) { - DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ); - } - - //What does this even do? - if (world.provider.dimensionId == -1) { - DarkWorld_Biome.generateNether(world, random, chunkX, chunkZ); - } - if (world.provider.dimensionId == 0) { - DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ); - } - - }*/ + /* + * @Override public int getBurnTime(ItemStack fuel) { if (DarkWorld_Biome.addFuel(fuel) != 0) return + * DarkWorld_Biome.addFuel(fuel); if (DarkWorld_Dimension.addFuel(fuel) != 0) return + * DarkWorld_Dimension.addFuel(fuel); return 0; } + */ + + /* + * @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, + * IChunkProvider chunkProvider) { chunkX = chunkX * 16; chunkZ = chunkZ * 16; if (world.provider.dimensionId == + * Dimension_DarkWorld.DIMID) { DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ); } //What does this + * even do? if (world.provider.dimensionId == -1) { DarkWorld_Biome.generateNether(world, random, chunkX, chunkZ); } + * if (world.provider.dimensionId == 0) { DarkWorld_Biome.generateSurface(world, random, chunkX, chunkZ); } } + */ @EventHandler public static void postInit(final FMLPostInitializationEvent e) { diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java index f443a6560d..2ea16a553a 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java +++ b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java @@ -3,9 +3,8 @@ package gtPlusPlus.everglades.biome; import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; -import gtPlusPlus.everglades.gen.WorldGenDeadLilly; -import gtPlusPlus.everglades.gen.WorldGenMinable_Custom; import java.util.Random; + import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -18,6 +17,9 @@ import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.terraingen.TerrainGen; +import gtPlusPlus.everglades.gen.WorldGenDeadLilly; +import gtPlusPlus.everglades.gen.WorldGenMinable_Custom; + public class BiomeGenerator_Custom extends BiomeDecorator { public WorldGenerator fluoriteGen; @@ -57,8 +59,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } @Override - public void decorateChunk( - World p_150512_1_, Random p_150512_2_, BiomeGenBase p_150512_3_, int p_150512_4_, int p_150512_5_) { + 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 { @@ -85,7 +87,11 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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); + this.currentWorld, + this.randomGenerator, + j, + this.currentWorld.getTopSolidOrLiquidBlock(j, k), + k); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CLAY); @@ -93,7 +99,11 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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); + this.currentWorld, + this.randomGenerator, + j, + this.currentWorld.getTopSolidOrLiquidBlock(j, k), + k); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND_PASS2); @@ -101,7 +111,11 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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); + this.currentWorld, + this.randomGenerator, + j, + this.currentWorld.getTopSolidOrLiquidBlock(j, k), + k); } i = this.treesPerChunk; @@ -130,8 +144,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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); + this.bigMushroomGen + .generate(this.currentWorld, this.randomGenerator, k, this.currentWorld.getHeightValue(k, l), l); } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); @@ -170,9 +184,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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) { + for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); i1 > 0 + && this.currentWorld.isAirBlock(k, i1 - 1, l); --i1) { ; } @@ -252,8 +265,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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); + 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); } @@ -282,8 +295,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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_) + 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); diff --git a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java index 918393bb8f..940c7b5a34 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java +++ b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java @@ -1,17 +1,8 @@ package gtPlusPlus.everglades.biome; -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.reflect.ReflectionUtils; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; import java.lang.reflect.Field; import java.util.Random; + import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.passive.EntityBat; import net.minecraft.entity.passive.EntitySquid; @@ -21,6 +12,17 @@ import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeManager; +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.reflect.ReflectionUtils; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; + public class Biome_Everglades { public static BiomeGenEverglades biome = new BiomeGenEverglades(); @@ -49,6 +51,7 @@ public class Biome_Everglades { public void preInit(FMLPreInitializationEvent event) {} static class BiomeGenEverglades extends BiomeGenBase { + @SuppressWarnings("unchecked") public BiomeGenEverglades() { super(CORE.EVERGLADESBIOME_ID); @@ -115,7 +118,7 @@ public class Biome_Everglades { return 0xF67A14; } - @SuppressWarnings({"unchecked", "unused"}) + @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/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java index 9a84d6cc99..93c8404bb6 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java +++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java @@ -6,9 +6,7 @@ import net.minecraft.world.gen.layer.IntCache; public class GenLayerBiomes extends GenLayer { - protected BiomeGenBase[] allowedBiomes = { - Biome_Everglades.biome, - }; + protected BiomeGenBase[] allowedBiomes = { Biome_Everglades.biome, }; public GenLayerBiomes(long seed) { super(seed); diff --git a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java index 59b4924355..dec0ed1429 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java +++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java @@ -22,7 +22,7 @@ public class GenLayerEverglades extends GenLayer { GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes); biomes.initWorldGenSeed(seed); genlayervoronoizoom.initWorldGenSeed(seed); - return new GenLayer[] {biomes, genlayervoronoizoom}; + return new GenLayer[] { biomes, genlayervoronoizoom }; } @Override diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java index 85154ef1fb..72ab766652 100644 --- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java +++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldGround.java @@ -1,9 +1,10 @@ package gtPlusPlus.everglades.block; +import net.minecraft.block.BlockGrass; + import cpw.mods.fml.common.registry.LanguageRegistry; import gtPlusPlus.api.interfaces.ITileTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; -import net.minecraft.block.BlockGrass; public class BlockDarkWorldGround extends BlockGrass implements ITileTooltip { diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java index 043f632804..8d74fdd087 100644 --- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java +++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPollutedDirt.java @@ -1,13 +1,14 @@ package gtPlusPlus.everglades.block; +import net.minecraft.block.BlockDirt; +import net.minecraft.world.ColorizerGrass; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.api.interfaces.ITileTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; -import net.minecraft.block.BlockDirt; -import net.minecraft.world.ColorizerGrass; -import net.minecraft.world.IBlockAccess; public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip { @@ -49,8 +50,7 @@ public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileToolti for (int k1 = -1; k1 <= 1; ++k1) { for (int l1 = -1; l1 <= 1; ++l1) { - int i2 = p_149720_1_ - .getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1) + int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1) .getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); l += (i2 & 16711680) >> 16; i1 += (i2 & 65280) >> 8; diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java index 96f32be8a1..e9cf49b447 100644 --- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java +++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldPortalFrame.java @@ -1,11 +1,12 @@ package gtPlusPlus.everglades.block; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + import cpw.mods.fml.common.registry.LanguageRegistry; import gtPlusPlus.api.interfaces.ITileTooltip; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip { diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java index 155319deaa..e3ee1b91df 100644 --- a/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java +++ b/src/main/java/gtPlusPlus/everglades/block/BlockDarkWorldSludgeFluid.java @@ -48,29 +48,13 @@ public class BlockDarkWorldSludgeFluid extends Fluid { 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 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; @@ -81,11 +65,8 @@ public class BlockDarkWorldSludgeFluid extends Fluid { return material; } - /*@Override - public boolean doesVaporize(FluidStack fluidStack) - { - if (block == null) - return false; - return block.getDefaultState().getMaterial() == getMaterial(); - }*/ + /* + * @Override public boolean doesVaporize(FluidStack fluidStack) { if (block == null) return false; return + * block.getDefaultState().getMaterial() == getMaterial(); } + */ } diff --git a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java index d4385bc701..d90027ea60 100644 --- a/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java +++ b/src/main/java/gtPlusPlus/everglades/block/BlockEvergladesPortal.java @@ -1,15 +1,7 @@ package gtPlusPlus.everglades.block; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; -import gtPlusPlus.everglades.world.TeleporterDimensionMod; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockBreakable; import net.minecraft.block.material.Material; @@ -24,7 +16,18 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.api.interfaces.ITileTooltip; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; +import gtPlusPlus.everglades.world.TeleporterDimensionMod; + public class BlockEvergladesPortal extends BlockBreakable implements ITileTooltip { + IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null; public BlockEvergladesPortal() { @@ -82,8 +85,8 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Returns a bounding box from the pool of bounding boxes (this means - * this box can change after the pool has been cleared to be reused) + * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been + * cleared to be reused) */ @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { @@ -91,8 +94,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Updates the blocks bounds based on its current state. Args: world, x, - * y, z + * Updates the blocks bounds based on its current state. Args: world, x, y, z */ @Override public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { @@ -111,10 +113,8 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Is this block (a) opaque and (B) a full 1m cube? This determines - * whether or not to render the shared face of two adjacent blocks and - * also whether the player can attach torches, redstone wire, etc to - * this block. + * Is this block (a) opaque and (B) a full 1m cube? This determines whether or not to render the shared face of two + * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. */ @Override public boolean isOpaqueCube() { @@ -122,8 +122,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * If this block doesn't render as an ordinary block it will return - * False (examples: signs, buttons, stairs, etc) + * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ @Override public boolean renderAsNormalBlock() { @@ -131,8 +130,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Checks to see if this location is valid to create a portal and will - * return True if it does. Args: world, x, y, z + * Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z */ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { byte b0 = 0; @@ -165,8 +163,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } } /* - * else if (j1 != 0 && j1 != - * Main.TutorialFire.blockID) { return false; } + * else if (j1 != 0 && j1 != Main.TutorialFire.blockID) { return false; } */ } } @@ -181,9 +178,8 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Lets the block know when one of its neighbor changes. Doesn't know - * which neighbor changed (coordinates passed are their own) Args: x, y, - * z, neighbor blockID + * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are + * their own) Args: x, y, z, neighbor blockID */ public void onNeighborBlockChange(BlockPos pos) { int x = pos.xPos, y = pos.yPos, z = pos.zPos; @@ -226,7 +222,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti par1World.setBlockToAir(x, y, z); } else { if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_Everglades.blockPortalFrame - || par1World.getBlock(x - b0, y, z - b1) != this) + || par1World.getBlock(x - b0, y, z - b1) != this) && (par1World.getBlock(x - b0, y, z - b1) != Dimension_Everglades.blockPortalFrame || par1World.getBlock(x + b0, y, z + b1) != this)) { par1World.setBlockToAir(x, y, z); @@ -244,11 +240,11 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti super.onNeighborBlockChange(world, x, y, z, block); } - /*@Override - public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) { - onNeighborBlockChange(new BlockPos(x, y, z, world.)); - super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ); - }*/ + /* + * @Override public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) + * { onNeighborBlockChange(new BlockPos(x, y, z, world.)); super.onNeighborChange(world, x, y, z, tileX, tileY, + * tileZ); } + */ @Override @SideOnly(Side.CLIENT) @@ -270,8 +266,7 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this; boolean flag4 = flag || flag1; boolean flag5 = flag2 || flag3; - return flag4 && par5 == 4 - ? true + return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3)); } } @@ -285,36 +280,28 @@ public class BlockEvergladesPortal extends BlockBreakable implements ITileToolti } /** - * Triggered whenever an entity collides with this block (enters into - * the block). Args: world, x, y, z, entity + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity */ @Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if ((par5Entity.ridingEntity == null) - && (par5Entity.riddenByEntity == null) + if ((par5Entity.ridingEntity == null) && (par5Entity.riddenByEntity == null) && ((par5Entity instanceof EntityPlayerMP))) { EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity; if (thePlayer.timeUntilPortal > 0) { thePlayer.timeUntilPortal = 100; } else if (thePlayer.dimension != Dimension_Everglades.DIMID) { thePlayer.timeUntilPortal = 100; - thePlayer - .mcServer - .getConfigurationManager() - .transferPlayerToDimension( - thePlayer, - Dimension_Everglades.DIMID, - new TeleporterDimensionMod( - thePlayer.mcServer.worldServerForDimension(Dimension_Everglades.DIMID))); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension( + thePlayer, + Dimension_Everglades.DIMID, + new TeleporterDimensionMod( + thePlayer.mcServer.worldServerForDimension(Dimension_Everglades.DIMID))); } else { thePlayer.timeUntilPortal = 100; - thePlayer - .mcServer - .getConfigurationManager() - .transferPlayerToDimension( - thePlayer, - 0, - new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0))); + thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension( + thePlayer, + 0, + new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0))); } } } diff --git a/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java b/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java index 86c7053dfc..66e03d8a77 100644 --- a/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java +++ b/src/main/java/gtPlusPlus/everglades/block/DarkWorldContentLoader.java @@ -2,13 +2,14 @@ package gtPlusPlus.everglades.block; import static gtPlusPlus.everglades.dimension.Dimension_Everglades.*; +import net.minecraft.init.Blocks; +import net.minecraftforge.fluids.FluidRegistry; + import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.core.block.base.BlockBaseFluid; import gtPlusPlus.core.util.Utils; import gtPlusPlus.everglades.item.ItemBlockToxicEverglades; import gtPlusPlus.everglades.item.ItemEvergladesPortalTrigger; -import net.minecraft.init.Blocks; -import net.minecraftforge.fluids.FluidRegistry; public class DarkWorldContentLoader { @@ -25,19 +26,15 @@ public class DarkWorldContentLoader { // Fluids SLUDGE = (BlockDarkWorldSludgeFluid) new BlockDarkWorldSludgeFluid("sludge", Utils.rgbtoHexValue(30, 130, 30)) - .setDensity(1800) - .setGaseous(false) - .setLuminosity(2) - .setViscosity(25000) - .setTemperature(300); + .setDensity(1800).setGaseous(false).setLuminosity(2).setViscosity(25000).setTemperature(300); FluidRegistry.registerFluid(SLUDGE); return true; } public static synchronized boolean initItems() { - portalItem = (ItemEvergladesPortalTrigger) - (new ItemEvergladesPortalTrigger().setUnlocalizedName("everglades.trigger")); + portalItem = (ItemEvergladesPortalTrigger) (new ItemEvergladesPortalTrigger() + .setUnlocalizedName("everglades.trigger")); GameRegistry.registerItem(portalItem, "everglades.trigger"); return true; } @@ -45,10 +42,8 @@ public class DarkWorldContentLoader { public static synchronized boolean initBlocks() { // Create Block Instances - blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE) - .setLightLevel(2f) - .setLightOpacity(1) - .setBlockName("fluidSludge"); + blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f) + .setLightOpacity(1).setBlockName("fluidSludge"); portalBlock = new BlockEvergladesPortal(); blockTopLayer = new BlockDarkWorldGround(); blockSecondLayer = new BlockDarkWorldPollutedDirt(); diff --git a/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java b/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java index 0ff265a4ae..f9dcba5df4 100644 --- a/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java +++ b/src/main/java/gtPlusPlus/everglades/chunk/ChunkProviderModded.java @@ -18,493 +18,536 @@ import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.structure.MapGenMineshaft; import net.minecraft.world.gen.structure.MapGenScatteredFeature; import net.minecraft.world.gen.structure.MapGenVillage; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.ChunkProviderEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.everglades.dimension.Dimension_Everglades; + public class ChunkProviderModded 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; - /** - * A NoiseGeneratorOctaves used in generating terrain - */ - public NoiseGeneratorOctaves noiseGen5; - /** - * A NoiseGeneratorOctaves used in generating terrain - */ - public NoiseGeneratorOctaves noiseGen6; - public NoiseGeneratorOctaves mobSpawnerNoise; - /** - * Reference to the World object. - */ - private World worldObj; - private WorldType field_147435_p; - private final double[] field_147434_q; - private final float[] parabolicField; - private double[] stoneNoise = new double[256]; - private MapGenBase caveGenerator = new MapGenCaves(); - /** - * Holds Stronghold Generator - */ - // private MapGenStronghold strongholdGenerator = new - // MapGenStronghold(); - /** - * Holds Village Generator - */ - private MapGenVillage villageGenerator = new MapGenVillage(); - /** - * Holds Mineshaft Generator - */ - private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); - private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); - /** - * Holds ravine generator - */ - private MapGenBase ravineGenerator = new MapGenRavine(); - /** - * 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; - int[][] field_73219_j = new int[32][32]; - { - caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); - /* - * strongholdGenerator = (MapGenStronghold) - * TerrainGen.getModdedMapGen(strongholdGenerator, - * net.minecraftforge.event.terraingen.InitMapGenEvent.EventType. - * STRONGHOLD); - */ - villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); - mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); - scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); - ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, - net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); - } - - public ChunkProviderModded(World par1World, long par2) { - this.worldObj = par1World; - this.field_147435_p = 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.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[825]; - this.parabolicField = new float[25]; - - for (int j = -2; j <= 2; ++j) { - for (int k = -2; k <= 2; ++k) { - float f = 10.0F / MathHelper.sqrt_float(j * j + k * k + 0.2F); - this.parabolicField[j + 2 + (k + 2) * 5] = f; - } - } - - NoiseGenerator[] noiseGens = { field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, - noiseGen6, 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.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); - this.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; //TODO - wots dis do - 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] = Dimension_Everglades.blockMainFiller; - } - else if (k2 * 8 + l2 < b0) { - try { - p_147424_3_[j3 += short1] = Dimension_Everglades.blockFluidLakes; //River Fluid . - } - catch (Throwable t){ - p_147424_3_[j3 += short1] = Blocks.water; //River Fluid Fallback - } - } - 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_) { - @SuppressWarnings("deprecation") - 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() == cpw.mods.fml.common.eventhandler.Event.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]); - } - } - } - - /** - * loads or generates the chunk at the chunk location specified - */ - @Override - public Chunk loadChunk(int par1, int par2) { - return this.provideChunk(par1, par2); - } - - /** - * 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 par1, int par2) { - this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L); - Block[] ablock = new Block[65536]; - byte[] abyte = new byte[65536]; - this.func_147424_a(par1, par2, ablock); - this.biomesForGeneration = this.worldObj.getWorldChunkManager() - .loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); - this.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) { - abyte1[k] = (byte) this.biomesForGeneration[k].biomeID; - } - - chunk.generateSkylightMap(); - return chunk; - } - - private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) { - 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); - 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 = 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; - } - } - } - } - - /** - * Checks to see if a chunk exists at x, y - */ - @Override - public boolean chunkExists(int par1, int par2) { - return true; - } - - /** - * Populates chunk with ores etc etc - */ - @Override - public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - 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, worldObj, rand, par2, par3, flag)); - - int k1; - int l1; - int i2; - - if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && !flag - && this.rand.nextInt(4) == 0 && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, - flag, net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE)) { - k1 = k + this.rand.nextInt(16) + 8; - l1 = this.rand.nextInt(256); - i2 = l + this.rand.nextInt(16) + 8; - try { - (new WorldGenLakes(Dimension_Everglades.blockFluidLakes)).generate(this.worldObj, this.rand, k1, l1, i2); - } catch (NullPointerException n){ - n.getStackTrace(); - (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); - Logger.INFO("Error while generating DarkWorld Lake."); - } - } - - if (TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, - net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA) && !flag - && this.rand.nextInt(8) == 0) { - k1 = k + this.rand.nextInt(16) + 8; - l1 = this.rand.nextInt(this.rand.nextInt(248) + 8); - i2 = l + this.rand.nextInt(16) + 8; - - if (l1 < 63 || this.rand.nextInt(10) == 0) { //Changes 63 -> 128 - try{ - (new WorldGenLakes(Blocks.lava)).generate(this.worldObj, this.rand, k1, l1, i2); - } catch (NullPointerException n){ - Logger.INFO("Error while generating DarkWorld Lake. [2]"); - } - } - } - 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, worldObj, rand, par2, par3, flag)); - - BlockFalling.fallInstantly = false; - } - - /** - * Two modes of operation: if passed true, save all Chunks in one go. If - * passed false, save up to two chunks. Return true if all chunks have - * been saved. - */ - @Override - public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } - - /** - * Save extra data not associated with any Chunk. Not saved during - * autosave, only during world unload. Currently unimplemented. - */ - @Override - public void saveExtraData() { - } - - /** - * Unloads chunks that are marked to be unloaded. This is not guaranteed - * to unload every such chunk. - */ - @Override - public boolean unloadQueuedChunks() { - return false; - } - - /** - * Returns if the IChunkProvider supports saving. - */ - @Override - public boolean canSave() { - return true; - } - - /** - * Converts the instance data to a readable string. - */ - @Override - public String makeString() { - return "RandomLevelSource"; - } - - /** - * Returns a list of creatures of the specified type that can spawn at - * the given location. - */ - @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); - } - - @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_) { - return - "Village".equals(p_147416_2_) && - this.villageGenerator != null ? - this.villageGenerator.func_151545_a(p_147416_1_, - p_147416_3_, p_147416_4_, p_147416_5_) : - null; - } - - @Override - public int getLoadedChunkCount() { - return 0; - } - - @Override - public void recreateStructures(int par1, int par2) { - - } -} \ No newline at end of file + + private Random rand; + private NoiseGeneratorOctaves field_147431_j; + private NoiseGeneratorOctaves field_147432_k; + private NoiseGeneratorOctaves field_147429_l; + private NoiseGeneratorPerlin field_147430_m; + /** + * A NoiseGeneratorOctaves used in generating terrain + */ + public NoiseGeneratorOctaves noiseGen5; + /** + * A NoiseGeneratorOctaves used in generating terrain + */ + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; + /** + * Reference to the World object. + */ + private World worldObj; + private WorldType field_147435_p; + private final double[] field_147434_q; + private final float[] parabolicField; + private double[] stoneNoise = new double[256]; + private MapGenBase caveGenerator = new MapGenCaves(); + /** + * Holds Stronghold Generator + */ + // private MapGenStronghold strongholdGenerator = new + // MapGenStronghold(); + /** + * Holds Village Generator + */ + private MapGenVillage villageGenerator = new MapGenVillage(); + /** + * Holds Mineshaft Generator + */ + private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); + /** + * Holds ravine generator + */ + private MapGenBase ravineGenerator = new MapGenRavine(); + /** + * 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; + int[][] field_73219_j = new int[32][32]; + { + caveGenerator = TerrainGen + .getModdedMapGen(caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE); + /* + * strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, + * net.minecraftforge.event.terraingen.InitMapGenEvent.EventType. STRONGHOLD); + */ + villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen( + villageGenerator, + net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE); + mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen( + mineshaftGenerator, + net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT); + scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen( + scatteredFeatureGenerator, + net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE); + ravineGenerator = TerrainGen + .getModdedMapGen(ravineGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE); + } + + public ChunkProviderModded(World par1World, long par2) { + this.worldObj = par1World; + this.field_147435_p = 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.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[825]; + this.parabolicField = new float[25]; + + for (int j = -2; j <= 2; ++j) { + for (int k = -2; k <= 2; ++k) { + float f = 10.0F / MathHelper.sqrt_float(j * j + k * k + 0.2F); + this.parabolicField[j + 2 + (k + 2) * 5] = f; + } + } + + NoiseGenerator[] noiseGens = { field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, + noiseGen6, 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.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); + this.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; // TODO - wots dis do + 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] = Dimension_Everglades.blockMainFiller; + } else if (k2 * 8 + l2 < b0) { + try { + p_147424_3_[j3 += short1] = Dimension_Everglades.blockFluidLakes; // River Fluid + // . + } catch (Throwable t) { + p_147424_3_[j3 += short1] = Blocks.water; // River Fluid Fallback + } + } 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_) { + @SuppressWarnings("deprecation") + 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() == cpw.mods.fml.common.eventhandler.Event.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]); + } + } + } + + /** + * loads or generates the chunk at the chunk location specified + */ + @Override + public Chunk loadChunk(int par1, int par2) { + return this.provideChunk(par1, par2); + } + + /** + * 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 par1, int par2) { + this.rand.setSeed(par1 * 341873128712L + par2 * 132897987541L); + Block[] ablock = new Block[65536]; + byte[] abyte = new byte[65536]; + this.func_147424_a(par1, par2, ablock); + this.biomesForGeneration = this.worldObj.getWorldChunkManager() + .loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); + this.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) { + abyte1[k] = (byte) this.biomesForGeneration[k].biomeID; + } + + chunk.generateSkylightMap(); + return chunk; + } + + private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) { + 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); + 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; + Bio