From 1b820de08a05070909a267e17f033fcf58ac8710 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 2 Sep 2024 23:17:17 +0200 Subject: The Great Renaming (#3014) * move kekztech to a single root dir * move detrav to a single root dir * move gtnh-lanthanides to a single root dir * move tectech and delete some gross reflection in gt++ * remove more reflection inside gt5u * delete more reflection in gt++ * fix imports * move bartworks and bwcrossmod * fix proxies * move galactigreg and ggfab * move gtneioreplugin * try to fix gt++ bee loader * apply the rename rules to BW * apply rename rules to bwcrossmod * apply rename rules to detrav scanner mod * apply rename rules to galacticgreg * apply rename rules to ggfab * apply rename rules to goodgenerator * apply rename rules to gtnh-lanthanides * apply rename rules to gt++ * apply rename rules to kekztech * apply rename rules to kubatech * apply rename rules to tectech * apply rename rules to gt apply the rename rules to gt * fix tt import * fix mui hopefully * fix coremod except intergalactic * rename assline recipe class * fix a class name i stumbled on * rename StructureUtility to GTStructureUtility to prevent conflict with structurelib * temporary rename of GTTooltipDataCache to old name * fix gt client/server proxy names --- .../java/gtPlusPlus/everglades/GTPPEverglades.java | 193 +++++++++++ .../everglades/GTplusplus_Everglades.java | 194 ----------- .../everglades/biome/BiomeEverglades.java | 84 +++++ .../everglades/biome/BiomeGenerator_Custom.java | 361 --------------------- .../everglades/biome/Biome_Everglades.java | 84 ----- .../everglades/biome/CustomBiomeGenerator.java | 361 +++++++++++++++++++++ .../everglades/biome/GenLayerBiomes.java | 2 +- .../everglades/block/BlockEvergladesPortal.java | 54 +-- .../everglades/block/DarkWorldContentLoader.java | 12 +- .../everglades/chunk/ChunkProviderModded.java | 11 +- .../everglades/dimension/DimensionEverglades.java | 29 ++ .../everglades/dimension/Dimension_Everglades.java | 29 -- .../everglades/gen/WorldGenMinableCustom.java | 90 +++++ .../everglades/gen/WorldGenMinable_Custom.java | 90 ----- .../gtPlusPlus/everglades/gen/gt/WorldGen_GT.java | 6 +- .../everglades/gen/gt/WorldGen_GT_Base.java | 66 ++-- .../everglades/gen/gt/WorldGen_GT_Ore_Layer.java | 66 ++-- .../everglades/gen/gt/WorldGen_Ores.java | 158 ++++----- .../item/ItemEvergladesPortalTrigger.java | 4 +- .../everglades/world/TeleporterDimensionMod.java | 20 +- .../everglades/world/WorldProviderMod.java | 4 +- 21 files changed, 958 insertions(+), 960 deletions(-) create mode 100644 src/main/java/gtPlusPlus/everglades/GTPPEverglades.java delete mode 100644 src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java create mode 100644 src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java delete mode 100644 src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java delete mode 100644 src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java create mode 100644 src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java create mode 100644 src/main/java/gtPlusPlus/everglades/dimension/DimensionEverglades.java delete mode 100644 src/main/java/gtPlusPlus/everglades/dimension/Dimension_Everglades.java create mode 100644 src/main/java/gtPlusPlus/everglades/gen/WorldGenMinableCustom.java delete mode 100644 src/main/java/gtPlusPlus/everglades/gen/WorldGenMinable_Custom.java (limited to 'src/main/java/gtPlusPlus/everglades') diff --git a/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java new file mode 100644 index 0000000000..403198d6df --- /dev/null +++ b/src/main/java/gtPlusPlus/everglades/GTPPEverglades.java @@ -0,0 +1,193 @@ +package gtPlusPlus.everglades; + +import static gregtech.api.enums.Mods.GTPlusPlusEverglades; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; + +import net.minecraft.block.Block; +import net.minecraftforge.common.DimensionManager; +import net.minecraftforge.common.config.Configuration; + +import bwcrossmod.galacticgreg.MTEVoidMinerBase; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.Mod.EventHandler; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.enums.Mods; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.GTPPCore; +import gtPlusPlus.core.lib.GTPPCore.Everglades; +import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.material.MaterialsOres; +import gtPlusPlus.everglades.biome.BiomeEverglades; +import gtPlusPlus.everglades.block.DarkWorldContentLoader; +import gtPlusPlus.everglades.dimension.DimensionEverglades; +import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Base; +import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Ore_Layer; +import gtPlusPlus.everglades.gen.gt.WorldGen_Ores; +import gtPlusPlus.preloader.PreloaderCore; +import gtPlusPlus.xmod.gregtech.HandlerGT; +import gtPlusPlus.xmod.gregtech.api.util.GTPPConfig; + +@Mod( + modid = Mods.Names.G_T_PLUS_PLUS_EVERGLADES, + name = Everglades.NAME, + version = Everglades.VERSION, + dependencies = "required-after:Forge; after:dreamcraft; after:IC2; required-after:gregtech; required-after:miscutils;") +public class GTPPEverglades implements ActionListener { + + // Mod Instance + @Mod.Instance(Mods.Names.G_T_PLUS_PLUS_EVERGLADES) + public static GTPPEverglades instance; + + // Dark World Handler + protected static volatile BiomeEverglades Everglades_Biome; + protected static volatile DimensionEverglades Everglades_Dimension; + + // Pre-Init + @Mod.EventHandler + public void preInit(final FMLPreInitializationEvent event) { + Logger.INFO("Loading " + GTPlusPlusEverglades.ID + " V" + Everglades.VERSION); + + // Setup + setVars(event); + + setEvergladesBiome(new BiomeEverglades()); + Everglades_Dimension = new DimensionEverglades(); + + // Load Dark World + getEvergladesBiome().instance = instance; + Everglades_Dimension.instance = instance; + getEvergladesBiome().preInit(event); + + // Load/Set Custom Ore Gen + HandlerGT.sCustomWorldgenFile = new GTPPConfig( + new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); + } + + @EventHandler + public void load(final FMLInitializationEvent e) { + Logger.INFO("Begin resource allocation for " + GTPlusPlusEverglades.ID + " V" + Everglades.VERSION); + + // Load World and Biome + GameRegistry.registerWorldGenerator(new WorldGen_GT_Base(), Short.MAX_VALUE); + getEvergladesBiome().load(); + Everglades_Dimension.load(); + addToVoidMinerDrops(); + } + + public static synchronized void GenerateOreMaterials() { + MaterialGenerator.generateOreMaterial(MaterialsOres.CROCROITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.GEIKIELITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.NICHROMITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.TITANITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ZIMBABWEITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ZIRCONILITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.GADOLINITE_CE); + MaterialGenerator.generateOreMaterial(MaterialsOres.GADOLINITE_Y); + MaterialGenerator.generateOreMaterial(MaterialsOres.LEPERSONNITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.SAMARSKITE_Y); + MaterialGenerator.generateOreMaterial(MaterialsOres.SAMARSKITE_YB); + MaterialGenerator.generateOreMaterial(MaterialsOres.XENOTIME); + MaterialGenerator.generateOreMaterial(MaterialsOres.YTTRIAITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.YTTRIALITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.YTTROCERITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ZIRCON); + MaterialGenerator.generateOreMaterial(MaterialsOres.POLYCRASE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ZIRCOPHYLLITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ZIRKELITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.LANTHANITE_LA); + MaterialGenerator.generateOreMaterial(MaterialsOres.LANTHANITE_CE); + MaterialGenerator.generateOreMaterial(MaterialsOres.LANTHANITE_ND); + MaterialGenerator.generateOreMaterial(MaterialsOres.AGARDITE_Y); + MaterialGenerator.generateOreMaterial(MaterialsOres.AGARDITE_CD); + MaterialGenerator.generateOreMaterial(MaterialsOres.AGARDITE_LA); + MaterialGenerator.generateOreMaterial(MaterialsOres.AGARDITE_ND); + MaterialGenerator.generateOreMaterial(MaterialsOres.HIBONITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.CERITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.FLUORCAPHITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.FLORENCITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.CRYOLITE); + + MaterialGenerator.generateOreMaterial(MaterialsOres.LAUTARITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.LAFOSSAITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.DEMICHELEITE_BR); + MaterialGenerator.generateOreMaterial(MaterialsOres.COMANCHEITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.PERROUDITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.HONEAITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.ALBURNITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.MIESSIITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.KASHINITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.IRARSITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.GREENOCKITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.RADIOBARITE); + MaterialGenerator.generateOreMaterial(MaterialsOres.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); + + } + + protected synchronized void setVars(FMLPreInitializationEvent event) { + // Init WorldGen config. + HandlerGT.sCustomWorldgenFile = new GTPPConfig( + new Configuration( + new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); + + if (DimensionManager.isDimensionRegistered(DimensionEverglades.DIMID)) { + DimensionEverglades.DIMID = DimensionManager.getNextFreeDimId(); + } + + /* + * Set World Generation Values + */ + WorldGen_Ores.generateValidOreVeins(); + WorldGen_GT_Base.oreveinPercentage = 64; + WorldGen_GT_Base.oreveinAttempts = 16; + WorldGen_GT_Base.oreveinMaxPlacementAttempts = 4; + if (PreloaderCore.DEBUG_MODE || GTPPCore.DEVENV) { + WorldGen_GT_Base.debugWorldGen = true; + } + DarkWorldContentLoader.run(); + } + + public void addToVoidMinerDrops() { + for (WorldGen_GT_Ore_Layer t : WorldGen_Ores.validOreveins.values()) { + addVMDrop(t.mPrimaryMeta, 0, t.mWeight); + addVMDrop(t.mSecondaryMeta, 0, t.mWeight); + addVMDrop(t.mBetweenMeta, 0, t.mWeight / 8f); + addVMDrop(t.mSporadicMeta, 0, t.mWeight / 8f); + } + } + + public void addVMDrop(Block block, int meta, float weight) { + MTEVoidMinerBase.addBlockToDimensionList(GTPPCore.EVERGLADES_ID, block, meta, weight); + } + + @EventHandler + public void serverLoad(FMLServerStartingEvent event) { + getEvergladesBiome().serverLoad(event); + } + + @EventHandler + public static void postInit(final FMLPostInitializationEvent e) { + Logger.INFO("Finished loading Everglades plugin for GT++."); + } + + public static synchronized BiomeEverglades getEvergladesBiome() { + return Everglades_Biome; + } + + public static synchronized void setEvergladesBiome(BiomeEverglades darkWorld_Biome) { + Everglades_Biome = darkWorld_Biome; + } + + @Override + public void actionPerformed(ActionEvent arg0) { + // TODO Auto-generated method stub + + } +} diff --git a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java b/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java deleted file mode 100644 index 3cb8893b16..0000000000 --- a/src/main/java/gtPlusPlus/everglades/GTplusplus_Everglades.java +++ /dev/null @@ -1,194 +0,0 @@ -package gtPlusPlus.everglades; - -import static gregtech.api.enums.Mods.GTPlusPlusEverglades; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.DimensionManager; -import net.minecraftforge.common.config.Configuration; - -import com.github.bartimaeusnek.crossmod.galacticgreg.GT_TileEntity_VoidMiner_Base; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.enums.Mods; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.CORE.Everglades; -import gtPlusPlus.core.material.MaterialGenerator; -import gtPlusPlus.core.material.ORES; -import gtPlusPlus.everglades.biome.Biome_Everglades; -import gtPlusPlus.everglades.block.DarkWorldContentLoader; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; -import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Base; -import gtPlusPlus.everglades.gen.gt.WorldGen_GT_Ore_Layer; -import gtPlusPlus.everglades.gen.gt.WorldGen_Ores; -import gtPlusPlus.preloader.CORE_Preloader; -import gtPlusPlus.xmod.gregtech.HANDLER_GT; -import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; - -@Mod( - modid = Mods.Names.G_T_PLUS_PLUS_EVERGLADES, - name = Everglades.NAME, - version = Everglades.VERSION, - dependencies = "required-after:Forge; after:dreamcraft; after:IC2; required-after:gregtech; required-after:miscutils;") -public class GTplusplus_Everglades implements ActionListener { - - // Mod Instance - @Mod.Instance(Mods.Names.G_T_PLUS_PLUS_EVERGLADES) - public static GTplusplus_Everglades instance; - - // Dark World Handler - protected static volatile Biome_Everglades Everglades_Biome; - protected static volatile Dimension_Everglades Everglades_Dimension; - - // Pre-Init - @Mod.EventHandler - public void preInit(final FMLPreInitializationEvent event) { - Logger.INFO("Loading " + GTPlusPlusEverglades.ID + " V" + Everglades.VERSION); - - // Setup - setVars(event); - - setEvergladesBiome(new Biome_Everglades()); - Everglades_Dimension = new Dimension_Everglades(); - - // Load Dark World - getEvergladesBiome().instance = instance; - Everglades_Dimension.instance = instance; - getEvergladesBiome().preInit(event); - - // Load/Set Custom Ore Gen - HANDLER_GT.sCustomWorldgenFile = new GTPP_Config( - new Configuration( - new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); - } - - @EventHandler - public void load(final FMLInitializationEvent e) { - Logger.INFO("Begin resource allocation for " + GTPlusPlusEverglades.ID + " V" + Everglades.VERSION); - - // Load World and Biome - GameRegistry.registerWorldGenerator(new WorldGen_GT_Base(), Short.MAX_VALUE); - getEvergladesBiome().load(); - Everglades_Dimension.load(); - addToVoidMinerDrops(); - } - - public static synchronized void GenerateOreMaterials() { - MaterialGenerator.generateOreMaterial(ORES.CROCROITE); - MaterialGenerator.generateOreMaterial(ORES.GEIKIELITE); - MaterialGenerator.generateOreMaterial(ORES.NICHROMITE); - MaterialGenerator.generateOreMaterial(ORES.TITANITE); - MaterialGenerator.generateOreMaterial(ORES.ZIMBABWEITE); - MaterialGenerator.generateOreMaterial(ORES.ZIRCONILITE); - MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_CE); - MaterialGenerator.generateOreMaterial(ORES.GADOLINITE_Y); - MaterialGenerator.generateOreMaterial(ORES.LEPERSONNITE); - MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_Y); - MaterialGenerator.generateOreMaterial(ORES.SAMARSKITE_YB); - MaterialGenerator.generateOreMaterial(ORES.XENOTIME); - MaterialGenerator.generateOreMaterial(ORES.YTTRIAITE); - MaterialGenerator.generateOreMaterial(ORES.YTTRIALITE); - MaterialGenerator.generateOreMaterial(ORES.YTTROCERITE); - MaterialGenerator.generateOreMaterial(ORES.ZIRCON); - MaterialGenerator.generateOreMaterial(ORES.POLYCRASE); - MaterialGenerator.generateOreMaterial(ORES.ZIRCOPHYLLITE); - MaterialGenerator.generateOreMaterial(ORES.ZIRKELITE); - MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_LA); - MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_CE); - MaterialGenerator.generateOreMaterial(ORES.LANTHANITE_ND); - MaterialGenerator.generateOreMaterial(ORES.AGARDITE_Y); - MaterialGenerator.generateOreMaterial(ORES.AGARDITE_CD); - MaterialGenerator.generateOreMaterial(ORES.AGARDITE_LA); - MaterialGenerator.generateOreMaterial(ORES.AGARDITE_ND); - MaterialGenerator.generateOreMaterial(ORES.HIBONITE); - MaterialGenerator.generateOreMaterial(ORES.CERITE); - MaterialGenerator.generateOreMaterial(ORES.FLUORCAPHITE); - MaterialGenerator.generateOreMaterial(ORES.FLORENCITE); - MaterialGenerator.generateOreMaterial(ORES.CRYOLITE); - - MaterialGenerator.generateOreMaterial(ORES.LAUTARITE); - MaterialGenerator.generateOreMaterial(ORES.LAFOSSAITE); - MaterialGenerator.generateOreMaterial(ORES.DEMICHELEITE_BR); - MaterialGenerator.generateOreMaterial(ORES.COMANCHEITE); - MaterialGenerator.generateOreMaterial(ORES.PERROUDITE); - MaterialGenerator.generateOreMaterial(ORES.HONEAITE); - MaterialGenerator.generateOreMaterial(ORES.ALBURNITE); - MaterialGenerator.generateOreMaterial(ORES.MIESSIITE); - MaterialGenerator.generateOreMaterial(ORES.KASHINITE); - MaterialGenerator.generateOreMaterial(ORES.IRARSITE); - MaterialGenerator.generateOreMaterial(ORES.GREENOCKITE); - MaterialGenerator.generateOreMaterial(ORES.RADIOBARITE); - MaterialGenerator.generateOreMaterial(ORES.DEEP_EARTH_REACTOR_FUEL_DEPOSIT); - - } - - protected synchronized void setVars(FMLPreInitializationEvent event) { - // Init WorldGen config. - HANDLER_GT.sCustomWorldgenFile = new GTPP_Config( - new Configuration( - new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "WorldGeneration.cfg"))); - - if (DimensionManager.isDimensionRegistered(Dimension_Everglades.DIMID)) { - Dimension_Everglades.DIMID = DimensionManager.getNextFreeDimId(); - } - - /* - * Set World Generation Values - */ - WorldGen_Ores.generateValidOreVeins(); - WorldGen_GT_Base.oreveinPercentage = 64; - WorldGen_GT_Base.oreveinAttempts = 16; - WorldGen_GT_Base.oreveinMaxPlacementAttempts = 4; - if (CORE_Preloader.DEBUG_MODE || CORE.DEVENV) { - WorldGen_GT_Base.debugWorldGen = true; - } - DarkWorldContentLoader.run(); - } - - public void addToVoidMinerDrops() { - for (WorldGen_GT_Ore_Layer t : WorldGen_Ores.validOreveins.values()) { - addVMDrop(t.mPrimaryMeta, 0, t.mWeight); - addVMDrop(t.mSecondaryMeta, 0, t.mWeight); - addVMDrop(t.mBetweenMeta, 0, t.mWeight / 8f); - addVMDrop(t.mSporadicMeta, 0, t.mWeight / 8f); - } - } - - public void addVMDrop(Block block, int meta, float weight) { - GT_TileEntity_VoidMiner_Base.addBlockToDimensionList(CORE.EVERGLADES_ID, block, meta, weight); - } - - @EventHandler - public void serverLoad(FMLServerStartingEvent event) { - getEvergladesBiome().serverLoad(event); - } - - @EventHandler - public static void postInit(final FMLPostInitializationEvent e) { - Logger.INFO("Finished loading Everglades plugin for GT++."); - } - - public static synchronized Biome_Everglades getEvergladesBiome() { - return Everglades_Biome; - } - - public static synchronized void setEvergladesBiome(Biome_Everglades darkWorld_Biome) { - Everglades_Biome = darkWorld_Biome; - } - - @Override - public void actionPerformed(ActionEvent arg0) { - // TODO Auto-generated method stub - - } -} diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java new file mode 100644 index 0000000000..8394bd8385 --- /dev/null +++ b/src/main/java/gtPlusPlus/everglades/biome/BiomeEverglades.java @@ -0,0 +1,84 @@ +package gtPlusPlus.everglades.biome; + +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntityPigZombie; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.passive.EntitySquid; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeManager; + +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.event.FMLServerStartingEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.entity.monster.EntitySickBlaze; +import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; +import gtPlusPlus.core.lib.GTPPCore; +import gtPlusPlus.everglades.dimension.DimensionEverglades; + +public class BiomeEverglades { + + public static BiomeGenEverglades biome = new BiomeGenEverglades(); + + public Object instance; + + public BiomeEverglades() {} + + public void load() { + BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DEAD); + BiomeManager.addSpawnBiome(biome); + } + + public void serverLoad(FMLServerStartingEvent event) {} + + public void preInit(FMLPreInitializationEvent event) {} + + static class BiomeGenEverglades extends BiomeGenBase { + + @SuppressWarnings("unchecked") + public BiomeGenEverglades() { + super(GTPPCore.EVERGLADESBIOME_ID); + // this.setBiomeID(); + this.theBiomeDecorator = new CustomBiomeGenerator(); + this.theBiomeDecorator.treesPerChunk = 10; + // Logger.INFO("Dark World Temperature Category: "+getTempCategory()); + this.setBiomeName("Toxic Everglades"); + this.topBlock = DimensionEverglades.blockTopLayer; + this.fillerBlock = DimensionEverglades.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)); + } + + @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.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c)); + return true; + } + } +} diff --git a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java b/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java deleted file mode 100644 index fce5efca36..0000000000 --- a/src/main/java/gtPlusPlus/everglades/biome/BiomeGenerator_Custom.java +++ /dev/null @@ -1,361 +0,0 @@ -package gtPlusPlus.everglades.biome; - -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM; -import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS; -import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE; - -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.WorldGenAbstractTree; -import net.minecraft.world.gen.feature.WorldGenBigMushroom; -import net.minecraft.world.gen.feature.WorldGenCactus; -import net.minecraft.world.gen.feature.WorldGenDeadBush; -import net.minecraft.world.gen.feature.WorldGenFlowers; -import net.minecraft.world.gen.feature.WorldGenLiquids; -import net.minecraft.world.gen.feature.WorldGenPumpkin; -import net.minecraft.world.gen.feature.WorldGenReed; -import net.minecraft.world.gen.feature.WorldGenerator; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.terraingen.DecorateBiomeEvent; -import net.minecraftforge.event.terraingen.OreGenEvent; -import net.minecraftforge.event.terraingen.TerrainGen; - -import gtPlusPlus.everglades.gen.WorldGenDeadLilly; -import gtPlusPlus.everglades.gen.WorldGenMinable_Custom; - -public class BiomeGenerator_Custom extends BiomeDecorator { - - public WorldGenerator fluoriteGen; - - 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); - - // 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); - } -} diff --git a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java b/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java deleted file mode 100644 index f9b57b14c8..0000000000 --- a/src/main/java/gtPlusPlus/everglades/biome/Biome_Everglades.java +++ /dev/null @@ -1,84 +0,0 @@ -package gtPlusPlus.everglades.biome; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.monster.EntityPigZombie; -import net.minecraft.entity.passive.EntityBat; -import net.minecraft.entity.passive.EntitySquid; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeManager; - -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gtPlusPlus.core.entity.monster.EntitySickBlaze; -import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.everglades.dimension.Dimension_Everglades; - -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 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)); - } - - @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.spawnableCaveCreatureList.add(new SpawnListEntry(EntityClass, a, b, c)); - return true; - } - } -} diff --git a/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java b/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java new file mode 100644 index 0000000000..4df290b560 --- /dev/null +++ b/src/main/java/gtPlusPlus/everglades/biome/CustomBiomeGenerator.java @@ -0,0 +1,361 @@ +package gtPlusPlus.everglades.biome; + +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.BIG_SHROOM; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CACTUS; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.CLAY; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LILYPAD; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.PUMPKIN; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.REED; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SAND_PASS2; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.SHROOM; +import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.COAL; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIAMOND; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GOLD; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.GRAVEL; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.IRON; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.LAPIS; +import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.REDSTONE; + +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.WorldGenAbstractTree; +import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import net.minecraft.world.gen.feature.WorldGenCactus; +import net.minecraft.world.gen.feature.WorldGenDeadBush; +import net.minecraft.world.gen.feature.WorldGenFlowers; +import net.minecraft.world.gen.feature.WorldGenLiquids; +import net.minecraft.world.gen.feature.WorldGenPumpkin; +import net.minecraft.world.gen.feature.WorldGenReed; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.DecorateBiomeEvent; +import net.minecraftforge.event.terraingen.OreGenEvent; +import net.minecraftforge.event.terraingen.TerrainGen; + +import gtPlusPlus.everglades.gen.WorldGenDeadLilly; +import gtPlusPlus.everglades.gen.WorldGenMinableCustom; + +public class CustomBiomeGenerator extends BiomeDecorator { + + public WorldGenerator fluoriteGen; + + public CustomBiomeGenerator() { + // Basic Blocks + this.sandGen = new WorldGenMinableCustom(Blocks.sand, 12); + this.gravelAsSandGen = new WorldGenMinableCustom(Blocks.gravel, 8); + this.dirtGen = new WorldGenMinableCustom(Blocks.dirt, 32); + this.gravelGen = new WorldGenMinableCustom(Blocks.gravel, 12); + + // Oregen + this.coalGen = new WorldGenMinableCustom(Blocks.coal_ore, 16); + this.ironGen = new WorldGenMinableCustom(Blocks.iron_ore, 12); + this.goldGen = new WorldGenMinableCustom(Blocks.gold_ore, 12); + this.redstoneGen = new WorldGenMinableCustom(Blocks.redstone_ore, 10); + this.diamondGen = new WorldGenMinableCustom(Blocks.diamond_ore, 12); + this.lapisGen = new WorldGenMinableCustom(Blocks.lapis_ore, 8); + + // 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 generatio