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/australia | |
| 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/australia')
51 files changed, 8410 insertions, 8222 deletions
diff --git a/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java b/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java index 9a16ad1785..16b54138e2 100644 --- a/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java +++ b/src/main/java/gtPlusPlus/australia/GTplusplus_Australia.java @@ -1,9 +1,5 @@ package gtPlusPlus.australia; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; - import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; @@ -28,131 +24,136 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.Australia; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.config.Configuration; @MCVersion(value = "1.7.10") -@Mod(modid = Australia.MODID, name = Australia.NAME, version = Australia.VERSION, dependencies = "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;") +@Mod( + modid = Australia.MODID, + name = Australia.NAME, + version = Australia.VERSION, + dependencies = + "required-after:Forge; after:dreamcraft; after:IC2; after:ihl; required-after:gregtech; required-after:miscutils;") public class GTplusplus_Australia implements ActionListener { - //Mod Instance - @Mod.Instance(Australia.MODID) - public static GTplusplus_Australia instance; - public static GTPP_Config sCustomWorldgenFile = null; - - // Dark World Handler - //protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1; - //protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2; - - public static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3; - public static volatile Biome_AustralianForest Australian_Forest_Biome; - public static volatile Biome_AustralianOcean Australian_Ocean_Biome; - public static volatile Biome_AustralianOutback Australian_Outback_Biome; - public static volatile Biome_AustralianPlains Australian_Plains_Biome; - - public static volatile Dimension_Australia Australia_Dimension; - public static AustraliaWorldGenerator Australia_World_Generator; - public static int globalAustraliaPortalSpawnTimer = 0; - - // Pre-Init - @Mod.EventHandler - public void preInit(final FMLPreInitializationEvent event) { - Logger.INFO("Loading " + Australia.MODID + " V" + Australia.VERSION); - - //Setup - setVars(event); - - Australia_Dimension = new Dimension_Australia(); - Australia_Dimension.instance = instance; - - //Australian_Desert_Biome_1 = (new Biome_AustralianDesert()); - //Australian_Desert_Biome_2 = (new Biome_AustralianDesert2()); - //Australian_Desert_Biome_1.instance = instance; - //Australian_Desert_Biome_2.instance = instance; - //Australian_Desert_Biome_1.preInit(event); - //Australian_Desert_Biome_2.preInit(event); - - - Australian_Desert_Biome_3 = (Biome_AustralianDesert_Ex.biome); - Australian_Forest_Biome = (Biome_AustralianForest.biome); - Australian_Ocean_Biome = (Biome_AustralianOcean.biome); - Australian_Outback_Biome = (Biome_AustralianOutback.biome); - Australian_Plains_Biome = Biome_AustralianPlains.biome; - - //Load Villages - StructureManager.registerVillageComponents(); - - setupWorldGenerator(); - - //Load/Set Custom Ore Gen - sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); - - } - - @EventHandler - public void load(final FMLInitializationEvent e) { - Logger.INFO("Begin resource allocation for " + Australia.MODID + " V" +Australia.VERSION); - - //Load World and Biome - GameRegistry.registerWorldGenerator(new WorldGen_GT_Australia_Base(), Short.MAX_VALUE); - - //Australian_Desert_Biome_1.load(); - //Australian_Desert_Biome_2.load(); - Australian_Desert_Biome_3.load(); - Australian_Forest_Biome.load(); - Australian_Ocean_Biome.load(); - Australian_Outback_Biome.load(); - Australian_Plains_Biome.load(); - - Australia_Dimension.load(); - - } - - public static synchronized void GenerateOreMaterials() { - - } - - protected synchronized void setVars(FMLPreInitializationEvent event){ - - sCustomWorldgenFile = new GTPP_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); - - if (DimensionManager.isDimensionRegistered(Dimension_Australia.DIMID)){ - Dimension_Australia.DIMID = DimensionManager.getNextFreeDimId(); - } - - /* - * Set World Generation Values - */ - WorldGen_Australia_Ores.generateValidOreVeins(); - WorldGen_GT_Australia_Base.oreveinPercentage = 16; - WorldGen_GT_Australia_Base.oreveinAttempts = 16; - WorldGen_GT_Australia_Base.oreveinMaxPlacementAttempts = 2; - if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV){ - WorldGen_GT_Australia_Base.debugWorldGen = true; - } - AustraliaContentLoader.run(); - } - - @EventHandler - public void serverLoad(FMLServerStartingEvent event) { - Australia_World_Generator.initiate(); - } - - @EventHandler - public static void postInit(final FMLPostInitializationEvent e) { - Logger.INFO("Finished loading Australia plugin for GT++."); - } - - @Override - public void actionPerformed(ActionEvent arg0) { - // TODO Auto-generated method stub - - } - - private void setupWorldGenerator() { - Logger.INFO("Registering World Generator for Australia."); - Australia_World_Generator = new AustraliaWorldGenerator(); - GameRegistry.registerWorldGenerator(Australia_World_Generator, 0); - } - + // Mod Instance + @Mod.Instance(Australia.MODID) + public static GTplusplus_Australia instance; + + public static GTPP_Config sCustomWorldgenFile = null; + + // Dark World Handler + // protected static volatile Biome_AustralianDesert Australian_Desert_Biome_1; + // protected static volatile Biome_AustralianDesert2 Australian_Desert_Biome_2; + + public static volatile Biome_AustralianDesert_Ex Australian_Desert_Biome_3; + public static volatile Biome_AustralianForest Australian_Forest_Biome; + public static volatile Biome_AustralianOcean Australian_Ocean_Biome; + public static volatile Biome_AustralianOutback Australian_Outback_Biome; + public static volatile Biome_AustralianPlains Australian_Plains_Biome; + + public static volatile Dimension_Australia Australia_Dimension; + public static AustraliaWorldGenerator Australia_World_Generator; + public static int globalAustraliaPortalSpawnTimer = 0; + + // Pre-Init + @Mod.EventHandler + public void preInit(final FMLPreInitializationEvent event) { + Logger.INFO("Loading " + Australia.MODID + " V" + Australia.VERSION); + + // Setup + setVars(event); + + Australia_Dimension = new Dimension_Australia(); + Australia_Dimension.instance = instance; + + // Australian_Desert_Biome_1 = (new Biome_AustralianDesert()); + // Australian_Desert_Biome_2 = (new Biome_AustralianDesert2()); + // Australian_Desert_Biome_1.instance = instance; + // Australian_Desert_Biome_2.instance = instance; + // Australian_Desert_Biome_1.preInit(event); + // Australian_Desert_Biome_2.preInit(event); + + Australian_Desert_Biome_3 = (Biome_AustralianDesert_Ex.biome); + Australian_Forest_Biome = (Biome_AustralianForest.biome); + Australian_Ocean_Biome = (Biome_AustralianOcean.biome); + Australian_Outback_Biome = (Biome_AustralianOutback.biome); + Australian_Plains_Biome = Biome_AustralianPlains.biome; + + // Load Villages + StructureManager.registerVillageComponents(); + + setupWorldGenerator(); + + // Load/Set Custom Ore Gen + sCustomWorldgenFile = new GTPP_Config(new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); + } + + @EventHandler + public void load(final FMLInitializationEvent e) { + Logger.INFO("Begin resource allocation for " + Australia.MODID + " V" + Australia.VERSION); + + // Load World and Biome + GameRegistry.registerWorldGenerator(new WorldGen_GT_Australia_Base(), Short.MAX_VALUE); + + // Australian_Desert_Biome_1.load(); + // Australian_Desert_Biome_2.load(); + Australian_Desert_Biome_3.load(); + Australian_Forest_Biome.load(); + Australian_Ocean_Biome.load(); + Australian_Outback_Biome.load(); + Australian_Plains_Biome.load(); + + Australia_Dimension.load(); + } + + public static synchronized void GenerateOreMaterials() {} + + protected synchronized void setVars(FMLPreInitializationEvent event) { + + sCustomWorldgenFile = new GTPP_Config(new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "Australia.cfg"))); + + if (DimensionManager.isDimensionRegistered(Dimension_Australia.DIMID)) { + Dimension_Australia.DIMID = DimensionManager.getNextFreeDimId(); + } + + /* + * Set World Generation Values + */ + WorldGen_Australia_Ores.generateValidOreVeins(); + WorldGen_GT_Australia_Base.oreveinPercentage = 16; + WorldGen_GT_Australia_Base.oreveinAttempts = 16; + WorldGen_GT_Australia_Base.oreveinMaxPlacementAttempts = 2; + if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV) { + WorldGen_GT_Australia_Base.debugWorldGen = true; + } + AustraliaContentLoader.run(); + } + + @EventHandler + public void serverLoad(FMLServerStartingEvent event) { + Australia_World_Generator.initiate(); + } + + @EventHandler + public static void postInit(final FMLPostInitializationEvent e) { + Logger.INFO("Finished loading Australia plugin for GT++."); + } + + @Override + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } + + private void setupWorldGenerator() { + Logger.INFO("Registering World Generator for Australia."); + Australia_World_Generator = new AustraliaWorldGenerator(); + GameRegistry.registerWorldGenerator(Australia_World_Generator, 0); + } } diff --git a/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java b/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java index 2d9b335d52..ea6b50a478 100644 --- a/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java +++ b/src/main/java/gtPlusPlus/australia/biome/CustomDecorator.java @@ -1,11 +1,12 @@ package gtPlusPlus.australia.biome; -import java.util.Random; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; -import gtPlusPlus.api.interfaces.IGeneratorWorld; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.australia.GTplusplus_Australia; import gtPlusPlus.australia.gen.world.WorldGenAustralianOre; +import java.util.Random; import net.minecraft.block.BlockFlower; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; @@ -24,332 +25,331 @@ import net.minecraft.world.gen.feature.WorldGenReed; import net.minecraft.world.gen.feature.WorldGenSand; import net.minecraft.world.gen.feature.WorldGenWaterlily; import net.minecraft.world.gen.feature.WorldGenerator; - -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.*; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.*; import net.minecraftforge.common.*; import net.minecraftforge.event.terraingen.*; public class CustomDecorator extends BiomeDecorator { - - public CustomDecorator() { - this.sandGen = new WorldGenSand(Blocks.sand, 10); - this.gravelAsSandGen = new WorldGenSand(Blocks.gravel, 6); - this.dirtGen = new WorldGenMinable(Blocks.dirt, 16); - this.gravelGen = new WorldGenMinable(Blocks.gravel, 16); - - this.coalGen = new WorldGenAustralianOre(Blocks.coal_ore, 4); - this.ironGen = new WorldGenAustralianOre(Blocks.clay, 4); - this.goldGen = new WorldGenAustralianOre(Blocks.soul_sand, 20); - this.redstoneGen = new WorldGenAustralianOre(Blocks.bedrock, 8); - this.diamondGen = new WorldGenAustralianOre(Blocks.diamond_ore, 1); - this.lapisGen = new WorldGenAustralianOre(Blocks.lava, 16); - - 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 WorldGenWaterlily(); - this.flowersPerChunk = 2; - this.grassPerChunk = 1; - this.sandPerChunk = 1; - this.sandPerChunk2 = 3; - this.clayPerChunk = 2; - this.generateLakes = true; - } - - int mDecoratorTimeout = 0; - - public void decorateChunk(World aWorld, Random aRand, BiomeGenBase aGen, int aX, int aZ) { - if (this.currentWorld != null && this.chunk_X == aX && this.chunk_Z == aZ) { - try { - while (this.currentWorld != null) { - if (mDecoratorTimeout % 1000 == 0) { - Logger.WORLD("Waiting for chunk @ "+aX+", "+aZ+" to generate. Waited "+mDecoratorTimeout+"ms already."); - } - if (this.currentWorld == null) { - break; - } - if (mDecoratorTimeout >= 5000) { - throw new RuntimeException("Already decorating!!"); - } - mDecoratorTimeout++; - } - } - catch (Throwable t) { - t.printStackTrace(); - throw new RuntimeException("Already decorating!!"); - } - } - if (this.currentWorld == null) { - this.currentWorld = aWorld; - this.randomGenerator = aRand; - this.chunk_X = aX; - this.chunk_Z = aZ; - this.genDecorations(aGen); - this.currentWorld = null; - this.randomGenerator = null; - } - } - - 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); - } < |
