From bf6713f0d1669e400b4545b173c18a3b66cad113 Mon Sep 17 00:00:00 2001 From: Jordan Byrne Date: Wed, 14 Mar 2018 04:40:57 +1000 Subject: % Refactored all Everglades stuff to it's own package. $ Fixed inverted EIO tooltip logic. --- .../core/world/darkworld/Dimension_DarkWorld.java | 30 -- .../darkworld/biome/BiomeGenerator_Custom.java | 355 -------------- .../world/darkworld/biome/Biome_DarkWorld.java | 146 ------ .../core/world/darkworld/biome/GenLayerBiomes.java | 31 -- .../world/darkworld/biome/GenLayerDarkWorld.java | 32 -- .../darkworld/block/BlockDarkWorldGround.java | 25 - .../block/BlockDarkWorldPollutedDirt.java | 74 --- .../darkworld/block/BlockDarkWorldPortal.java | 403 ---------------- .../darkworld/block/BlockDarkWorldPortalFrame.java | 30 -- .../darkworld/block/BlockDarkWorldSludgeFluid.java | 101 ---- .../darkworld/block/DarkWorldContentLoader.java | 71 --- .../world/darkworld/chunk/ChunkProviderModded.java | 510 -------------------- .../world/darkworld/gen/WorldGenDeadLilly.java | 28 -- .../darkworld/gen/WorldGenMinable_Custom.java | 90 ---- .../core/world/darkworld/gen/gt/WorldGen_GT.java | 49 -- .../world/darkworld/gen/gt/WorldGen_GT_Base.java | 471 ------------------- .../darkworld/gen/gt/WorldGen_GT_Ore_Layer.java | 514 --------------------- .../core/world/darkworld/gen/gt/WorldGen_Ores.java | 327 ------------- .../darkworld/item/ItemBlockToxicEverglades.java | 42 -- .../darkworld/item/ItemDarkWorldPortalTrigger.java | 101 ---- .../core/world/darkworld/object/BoxedQuad.java | 56 --- .../world/darkworld/world/CustomWorldType.java | 59 --- .../darkworld/world/DarkWorldPortalPosition.java | 14 - .../darkworld/world/TeleporterDimensionMod.java | 471 ------------------- .../darkworld/world/WorldChunkManagerCustom.java | 263 ----------- .../world/darkworld/world/WorldProviderMod.java | 71 --- 26 files changed, 4364 deletions(-) delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerBiomes.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenDeadLilly.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/WorldGenMinable_Custom.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Base.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_GT_Ore_Layer.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/gen/gt/WorldGen_Ores.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/item/ItemBlockToxicEverglades.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/item/ItemDarkWorldPortalTrigger.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/object/BoxedQuad.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/world/CustomWorldType.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/world/DarkWorldPortalPosition.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/world/TeleporterDimensionMod.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/world/WorldChunkManagerCustom.java delete mode 100644 src/Java/gtPlusPlus/core/world/darkworld/world/WorldProviderMod.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 deleted file mode 100644 index 678d9b0c2b..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/Dimension_DarkWorld.java +++ /dev/null @@ -1,30 +0,0 @@ -package gtPlusPlus.core.world.darkworld; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; - -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.minecraftforge.common.DimensionManager; - -public class Dimension_DarkWorld { - - public Object instance; - public static int DIMID = CORE.DARKWORLD_ID; - public static BlockDarkWorldPortal portalBlock; - public static ItemDarkWorldPortalTrigger portalItem; - public static Block blockTopLayer; - public static Block blockSecondLayer; - public static Block blockMainFiller = Blocks.stone; - public static Block blockSecondaryFiller; - public static Block blockFluidLakes; - public static Block blockPortalFrame; - - public void load() { - DimensionManager.registerProviderType(DIMID, WorldProviderMod.class, false); - DimensionManager.registerDimension(DIMID, DIMID); - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java deleted file mode 100644 index 353eed083d..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/BiomeGenerator_Custom.java +++ /dev/null @@ -1,355 +0,0 @@ -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 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; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.feature.*; - -import gtPlusPlus.core.world.darkworld.gen.WorldGenDeadLilly; -import gtPlusPlus.core.world.darkworld.gen.WorldGenMinable_Custom; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.terraingen.DecorateBiomeEvent; -import net.minecraftforge.event.terraingen.OreGenEvent; -import net.minecraftforge.event.terraingen.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; - - 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; - - 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); - } - - 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) - { - 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, 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); - } - - 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 - 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 - 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, chunk_X, chunk_Z, GRAVEL)) - this.genStandardOre1(10, this.gravelGen, 0, 256); - if (TerrainGen.generateOre(currentWorld, randomGenerator, coalGen, chunk_X, chunk_Z, COAL)) - this.genStandardOre1(20, this.coalGen, 0, 128); - if (TerrainGen.generateOre(currentWorld, randomGenerator, ironGen, chunk_X, chunk_Z, IRON)) - this.genStandardOre1(20, this.ironGen, 0, 64); - if (TerrainGen.generateOre(currentWorld, randomGenerator, goldGen, chunk_X, chunk_Z, GOLD)) - this.genStandardOre1(2, this.goldGen, 0, 32); - if (TerrainGen.generateOre(currentWorld, randomGenerator, redstoneGen, chunk_X, chunk_Z, REDSTONE)) - this.genStandardOre1(8, this.redstoneGen, 0, 16); - if (TerrainGen.generateOre(currentWorld, randomGenerator, diamondGen, chunk_X, chunk_Z, DIAMOND)) - this.genStandardOre1(1, this.diamondGen, 0, 16); - if (TerrainGen.generateOre(currentWorld, randomGenerator, lapisGen, chunk_X, chunk_Z, LAPIS)) - this.genStandardOre2(1, this.lapisGen, 16, 16); - MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z)); - } - - private int nextInt(int i) { - if (i <= 1) - return 0; - return this.randomGenerator.nextInt(i); - } -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java deleted file mode 100644 index e9669d9b50..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/Biome_DarkWorld.java +++ /dev/null @@ -1,146 +0,0 @@ -package gtPlusPlus.core.world.darkworld.biome; - -import java.lang.reflect.Field; -import java.util.Random; - -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 net.minecraft.entity.monster.EntityPigZombie; -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; - -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.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeManager; - -public class Biome_DarkWorld { - - public static BiomeGenDarkWorld biome = new BiomeGenDarkWorld(); - - public Object instance; - - public Biome_DarkWorld() { - } - - public void load() { - BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DEAD); - BiomeManager.addSpawnBiome(biome); - } - - public void generateNether(World world, Random random, int chunkX, int chunkZ) { - } - - public void generateSurface(World world, Random random, int chunkX, int chunkZ) { - } - - public void registerRenderers() { - } - - public int addFuel(ItemStack fuel) { - return 0; - } - - public void serverLoad(FMLServerStartingEvent event) { - } - - public void preInit(FMLPreInitializationEvent event) { - } - - static class BiomeGenDarkWorld extends BiomeGenBase { - @SuppressWarnings("unchecked") - public BiomeGenDarkWorld() { - super(CORE.DARKBIOME_ID); - this.setBiomeID(); - this.theBiomeDecorator = new BiomeGenerator_Custom(); - this.theBiomeDecorator.treesPerChunk = 10; - Logger.INFO("Dark World Temperature Category: "+getTempCategory()); - this.setBiomeName("Dark World"); - this.topBlock = Dimension_DarkWorld.blockTopLayer; - this.fillerBlock = Dimension_DarkWorld.blockSecondLayer; - this.enableRain = true; - this.enableSnow = false; - this.rainfall = 0.7F; - this.setHeight(new BiomeGenBase.Height(0.3F, 0.5F)); - this.heightVariation = 0.4F; - this.waterColorMultiplier = 0x17290A; - this.rootHeight = -0.25f; //Ground level - - this.spawnableMonsterList.clear(); - this.spawnableCreatureList.clear(); - this.spawnableWaterCreatureList.clear(); - this.spawnableCaveCreatureList.clear(); - - //Enemies - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySickBlaze.class, 100, 2, 6)); - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 75, 4, 16)); - this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityStaballoyConstruct.class, 20, 1, 2)); - - //Animals - this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 1, 1, 6)); - 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 (mTempList != mInternalBiomeList.get(null)){ - 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) - public int getBiomeGrassColor() { - return 0x111f11; - } - - @SideOnly(Side.CLIENT) - public int getBiomeFoliageColor() { - return 0x111f11; - } - - @Override - @SideOnly(Side.CLIENT) - public int getSkyColorByTemp(float par1) { - return 0xF67A14; - } - - @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)); - return true; - } - - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerBiomes.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerBiomes.java deleted file mode 100644 index f7176f86fb..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerBiomes.java +++ /dev/null @@ -1,31 +0,0 @@ -package gtPlusPlus.core.world.darkworld.biome; - -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.layer.GenLayer; -import net.minecraft.world.gen.layer.IntCache; - -public class GenLayerBiomes extends GenLayer { - - protected BiomeGenBase[] allowedBiomes = { Biome_DarkWorld.biome, }; - - public GenLayerBiomes(long seed) { - super(seed); - } - - public GenLayerBiomes(long seed, GenLayer genlayer) { - super(seed); - this.parent = genlayer; - } - - @Override - public int[] getInts(int x, int z, int width, int depth) { - int[] dest = IntCache.getIntCache(width * depth); - for (int dz = 0; dz < depth; dz++) { - for (int dx = 0; dx < width; dx++) { - this.initChunkSeed(dx + x, dz + z); - dest[(dx + dz * width)] = this.allowedBiomes[nextInt(this.allowedBiomes.length)].biomeID; - } - } - return dest; - } -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java b/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java deleted file mode 100644 index 4353c6d540..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/biome/GenLayerDarkWorld.java +++ /dev/null @@ -1,32 +0,0 @@ -package gtPlusPlus.core.world.darkworld.biome; - -import net.minecraft.world.WorldType; -import net.minecraft.world.gen.layer.GenLayer; -import net.minecraft.world.gen.layer.GenLayerVoronoiZoom; -import net.minecraft.world.gen.layer.GenLayerZoom; - -public class GenLayerDarkWorld extends GenLayer { - - public GenLayerDarkWorld(long seed) { - super(seed); - } - - public static GenLayer[] makeTheWorld(long seed, WorldType type) { - GenLayer biomes = new GenLayerBiomes(1L); - biomes = new GenLayerZoom(1000L, biomes); - biomes = new GenLayerZoom(1001L, biomes); - biomes = new GenLayerZoom(1002L, biomes); - biomes = new GenLayerZoom(1003L, biomes); - biomes = new GenLayerZoom(1004L, biomes); - biomes = new GenLayerZoom(1005L, biomes); - GenLayer genlayervoronoizoom = new GenLayerVoronoiZoom(10L, biomes); - biomes.initWorldGenSeed(seed); - genlayervoronoizoom.initWorldGenSeed(seed); - return new GenLayer[] { biomes, genlayervoronoizoom }; - } - - @Override - public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { - return new int[] {}; - } -} \ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java deleted file mode 100644 index 95e21baa45..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldGround.java +++ /dev/null @@ -1,25 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; - -import net.minecraft.block.BlockGrass; - -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; - -public class BlockDarkWorldGround extends BlockGrass implements ITileTooltip{ - - public BlockDarkWorldGround() { - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldGround"); - this.setHardness(1.0F); - this.setBlockTextureName("minecraft" + ":" + "grass"); - LanguageRegistry.addName(this, "Unstable Earth"); - } - - @Override - public int getTooltipID() { - return 2; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java deleted file mode 100644 index 82acaf1ff4..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPollutedDirt.java +++ /dev/null @@ -1,74 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.block.BlockDirt; -import net.minecraft.world.ColorizerGrass; -import net.minecraft.world.IBlockAccess; - -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; - -public class BlockDarkWorldPollutedDirt extends BlockDirt implements ITileTooltip{ - - public BlockDarkWorldPollutedDirt() { - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldGround2"); - this.setHardness(0.5F); - this.setBlockTextureName("minecraft" + ":" + "dirt"); - LanguageRegistry.addName(this, "Polluted Soil"); - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() - { - double d0 = 0.5D; - double d1 = 1.0D; - return ColorizerGrass.getGrassColor(d0, d1); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int p_149741_1_) - { - return this.getBlockColor(); - } - - /** - * 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_) - { - int l = 0; - int i1 = 0; - int j1 = 0; - - 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).getBiomeGrassColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); - l += (i2 & 16711680) >> 16; - i1 += (i2 & 65280) >> 8; - j1 += i2 & 255; - } - } - - return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; - } - - @Override - public int getTooltipID() { - return 3; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java deleted file mode 100644 index 061e2c8dc3..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortal.java +++ /dev/null @@ -1,403 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import java.util.Random; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBreakable; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -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.core.world.darkworld.Dimension_DarkWorld; -import gtPlusPlus.core.world.darkworld.world.TeleporterDimensionMod; - -public class BlockDarkWorldPortal extends BlockBreakable implements ITileTooltip{ - IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null; - - public BlockDarkWorldPortal() { - super("portal", Material.portal, false); - this.setTickRandomly(true); - this.setHardness(-1.0F); - this.setLightLevel(0.75F); - this.setCreativeTab(CreativeTabs.tabBlock); - this.setBlockName("blockDarkWorldPortal"); - - } - - @SideOnly(Side.CLIENT) - @Override - public IIcon getIcon(int i, int par2) { - - if (i == 0) - return gor; - - else if (i == 1) - return dol; - - else if (i == 2) - return st1; - - else if (i == 3) - return st2; - - else if (i == 4) - return st4; - - else if (i == 5) - return st3; - - else - return gor; - - } - - @SideOnly(Side.CLIENT) - @Override - public void registerBlockIcons(IIconRegister reg) { - this.gor = reg.registerIcon("portal"); - this.dol = reg.registerIcon("portal"); - this.st1 = reg.registerIcon("portal"); - this.st2 = reg.registerIcon("portal"); - this.st3 = reg.registerIcon("portal"); - this.st4 = reg.registerIcon("portal"); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int x, int y, int z, Random par5Random) { - super.updateTick(par1World, x, y, z, par5Random); - - int blockCount = 0; - BlockPos portal = new BlockPos(x, y, z, par1World.provider.dimensionId); - - for (BlockPos side : portal.getSurroundingBlocks()) { - Block b = side.getBlockAtPos(); - if (b == Dimension_DarkWorld.blockPortalFrame || b == Dimension_DarkWorld.portalBlock) { - blockCount++; - } - } - if (blockCount < 4) { - par1World.setBlockToAir(x, y, z); - } - - } - - /** - * 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) { - return null; - } - - /** - * 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) { - float f; - float f1; - if (par1IBlockAccess.getBlock(par2 - 1, par3, par4) != this && par1IBlockAccess.getBlock(par2 + 1, par3, par4) != this) { - f = 0.125F; - f1 = 0.5F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); - } else { - f = 0.5F; - f1 = 0.125F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f1, 0.5F + f, 1.0F, 0.5F + f1); - } - } - - /** - * 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() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return - * False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * 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; - byte b1 = 0; - if (par1World.getBlock(par2 - 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame - || par1World.getBlock(par2 + 1, par3, par4) == Dimension_DarkWorld.blockPortalFrame) { - b0 = 1; - } - if (par1World.getBlock(par2, par3, par4 - 1) == Dimension_DarkWorld.blockPortalFrame - || par1World.getBlock(par2, par3, par4 + 1) == Dimension_DarkWorld.blockPortalFrame) { - b1 = 1; - } - if (b0 == b1) { - return false; - } else { - if (par1World.getBlock(par2 - b0, par3, par4 - b1) == Blocks.air) { - par2 -= b0; - par4 -= b1; - } - int l; - int i1; - for (l = -1; l <= 2; ++l) { - for (i1 = -1; i1 <= 3; ++i1) { - boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3; - if (l != -1 && l != 2 || i1 != -1 && i1 != 3) { - Block j1 = par1World.getBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l); - if (flag) { - if (j1 != Dimension_DarkWorld.blockPortalFrame) { - return false; - } - } - /* - * else if (j1 != 0 && j1 != - * Main.TutorialFire.blockID) { return false; } - */ - } - } - } - for (l = 0; l < 2; ++l) { - for (i1 = 0; i1 < 3; ++i1) { - par1World.setBlock(par2 + b0 * l, par3 + i1, par4 + b1 * l, this, 0, 2); - } - } - return true; - } - } - - /** - * 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; - Logger.INFO("Trigger"); - int blockCount = 0; - BlockPos portal = pos; - World par1World = portal.world; - for (BlockPos side : portal.getSurroundingBlocks()) { - Block b = side.getBlockAtPos(); - if (b == Dimension_DarkWorld.blockPortalFrame || b == Dimension_DarkWorld.portalBlock) { - blockCount++; - } - } - if (blockCount < 4) { - par1World.setBlockToAir(x, y, z); - par1World.scheduleBlockUpdate(x, y, z, portal.getBlockAtPos(), 0); - } - - - - byte b0 = 0; - byte b1 = 1; - if (par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this) { - b0 = 1; - b1 = 0; - } - int i1; - for (i1 = y; par1World.getBlock(x, i1 - 1, z) == this; --i1) { - ; - } - if (par1World.getBlock(x, i1 - 1, z) != Dimension_DarkWorld.blockPortalFrame) { - par1World.setBlockToAir(x, y, z); - } else { - int j1; - for (j1 = 1; j1 < 4 && par1World.getBlock(x, i1 + j1, z) == this; ++j1) { - ; - } - if (j1 == 3 && par1World.getBlock(x, i1 + j1, z) == Dimension_DarkWorld.blockPortalFrame) { - boolean flag = par1World.getBlock(x - 1, y, z) == this || par1World.getBlock(x + 1, y, z) == this; - boolean flag1 = par1World.getBlock(x, y, z - 1) == this || par1World.getBlock(x, y, z + 1) == this; - if (flag && flag1) { - par1World.setBlockToAir(x, y, z); - } else { - if ((par1World.getBlock(x + b0, y, z + b1) != Dimension_DarkWorld.blockPortalFrame || par1World - .getBlock(x - b0, y, z - b1) != this) - && (par1World.getBlock(x - b0, y, z - b1) != Dimension_DarkWorld.blockPortalFrame || par1World.getBlock(x + b0, y, - z + b1) != this)) { - par1World.setBlockToAir(x, y, z); - } - } - } else { - par1World.setBlockToAir(x, y, z); - } - } - } - - @Override - public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - onNeighborBlockChange(new BlockPos(x, y, z, world.provider.dimensionId)); - 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 - @SideOnly(Side.CLIENT) - /** - * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given - * coordinates. Args: blockAccess, x, y, z, side - */ - public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - if (par1IBlockAccess.getBlock(par2, par3, par4) == this) { - return false; - } else { - boolean flag = par1IBlockAccess.getBlock(par2 - 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 - 2, par3, par4) != this; - boolean flag1 = par1IBlockAccess.getBlock(par2 + 1, par3, par4) == this && par1IBlockAccess.getBlock(par2 + 2, par3, par4) != this; - boolean flag2 = par1IBlockAccess.getBlock(par2, par3, par4 - 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 - 2) != this; - boolean flag3 = par1IBlockAccess.getBlock(par2, par3, par4 + 1) == this && par1IBlockAccess.getBlock(par2, par3, par4 + 2) != this; - boolean flag4 = flag || flag1; - boolean flag5 = flag2 || flag3; - return flag4 && par5 == 4 ? true : (flag4 && par5 == 5 ? true : (flag5 && par5 == 2 ? true : flag5 && par5 == 3)); - } - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 0; - } - - /** - * 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) && ((par5Entity instanceof EntityPlayerMP))) { - EntityPlayerMP thePlayer = (EntityPlayerMP) par5Entity; - if (thePlayer.timeUntilPortal > 0) { - thePlayer.timeUntilPortal = 100; - } else if (thePlayer.dimension != Dimension_DarkWorld.DIMID) { - thePlayer.timeUntilPortal = 100; - thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, Dimension_DarkWorld.DIMID, - new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(Dimension_DarkWorld.DIMID))); - } else { - thePlayer.timeUntilPortal = 100; - thePlayer.mcServer.getConfigurationManager().transferPlayerToDimension(thePlayer, 0, - new TeleporterDimensionMod(thePlayer.mcServer.worldServerForDimension(0))); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - public int getRenderBlockPass() { - return 1; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * A randomly called display update to be able to add particles or other items for display - */ - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (CORE.RANDOM.nextInt(100) == 0) { - par1World.playSound(par2 + 0.5D, par3 + 0.5D, par4 + 0.5D, "portal.portal", 0.5F, - CORE.RANDOM.nextFloat() * 0.4F + 0.8F, false); - } - for (int l = 0; l < 4; ++l) { - double d0 = par2 + CORE.RANDOM.nextFloat(); - double d1 = par3 + CORE.RANDOM.nextFloat(); - double d2 = par4 + CORE.RANDOM.nextFloat(); - double d3 = 0.0D; - double d4 = 0.0D; - double d5 = 0.0D; - int i1 = CORE.RANDOM.nextInt(2) * 2 - 1; - d3 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - d4 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - d5 = (CORE.RANDOM.nextFloat() - 0.5D) * 0.5D; - if (par1World.getBlock(par2 - 1, par3, par4) != this && par1World.getBlock(par2 + 1, par3, par4) != this) { - d0 = par2 + 0.5D + 0.25D * i1; - d3 = CORE.RANDOM.nextFloat() * 2.0F * i1; - } else { - d2 = par4 + 0.5D + 0.25D * i1; - d5 = CORE.RANDOM.nextFloat() * 2.0F * i1; - } - par1World.spawnParticle("reddust", d0+0.1D, d1, d2, d3, d4, d5); - par1World.spawnParticle("smoke", d0, d1+0.1D, d2, 0, 0, 0); - - Random R = new Random(); - - if (R.nextInt(10) == 0){ - par1World.spawnParticle("largesmoke", d0, d1, d2, 0, 0+0.2D, 0); - } - else if (R.nextInt(5)==1){ - par1World.spawnParticle("flame", d0, d1, d2, 0, 0+0.1D, 0); - } - } - } - - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - - @Override - public int colorMultiplier(final IBlockAccess par1IBlockAccess, final int par2, final int par3, final int par4){ - return Utils.rgbtoHexValue(0, 255, 0); - } - - @Override - public int getRenderColor(final int aMeta) { - return Utils.rgbtoHexValue(0, 255, 0); - } - - @Override - public String getLocalizedName() { - return EnumChatFormatting.OBFUSCATED+super.getLocalizedName(); - } - - @Override - public int getTooltipID() { - return 1; - } -} - - diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java deleted file mode 100644 index 90c425d2d4..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldPortalFrame.java +++ /dev/null @@ -1,30 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import cpw.mods.fml.common.registry.LanguageRegistry; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - -import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; - -public class BlockDarkWorldPortalFrame extends Block implements ITileTooltip{ - - public BlockDarkWorldPortalFrame() { - super(Material.iron); - this.setCreativeTab(AddToCreativeTab.tabBOP); - this.setBlockName("blockDarkWorldPortalFrame"); - this.setHardness(3.0F); - this.setLightLevel(0.5F); - this.setBlockTextureName(CORE.MODID + ":" + "metro/TEXTURE_TECH_PANEL_A"); - LanguageRegistry.addName(this, "Containment Frame"); - - } - - @Override - public int getTooltipID() { - return 0; - } - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java b/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java deleted file mode 100644 index 8271713dfb..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/BlockDarkWorldSludgeFluid.java +++ /dev/null @@ -1,101 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import net.minecraft.block.material.MapColor; -import net.minecraft.block.material.Material; -import net.minecraft.block.material.MaterialLiquid; - -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/block/DarkWorldContentLoader.java b/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java deleted file mode 100644 index b851e10343..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/block/DarkWorldContentLoader.java +++ /dev/null @@ -1,71 +0,0 @@ -package gtPlusPlus.core.world.darkworld.block; - -import static gtPlusPlus.core.world.darkworld.Dimension_DarkWorld.*; - -import cpw.mods.fml.common.registry.GameRegistry; - -import net.minecraft.init.Blocks; - -import gtPlusPlus.core.block.base.BlockBaseFluid; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.world.darkworld.item.ItemBlockToxicEverglades; -import gtPlusPlus.core.world.darkworld.item.ItemDarkWorldPortalTrigger; -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("everglades.trigger")); - GameRegistry.registerItem(portalItem, "everglades.trigger"); - return true; - } - - public synchronized static boolean initBlocks(){ - - //Create Block Instances - blockFluidLakes = new BlockBaseFluid("Sludge", SLUDGE, BlockDarkWorldSludgeFluid.SLUDGE).setLightLevel(2f).setLightOpacity(1).setBlockName("fluidSludge"); - portalBlock = new BlockDarkWorldPortal(); - blockTopLayer = new BlockDarkWorldGround(); - blockSecondLayer = new BlockDarkWorldPollutedDirt(); - blockPortalFrame = new BlockDarkWorldPortalFrame(); - - //Registry - GameRegistry.registerBlock(portalBlock, ItemBlockToxicEverglades.class, "dimensionDarkWorld_portal"); - GameRegistry.registerBlock(blockTopLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround"); - GameRegistry.registerBlock(blockSecondLayer, ItemBlockToxicEverglades.class, "blockDarkWorldGround2"); - GameRegistry.registerBlock(blockPortalFrame, ItemBlockToxicEverglades.class, "blockDarkWorldPortalFrame"); - - //Make Flammable - Blocks.fire.setFireInfo(blockTopLayer, 30, 20); - - return true; - } - - -} diff --git a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java b/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java deleted file mode 100644 index b8c86821f4..0000000000 --- a/src/Java/gtPlusPlus/core/world/darkworld/chunk/ChunkProviderModded.java +++ /dev/null @@ -1,510 +0,0 @@ -package gtPlusPlus.core.world.darkworld.chunk; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockFalling; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.IProgressUpdate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.*; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraft.world.gen.*; -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.core.world.darkworld.Dimension_DarkWorld; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.terraingen.ChunkProviderEvent; -import net.minecraftforge.event.terraingen.PopulateChunkEvent; -import net.minecraftforge.event.terraingen.TerrainGen; - -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_DarkWorld.blockMainFiller; - } - else if (k2 * 8 + l2 < b0) { - 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; - } - } - - 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