diff options
author | Jakub <53441451+kuba6000@users.noreply.github.com> | 2022-08-29 16:04:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 16:04:28 +0200 |
commit | 7d1f51a8937e0a86486267437d444696e81e8aa0 (patch) | |
tree | a5b145e7271998f7b4b968a2212ed487e54a92b5 /src/main/java/gtPlusPlus/everglades/biome | |
parent | 5267969156d30b4bb5f4cb2279ebb49db6bd40e2 (diff) | |
download | GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.gz GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.tar.bz2 GT5-Unofficial-7d1f51a8937e0a86486267437d444696e81e8aa0.zip |
Buildscript + Spotless (#318)
* Convert AES.java to readable class
* Buildscript
* Spotless
Diffstat (limited to 'src/main/java/gtPlusPlus/everglades/biome')
4 files changed, 238 insertions, 274 deletions
diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java index 0f8acd75b4..f443a6560d 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java +++ b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java @@ -3,8 +3,9 @@ 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; @@ -12,27 +13,23 @@ 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.everglades.gen.WorldGenDeadLilly; -import gtPlusPlus.everglades.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 { - + public WorldGenerator fluoriteGen; - public BiomeGenerator_Custom(){ - //Basic Blocks + 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 + + // 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); @@ -40,8 +37,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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 + + // Nature this.yellowFlowerGen = new WorldGenFlowers(Blocks.yellow_flower); this.mushroomBrownGen = new WorldGenFlowers(Blocks.brown_mushroom); this.mushroomRedGen = new WorldGenFlowers(Blocks.red_mushroom); @@ -49,25 +46,22 @@ public class BiomeGenerator_Custom extends BiomeDecorator { 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) - { + 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 - { + } else { this.currentWorld = p_150512_1_; this.randomGenerator = p_150512_2_; this.chunk_X = p_150512_4_; @@ -79,8 +73,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } @Override - protected void genDecorations(BiomeGenBase p_150513_1_) - { + protected void genDecorations(BiomeGenBase p_150513_1_) { MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); this.generateOres(); int i; @@ -88,33 +81,32 @@ public class BiomeGenerator_Custom extends BiomeDecorator { int k; boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SAND); - for (i = 0; doGen && i < this.sandPerChunk2; ++i) - { + 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); + 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) - { + 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); + 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) - { + 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); + this.gravelAsSandGen.generate( + this.currentWorld, this.randomGenerator, j, this.currentWorld.getTopSolidOrLiquidBlock(j, k), k); } i = this.treesPerChunk; - if (this.randomGenerator.nextInt(10) == 0) - { + if (this.randomGenerator.nextInt(10) == 0) { ++i; } @@ -122,47 +114,42 @@ public class BiomeGenerator_Custom extends BiomeDecorator { int i1; doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE); - for (j = 0; doGen && j < i; ++j) - { + 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)) - { + 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) - { + 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); - for (j = 0; doGen && j < this.flowersPerChunk; ++j) - { + 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) - { + 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) - { + 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); @@ -171,8 +158,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, DEAD_BUSH); - for (j = 0; doGen && j < this.deadBushPerChunk; ++j) - { + 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); @@ -180,13 +166,13 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LILYPAD); - for (j = 0; doGen && j < this.waterlilyPerChunk; ++j) - { + 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) - { + for (i1 = nextInt(this.currentWorld.getHeightValue(k, l) * 2); + i1 > 0 && this.currentWorld.isAirBlock(k, i1 - 1, l); + --i1) { ; } @@ -194,18 +180,15 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, SHROOM); - for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) - { - if (this.randomGenerator.nextInt(4) == 0) - { + 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) - { + 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); @@ -213,16 +196,14 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } } - if (doGen && this.randomGenerator.nextInt(4) == 0) - { + 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) - { + 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); @@ -230,16 +211,14 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, REED); - for (j = 0; doGen && j < this.reedsPerChunk; ++j) - { + 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) - { + 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); @@ -247,8 +226,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, PUMPKIN); - if (doGen && this.randomGenerator.nextInt(32) == 0) - { + 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); @@ -256,8 +234,7 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, CACTUS); - for (j = 0; doGen && j < this.cactiPerChunk; ++j) - { + 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); @@ -265,20 +242,18 @@ public class BiomeGenerator_Custom extends BiomeDecorator { } doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, LAKE); - if (doGen && this.generateLakes) - { - for (j = 0; j < 50; ++j) - { + 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) - { + 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); } @@ -291,10 +266,8 @@ public class BiomeGenerator_Custom extends BiomeDecorator { * 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) - { + 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); @@ -306,12 +279,12 @@ public class BiomeGenerator_Custom extends BiomeDecorator { * 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) - { + 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 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); } @@ -321,31 +294,29 @@ public class BiomeGenerator_Custom extends BiomeDecorator { * Generates ores in the current chunk */ @Override - protected void generateOres() - { + 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); + 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); + 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); + 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); + 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); + 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); + 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); + 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); + 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; + if (i <= 1) return 0; return this.randomGenerator.nextInt(i); - } -}
\ No newline at end of file + } +} diff --git a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java index b31f6d034e..214b86d196 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java +++ b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java @@ -1,150 +1,141 @@ package gtPlusPlus.everglades.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.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; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeManager; public class Biome_Everglades { - public static BiomeGenEverglades biome = new BiomeGenEverglades(); - - public Object instance; - - public Biome_Everglades() { - } - - 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 BiomeGenEverglades extends BiomeGenBase { - @SuppressWarnings("unchecked") - public BiomeGenEverglades() { - super(CORE.EVERGLADESBIOME_ID); - //this.setBiomeID(); - this.theBiomeDecorator = new BiomeGenerator_Custom(); - this.theBiomeDecorator.treesPerChunk = 10; - //Logger.INFO("Dark World Temperature Category: "+getTempCategory()); - this.setBiomeName("Toxic Everglades"); - this.topBlock = Dimension_Everglades.blockTopLayer; - this.fillerBlock = Dimension_Everglades.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() { - try { - Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); - Field mClone = mInternalBiomeList; - BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null); - BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length]; - for (int index=0;index<mTempList.length;index++) { - mTempList[index] = mOriginalList[index]; - } - if (mTempList != null){ - mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this; - mInternalBiomeList.set(null, mTempList); - if (mTempList != mInternalBiomeList.get(null)){ - ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList); - Logger.REFLECTION("Set Biome ID for "+this.biomeName+" Biome internally in 'biomeList' field from "+BiomeGenBase.class.getCanonicalName()+"."); - return true; - } - else { - Logger.REFLECTION("Failed to set Biome ID for "+this.biomeName+" 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()+"."); - e.printStackTrace(); - 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; - } - - } - + public static BiomeGenEverglades biome = new BiomeGenEverglades(); + + public Object instance; + + public Biome_Everglades() {} + + 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 BiomeGenEverglades extends BiomeGenBase { + @SuppressWarnings("unchecked") + public BiomeGenEverglades() { + super(CORE.EVERGLADESBIOME_ID); + // this.setBiomeID(); + this.theBiomeDecorator = new BiomeGenerator_Custom(); + this.theBiomeDecorator.treesPerChunk = 10; + // Logger.INFO("Dark World Temperature Category: "+getTempCategory()); + this.setBiomeName("Toxic Everglades"); + this.topBlock = Dimension_Everglades.blockTopLayer; + this.fillerBlock = Dimension_Everglades.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() { + try { + Field mInternalBiomeList = ReflectionUtils.getField(BiomeGenBase.class, "biomeList"); + Field mClone = mInternalBiomeList; + BiomeGenBase[] mOriginalList = (BiomeGenBase[]) mInternalBiomeList.get(null); + BiomeGenBase[] mTempList = new BiomeGenBase[mOriginalList.length]; + for (int index = 0; index < mTempList.length; index++) { + mTempList[index] = mOriginalList[index]; + } + if (mTempList != null) { + mTempList[CORE.AUSTRALIA_BIOME_DESERT_1_ID] = this; + mInternalBiomeList.set(null, mTempList); + if (mTempList != mInternalBiomeList.get(null)) { + ReflectionUtils.setFinalFieldValue(BiomeGenBase.class, mInternalBiomeList, mTempList); + Logger.REFLECTION( + "Set Biome ID for " + this.biomeName + " Biome internally in 'biomeList' field from " + + BiomeGenBase.class.getCanonicalName() + "."); + return true; + } else { + Logger.REFLECTION("Failed to set Biome ID for " + this.biomeName + + " 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() + "."); + e.printStackTrace(); + 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/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java index b69a8ea555..9a84d6cc99 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java +++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerBiomes.java @@ -6,26 +6,28 @@ 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); - } + public GenLayerBiomes(long seed) { + super(seed); + } - public GenLayerBiomes(long seed, GenLayer genlayer) { - super(seed); - this.parent = genlayer; - } + 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 + @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; + } +} diff --git a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java index 8034921dce..59b4924355 100644 --- a/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java +++ b/src/main/java/gtPlusPlus/everglades/biome/GenLayerEverglades.java @@ -7,26 +7,26 @@ import net.minecraft.world.gen.layer.GenLayerZoom; public class GenLayerEverglades extends GenLayer { - public GenLayerEverglades(long seed) { - super(seed); - } + public GenLayerEverglades(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 }; - } + 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 + @Override + public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_) { + return new int[] {}; + } +} |