Beginnings of an API - Biomes done

This commit is contained in:
Amnet 2013-04-09 23:26:24 +02:00
parent fe26d931a1
commit 794b53ae55
7 changed files with 706 additions and 582 deletions

View File

@ -0,0 +1,89 @@
package tdwp_ftw.biomesop.api;
import net.minecraft.world.biome.BiomeGenBase;
import com.google.common.base.Optional;
public class Biomes
{
public static Optional<? extends BiomeGenBase> alps = Optional.absent();
public static Optional<? extends BiomeGenBase> arctic = Optional.absent();
public static Optional<? extends BiomeGenBase> badlands = Optional.absent();
public static Optional<? extends BiomeGenBase> bambooForest = Optional.absent();
public static Optional<? extends BiomeGenBase> bayou = Optional.absent();
public static Optional<? extends BiomeGenBase> birchForest = Optional.absent();
public static Optional<? extends BiomeGenBase> bog = Optional.absent();
public static Optional<? extends BiomeGenBase> borealForest = Optional.absent();
public static Optional<? extends BiomeGenBase> canyon = Optional.absent();
public static Optional<? extends BiomeGenBase> chaparral = Optional.absent();
public static Optional<? extends BiomeGenBase> cherryBlossomGrove = Optional.absent();
public static Optional<? extends BiomeGenBase> coniferousForest = Optional.absent();
public static Optional<? extends BiomeGenBase> crag = Optional.absent();
public static Optional<? extends BiomeGenBase> deadForest = Optional.absent();
public static Optional<? extends BiomeGenBase> deadSwamp = Optional.absent();
public static Optional<? extends BiomeGenBase> deadlands = Optional.absent();
public static Optional<? extends BiomeGenBase> deciduousForest = Optional.absent();
public static Optional<? extends BiomeGenBase> drylands = Optional.absent();
public static Optional<? extends BiomeGenBase> dunes = Optional.absent();
public static Optional<? extends BiomeGenBase> fen = Optional.absent();
public static Optional<? extends BiomeGenBase> field = Optional.absent();
public static Optional<? extends BiomeGenBase> frostForest = Optional.absent();
public static Optional<? extends BiomeGenBase> fungiForest = Optional.absent();
public static Optional<? extends BiomeGenBase> garden = Optional.absent();
public static Optional<? extends BiomeGenBase> glacier = Optional.absent();
public static Optional<? extends BiomeGenBase> grassland = Optional.absent();
public static Optional<? extends BiomeGenBase> grove = Optional.absent();
public static Optional<? extends BiomeGenBase> heathland = Optional.absent();
public static Optional<? extends BiomeGenBase> highland = Optional.absent();
public static Optional<? extends BiomeGenBase> iceSheet = Optional.absent();
public static Optional<? extends BiomeGenBase> icyHills = Optional.absent();
public static Optional<? extends BiomeGenBase> jadeCliffs = Optional.absent();
public static Optional<? extends BiomeGenBase> lushDesert = Optional.absent();
public static Optional<? extends BiomeGenBase> lushSwamp = Optional.absent();
public static Optional<? extends BiomeGenBase> mangrove = Optional.absent();
public static Optional<? extends BiomeGenBase> mapleWoods = Optional.absent();
public static Optional<? extends BiomeGenBase> marsh = Optional.absent();
public static Optional<? extends BiomeGenBase> meadow = Optional.absent();
public static Optional<? extends BiomeGenBase> mesa = Optional.absent();
public static Optional<? extends BiomeGenBase> moor = Optional.absent();
public static Optional<? extends BiomeGenBase> mountain = Optional.absent();
public static Optional<? extends BiomeGenBase> mysticGrove = Optional.absent();
public static Optional<? extends BiomeGenBase> oasis = Optional.absent();
public static Optional<? extends BiomeGenBase> ominousWoods = Optional.absent();
public static Optional<? extends BiomeGenBase> orchard = Optional.absent();
public static Optional<? extends BiomeGenBase> originValley = Optional.absent();
public static Optional<? extends BiomeGenBase> outback = Optional.absent();
public static Optional<? extends BiomeGenBase> pasture = Optional.absent();
public static Optional<? extends BiomeGenBase> prairie = Optional.absent();
public static Optional<? extends BiomeGenBase> promisedLand = Optional.absent();
public static Optional<? extends BiomeGenBase> quagmire = Optional.absent();
public static Optional<? extends BiomeGenBase> rainforest = Optional.absent();
public static Optional<? extends BiomeGenBase> redwoodForest = Optional.absent();
public static Optional<? extends BiomeGenBase> sacredSprings = Optional.absent();
public static Optional<? extends BiomeGenBase> savanna = Optional.absent();
public static Optional<? extends BiomeGenBase> scrubland = Optional.absent();
public static Optional<? extends BiomeGenBase> seasonalForest = Optional.absent();
public static Optional<? extends BiomeGenBase> shield = Optional.absent();
public static Optional<? extends BiomeGenBase> shore = Optional.absent();
public static Optional<? extends BiomeGenBase> shrubland = Optional.absent();
public static Optional<? extends BiomeGenBase> snowyWoods = Optional.absent();
public static Optional<? extends BiomeGenBase> spruceWoods = Optional.absent();
public static Optional<? extends BiomeGenBase> steppe = Optional.absent();
public static Optional<? extends BiomeGenBase> swampwoods = Optional.absent();
public static Optional<? extends BiomeGenBase> temperateRainforest = Optional.absent();
public static Optional<? extends BiomeGenBase> thicket = Optional.absent();
public static Optional<? extends BiomeGenBase> tropicalRainforest = Optional.absent();
public static Optional<? extends BiomeGenBase> tropics = Optional.absent();
public static Optional<? extends BiomeGenBase> tundra = Optional.absent();
public static Optional<? extends BiomeGenBase> volcano = Optional.absent();
public static Optional<? extends BiomeGenBase> wasteland = Optional.absent();
public static Optional<? extends BiomeGenBase> wetland = Optional.absent();
public static Optional<? extends BiomeGenBase> woodland = Optional.absent();
public static Optional<? extends BiomeGenBase> plainsNew = Optional.absent();
public static Optional<? extends BiomeGenBase> desertNew = Optional.absent();
public static Optional<? extends BiomeGenBase> extremeHillsNew = Optional.absent();
public static Optional<? extends BiomeGenBase> forestNew = Optional.absent();
public static Optional<? extends BiomeGenBase> taigaNew = Optional.absent();
public static Optional<? extends BiomeGenBase> swamplandNew = Optional.absent();
public static Optional<? extends BiomeGenBase> jungleNew = Optional.absent();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,26 @@
package tdwp_ftw.biomesop.helpers; package tdwp_ftw.biomesop.helpers;
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.declarations.BOPBiomes;
import tdwp_ftw.biomesop.helpers.BiomeCachePromised;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.world.ChunkPosition; import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldType; import net.minecraft.world.WorldType;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache; import net.minecraft.world.gen.layer.IntCache;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.MinecraftForge;
import net.minecraft.world.biome.BiomeCache; import net.minecraftforge.event.terraingen.WorldTypeEvent;
import net.minecraft.world.biome.WorldChunkManager; import tdwp_ftw.biomesop.api.Biomes;
import cpw.mods.fml.relauncher.Side;
import net.minecraftforge.common.*; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.event.terraingen.*;
import static net.minecraft.world.biome.BiomeGenBase.*;
public class WorldChunkManagerPromised extends WorldChunkManager public class WorldChunkManagerPromised extends WorldChunkManager
{ {
public static ArrayList<BiomeGenBase> allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(BOPBiomes.promisedLand)); public static ArrayList<BiomeGenBase> allowedBiomes = new ArrayList<BiomeGenBase>(Arrays.asList(Biomes.promisedLand.get()));
private GenLayer genBiomes; private GenLayer genBiomes;
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */ /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */

View File

@ -1,29 +1,25 @@
package tdwp_ftw.biomesop.helpers; package tdwp_ftw.biomesop.helpers;
import tdwp_ftw.biomesop.mod_BiomesOPlenty;
import tdwp_ftw.biomesop.declarations.BOPBiomes;
import tdwp_ftw.biomesop.declarations.BOPBlocks;
import tdwp_ftw.biomesop.declarations.BOPConfiguration;
//import tdwp_ftw.biomesop.helpers.WorldChunkManagerPromised;
import net.minecraft.block.Block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.gen.ChunkProviderHell;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.util.MathHelper; import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3; import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;
import tdwp_ftw.biomesop.api.Biomes;
import tdwp_ftw.biomesop.declarations.BOPBlocks;
import tdwp_ftw.biomesop.declarations.BOPConfiguration;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
//import tdwp_ftw.biomesop.helpers.WorldChunkManagerPromised;
public class WorldProviderPromised extends WorldProvider public class WorldProviderPromised extends WorldProvider
{ {
public void registerWorldChunkManager() public void registerWorldChunkManager()
{ {
this.worldChunkMgr = new WorldChunkManagerHell(BOPBiomes.promisedLand, 0.8F, 0.1F); if (Biomes.promisedLand.isPresent())
this.worldChunkMgr = new WorldChunkManagerHell(Biomes.promisedLand.get(), 0.8F, 0.1F);
//this.worldChunkMgr = new WorldChunkManagerPromised(worldObj); //this.worldChunkMgr = new WorldChunkManagerPromised(worldObj);
this.dimensionId = BOPConfiguration.promisedLandDimID; this.dimensionId = BOPConfiguration.promisedLandDimID;
} }

View File

@ -23,6 +23,7 @@ import net.minecraftforge.common.AchievementPage;
import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import tdwp_ftw.biomesop.api.Biomes;
import tdwp_ftw.biomesop.declarations.BOPBiomes; import tdwp_ftw.biomesop.declarations.BOPBiomes;
import tdwp_ftw.biomesop.declarations.BOPBlocks; import tdwp_ftw.biomesop.declarations.BOPBlocks;
import tdwp_ftw.biomesop.declarations.BOPConfiguration; import tdwp_ftw.biomesop.declarations.BOPConfiguration;
@ -162,12 +163,14 @@ public class mod_BiomesOPlenty
EntityRegistry.registerModEntity(EntityJungleSpider.class, "JungleSpider", BOPConfiguration.jungleSpiderID, this, 80, 3, true); EntityRegistry.registerModEntity(EntityJungleSpider.class, "JungleSpider", BOPConfiguration.jungleSpiderID, this, 80, 3, true);
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.JungleSpider.name", "en_US", "Jungle Spider"); LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.JungleSpider.name", "en_US", "Jungle Spider");
EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, BOPBiomes.jungleNew, BOPBiomes.tropicalRainforest, BOPBiomes.oasis, BOPBiomes.tropics); if (Biomes.jungleNew.isPresent() && Biomes.tropicalRainforest.isPresent() && Biomes.oasis.isPresent() && Biomes.tropics.isPresent())
EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, Biomes.jungleNew.get(), Biomes.tropicalRainforest.get(), Biomes.oasis.get(), Biomes.tropics.get());
registerEntityEgg(EntityJungleSpider.class, 5147192, 11013646); registerEntityEgg(EntityJungleSpider.class, 5147192, 11013646);
EntityRegistry.registerModEntity(EntityRosester.class, "Rosester", BOPConfiguration.rosesterID, this, 80, 3, true); EntityRegistry.registerModEntity(EntityRosester.class, "Rosester", BOPConfiguration.rosesterID, this, 80, 3, true);
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Rosester.name", "en_US", "Rosester"); LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Rosester.name", "en_US", "Rosester");
EntityRegistry.addSpawn(EntityRosester.class, 10, 2, 4, EnumCreatureType.creature, BOPBiomes.garden); if (Biomes.garden.isPresent())
EntityRegistry.addSpawn(EntityRosester.class, 10, 2, 4, EnumCreatureType.creature, Biomes.garden.get());
registerEntityEgg(EntityRosester.class, 14831439, 16756224); registerEntityEgg(EntityRosester.class, 14831439, 16756224);
EntityRegistry.registerModEntity(EntityMudball.class, "MudBall", EntityRegistry.findGlobalUniqueEntityId(), this, 80, 3, true); EntityRegistry.registerModEntity(EntityMudball.class, "MudBall", EntityRegistry.findGlobalUniqueEntityId(), this, 80, 3, true);

View File

@ -1,10 +1,11 @@
package tdwp_ftw.biomesop.worldtype; package tdwp_ftw.biomesop.worldtype;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import tdwp_ftw.biomesop.mod_BiomesOPlenty; import tdwp_ftw.biomesop.api.Biomes;
import tdwp_ftw.biomesop.declarations.BOPBiomes;
import tdwp_ftw.biomesop.declarations.BOPConfiguration; import tdwp_ftw.biomesop.declarations.BOPConfiguration;
import com.google.common.base.Optional;
public class WTBiomesOP extends WorldTypeBase public class WTBiomesOP extends WorldTypeBase
{ {
public WTBiomesOP() { public WTBiomesOP() {
@ -20,167 +21,167 @@ public class WTBiomesOP extends WorldTypeBase
if (BOPConfiguration.alpsGen == true) if (BOPConfiguration.alpsGen == true)
{ {
this.addNewBiome(BOPBiomes.alps); addNewBiome(Biomes.alps);
} }
if (BOPConfiguration.arcticGen == true) if (BOPConfiguration.arcticGen == true)
{ {
this.addNewBiome(BOPBiomes.arctic); addNewBiome(Biomes.arctic);
} }
if (BOPConfiguration.badlandsGen == true) if (BOPConfiguration.badlandsGen == true)
{ {
this.addNewBiome(BOPBiomes.badlands); addNewBiome(Biomes.badlands);
} }
if (BOPConfiguration.bambooForestGen == true) if (BOPConfiguration.bambooForestGen == true)
{ {
this.addNewBiome(BOPBiomes.bambooForest); addNewBiome(Biomes.bambooForest);
} }
if (BOPConfiguration.bayouGen == true) if (BOPConfiguration.bayouGen == true)
{ {
this.addNewBiome(BOPBiomes.bayou); addNewBiome(Biomes.bayou);
} }
if (BOPConfiguration.birchForestGen == true) if (BOPConfiguration.birchForestGen == true)
{ {
this.addNewBiome(BOPBiomes.birchForest); addNewBiome(Biomes.birchForest);
} }
if (BOPConfiguration.bogGen == true) if (BOPConfiguration.bogGen == true)
{ {
this.addNewBiome(BOPBiomes.bog); addNewBiome(Biomes.bog);
} }
if (BOPConfiguration.borealForestGen == true) if (BOPConfiguration.borealForestGen == true)
{ {
this.addNewBiome(BOPBiomes.borealForest); addNewBiome(Biomes.borealForest);
} }
if (BOPConfiguration.canyonGen == true) if (BOPConfiguration.canyonGen == true)
{ {
this.addNewBiome(BOPBiomes.canyon); addNewBiome(Biomes.canyon);
} }
if (BOPConfiguration.chaparralGen == true) if (BOPConfiguration.chaparralGen == true)
{ {
this.addNewBiome(BOPBiomes.chaparral); addNewBiome(Biomes.chaparral);
} }
if (BOPConfiguration.cherryBlossomGroveGen == true) if (BOPConfiguration.cherryBlossomGroveGen == true)
{ {
this.addNewBiome(BOPBiomes.cherryBlossomGrove); addNewBiome(Biomes.cherryBlossomGrove);
} }
if (BOPConfiguration.coniferousForestGen == true) if (BOPConfiguration.coniferousForestGen == true)
{ {
this.addNewBiome(BOPBiomes.coniferousForest); addNewBiome(Biomes.coniferousForest);
} }
if (BOPConfiguration.cragGen == true) if (BOPConfiguration.cragGen == true)
{ {
this.addNewBiome(BOPBiomes.crag); addNewBiome(Biomes.crag);
} }
if (BOPConfiguration.deadForestGen == true) if (BOPConfiguration.deadForestGen == true)
{ {
this.addNewBiome(BOPBiomes.deadForest); addNewBiome(Biomes.deadForest);
} }
if (BOPConfiguration.deadSwampGen == true) if (BOPConfiguration.deadSwampGen == true)
{ {
this.addNewBiome(BOPBiomes.deadSwamp); addNewBiome(Biomes.deadSwamp);
} }
if (BOPConfiguration.deadlandsGen == true) if (BOPConfiguration.deadlandsGen == true)
{ {
this.addNewBiome(BOPBiomes.deadlands); addNewBiome(Biomes.deadlands);
} }
if (BOPConfiguration.deciduousForestGen == true) if (BOPConfiguration.deciduousForestGen == true)
{ {
this.addNewBiome(BOPBiomes.deciduousForest); addNewBiome(Biomes.deciduousForest);
} }
if (BOPConfiguration.drylandsGen == true) if (BOPConfiguration.drylandsGen == true)
{ {
this.addNewBiome(BOPBiomes.drylands); addNewBiome(Biomes.drylands);
} }
if (BOPConfiguration.dunesGen == true) if (BOPConfiguration.dunesGen == true)
{ {
this.addNewBiome(BOPBiomes.dunes); addNewBiome(Biomes.dunes);
} }
if (BOPConfiguration.fenGen == true) if (BOPConfiguration.fenGen == true)
{ {
this.addNewBiome(BOPBiomes.fen); addNewBiome(Biomes.fen);
} }
if (BOPConfiguration.fieldGen == true) if (BOPConfiguration.fieldGen == true)
{ {
this.addNewBiome(BOPBiomes.field); addNewBiome(Biomes.field);
} }
if (BOPConfiguration.frostForestGen == true) if (BOPConfiguration.frostForestGen == true)
{ {
this.addNewBiome(BOPBiomes.frostForest); addNewBiome(Biomes.frostForest);
} }
if (BOPConfiguration.fungiForestGen == true) if (BOPConfiguration.fungiForestGen == true)
{ {
this.addNewBiome(BOPBiomes.fungiForest); addNewBiome(Biomes.fungiForest);
} }
if (BOPConfiguration.gardenGen == true) if (BOPConfiguration.gardenGen == true)
{ {
this.addNewBiome(BOPBiomes.garden); addNewBiome(Biomes.garden);
} }
if (BOPConfiguration.glacierGen == true) if (BOPConfiguration.glacierGen == true)
{ {
this.addNewBiome(BOPBiomes.glacier); addNewBiome(Biomes.glacier);
} }
if (BOPConfiguration.grasslandGen == true) if (BOPConfiguration.grasslandGen == true)
{ {
this.addNewBiome(BOPBiomes.grassland); addNewBiome(Biomes.grassland);
} }
if (BOPConfiguration.groveGen == true) if (BOPConfiguration.groveGen == true)
{ {
this.addNewBiome(BOPBiomes.grove); addNewBiome(Biomes.grove);
} }
if (BOPConfiguration.heathlandGen == true) if (BOPConfiguration.heathlandGen == true)
{ {
this.addNewBiome(BOPBiomes.heathland); addNewBiome(Biomes.heathland);
} }
if (BOPConfiguration.highlandGen == true) if (BOPConfiguration.highlandGen == true)
{ {
this.addNewBiome(BOPBiomes.highland); addNewBiome(Biomes.highland);
} }
if (BOPConfiguration.iceSheetGen == true) if (BOPConfiguration.iceSheetGen == true)
{ {
this.addNewBiome(BOPBiomes.iceSheet); addNewBiome(Biomes.iceSheet);
} }
if (BOPConfiguration.icyHillsGen == true) if (BOPConfiguration.icyHillsGen == true)
{ {
this.addNewBiome(BOPBiomes.icyHills); addNewBiome(Biomes.icyHills);
} }
if (BOPConfiguration.jadeCliffsGen == true) if (BOPConfiguration.jadeCliffsGen == true)
{ {
this.addNewBiome(BOPBiomes.jadeCliffs); addNewBiome(Biomes.jadeCliffs);
} }
if (BOPConfiguration.lushDesertGen == true) if (BOPConfiguration.lushDesertGen == true)
{ {
this.addNewBiome(BOPBiomes.lushDesert); addNewBiome(Biomes.lushDesert);
} }
if (BOPConfiguration.lushSwampGen == true) if (BOPConfiguration.lushSwampGen == true)
{ {
this.addNewBiome(BOPBiomes.lushSwamp); addNewBiome(Biomes.lushSwamp);
} }
if (BOPConfiguration.mangroveGen == true) if (BOPConfiguration.mangroveGen == true)
{ {
this.addNewBiome(BOPBiomes.mangrove); addNewBiome(Biomes.mangrove);
} }
if (BOPConfiguration.mapleWoodsGen == true) if (BOPConfiguration.mapleWoodsGen == true)
{ {
this.addNewBiome(BOPBiomes.mapleWoods); addNewBiome(Biomes.mapleWoods);
} }
if (BOPConfiguration.marshGen == true) if (BOPConfiguration.marshGen == true)
{ {
this.addNewBiome(BOPBiomes.marsh); addNewBiome(Biomes.marsh);
} }
if (BOPConfiguration.meadowGen == true) if (BOPConfiguration.meadowGen == true)
{ {
this.addNewBiome(BOPBiomes.meadow); addNewBiome(Biomes.meadow);
} }
if (BOPConfiguration.mesaGen == true) if (BOPConfiguration.mesaGen == true)
{ {
this.addNewBiome(BOPBiomes.mesa); addNewBiome(Biomes.mesa);
} }
if (BOPConfiguration.moorGen == true) if (BOPConfiguration.moorGen == true)
{ {
this.addNewBiome(BOPBiomes.moor); addNewBiome(Biomes.moor);
} }
if (BOPConfiguration.mountainGen == true) if (BOPConfiguration.mountainGen == true)
{ {
this.addNewBiome(BOPBiomes.mountain); addNewBiome(Biomes.mountain);
} }
if (BOPConfiguration.mushroomIslandGen == true) if (BOPConfiguration.mushroomIslandGen == true)
{ {
@ -188,123 +189,123 @@ public class WTBiomesOP extends WorldTypeBase
} }
if (BOPConfiguration.mysticGroveGen == true) if (BOPConfiguration.mysticGroveGen == true)
{ {
this.addNewBiome(BOPBiomes.mysticGrove); addNewBiome(Biomes.mysticGrove);
} }
if (BOPConfiguration.oasisGen == true) if (BOPConfiguration.oasisGen == true)
{ {
this.addNewBiome(BOPBiomes.oasis); addNewBiome(Biomes.oasis);
} }
if (BOPConfiguration.ominousWoodsGen == true) if (BOPConfiguration.ominousWoodsGen == true)
{ {
this.addNewBiome(BOPBiomes.ominousWoods); addNewBiome(Biomes.ominousWoods);
} }
if (BOPConfiguration.orchardGen == true) if (BOPConfiguration.orchardGen == true)
{ {
this.addNewBiome(BOPBiomes.orchard); addNewBiome(Biomes.orchard);
} }
if (BOPConfiguration.originValleyGen == true) if (BOPConfiguration.originValleyGen == true)
{ {
this.addNewBiome(BOPBiomes.originValley); addNewBiome(Biomes.originValley);
} }
if (BOPConfiguration.outbackGen == true) if (BOPConfiguration.outbackGen == true)
{ {
this.addNewBiome(BOPBiomes.outback); addNewBiome(Biomes.outback);
} }
if (BOPConfiguration.pastureGen == true) if (BOPConfiguration.pastureGen == true)
{ {
this.addNewBiome(BOPBiomes.pasture); addNewBiome(Biomes.pasture);
} }
if (BOPConfiguration.prairieGen == true) if (BOPConfiguration.prairieGen == true)
{ {
this.addNewBiome(BOPBiomes.prairie); addNewBiome(Biomes.prairie);
} }
if (BOPConfiguration.quagmireGen == true) if (BOPConfiguration.quagmireGen == true)
{ {
this.addNewBiome(BOPBiomes.quagmire); addNewBiome(Biomes.quagmire);
} }
if (BOPConfiguration.rainforestGen == true) if (BOPConfiguration.rainforestGen == true)
{ {
this.addNewBiome(BOPBiomes.rainforest); addNewBiome(Biomes.rainforest);
} }
if (BOPConfiguration.redwoodForestGen == true) if (BOPConfiguration.redwoodForestGen == true)
{ {
this.addNewBiome(BOPBiomes.redwoodForest); addNewBiome(Biomes.redwoodForest);
} }
if (BOPConfiguration.sacredSpringsGen == true) if (BOPConfiguration.sacredSpringsGen == true)
{ {
this.addNewBiome(BOPBiomes.sacredSprings); addNewBiome(Biomes.sacredSprings);
} }
if (BOPConfiguration.savannaGen == true) if (BOPConfiguration.savannaGen == true)
{ {
this.addNewBiome(BOPBiomes.savanna); addNewBiome(Biomes.savanna);
} }
if (BOPConfiguration.scrublandGen == true) if (BOPConfiguration.scrublandGen == true)
{ {
this.addNewBiome(BOPBiomes.scrubland); addNewBiome(Biomes.scrubland);
} }
if (BOPConfiguration.seasonalForestGen == true) if (BOPConfiguration.seasonalForestGen == true)
{ {
this.addNewBiome(BOPBiomes.seasonalForest); addNewBiome(Biomes.seasonalForest);
} }
if (BOPConfiguration.shieldGen == true) if (BOPConfiguration.shieldGen == true)
{ {
this.addNewBiome(BOPBiomes.shield); addNewBiome(Biomes.shield);
} }
if (BOPConfiguration.shrublandGen == true) if (BOPConfiguration.shrublandGen == true)
{ {
this.addNewBiome(BOPBiomes.shrubland); addNewBiome(Biomes.shrubland);
} }
if (BOPConfiguration.snowyWoodsGen == true) if (BOPConfiguration.snowyWoodsGen == true)
{ {
this.addNewBiome(BOPBiomes.snowyWoods); addNewBiome(Biomes.snowyWoods);
} }
if (BOPConfiguration.spruceWoodsGen == true) if (BOPConfiguration.spruceWoodsGen == true)
{ {
this.addNewBiome(BOPBiomes.spruceWoods); addNewBiome(Biomes.spruceWoods);
} }
if (BOPConfiguration.steppeGen == true) if (BOPConfiguration.steppeGen == true)
{ {
this.addNewBiome(BOPBiomes.steppe); addNewBiome(Biomes.steppe);
} }
if (BOPConfiguration.swampwoodsGen == true) if (BOPConfiguration.swampwoodsGen == true)
{ {
this.addNewBiome(BOPBiomes.swampwoods); addNewBiome(Biomes.swampwoods);
} }
if (BOPConfiguration.temperateRainforestGen == true) if (BOPConfiguration.temperateRainforestGen == true)
{ {
this.addNewBiome(BOPBiomes.temperateRainforest); addNewBiome(Biomes.temperateRainforest);
} }
if (BOPConfiguration.thicketGen == true) if (BOPConfiguration.thicketGen == true)
{ {
this.addNewBiome(BOPBiomes.thicket); addNewBiome(Biomes.thicket);
} }
if (BOPConfiguration.tropicalRainforestGen == true) if (BOPConfiguration.tropicalRainforestGen == true)
{ {
this.addNewBiome(BOPBiomes.tropicalRainforest); addNewBiome(Biomes.tropicalRainforest);
} }
if (BOPConfiguration.tropicsGen == true) if (BOPConfiguration.tropicsGen == true)
{ {
this.addNewBiome(BOPBiomes.tropics); addNewBiome(Biomes.tropics);
} }
if (BOPConfiguration.tundraGen == true) if (BOPConfiguration.tundraGen == true)
{ {
this.addNewBiome(BOPBiomes.tundra); addNewBiome(Biomes.tundra);
} }
if (BOPConfiguration.volcanoGen == true) if (BOPConfiguration.volcanoGen == true)
{ {
this.addNewBiome(BOPBiomes.volcano); addNewBiome(Biomes.volcano);
} }
if (BOPConfiguration.wastelandGen == true) if (BOPConfiguration.wastelandGen == true)
{ {
this.addNewBiome(BOPBiomes.wasteland); addNewBiome(Biomes.wasteland);
} }
if (BOPConfiguration.wetlandGen == true) if (BOPConfiguration.wetlandGen == true)
{ {
this.addNewBiome(BOPBiomes.wetland); addNewBiome(Biomes.wetland);
} }
if (BOPConfiguration.woodlandGen == true) if (BOPConfiguration.woodlandGen == true)
{ {
this.addNewBiome(BOPBiomes.woodland); addNewBiome(Biomes.woodland);
} }
@ -312,7 +313,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.plainsNew); addNewBiome(Biomes.plainsNew);
} }
else else
{ {
@ -323,7 +324,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.desertNew); addNewBiome(Biomes.desertNew);
} }
else else
{ {
@ -334,7 +335,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.extremeHillsNew); addNewBiome(Biomes.extremeHillsNew);
} }
else else
{ {
@ -345,7 +346,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.forestNew); addNewBiome(Biomes.forestNew);
} }
else else
{ {
@ -356,7 +357,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.taigaNew); addNewBiome(Biomes.taigaNew);
} }
else else
{ {
@ -367,7 +368,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.swamplandNew); addNewBiome(Biomes.swamplandNew);
} }
else else
{ {
@ -378,7 +379,7 @@ public class WTBiomesOP extends WorldTypeBase
{ {
if (BOPConfiguration.vanillaEnhanced == true) if (BOPConfiguration.vanillaEnhanced == true)
{ {
this.addNewBiome(BOPBiomes.jungleNew); addNewBiome(Biomes.jungleNew);
} }
else else
{ {
@ -386,4 +387,10 @@ public class WTBiomesOP extends WorldTypeBase
} }
} }
} }
public void addNewBiome(Optional<? extends BiomeGenBase> biome)
{
if (biome.isPresent())
this.addNewBiome(biome.get());
}
} }

View File

@ -4,8 +4,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
import tdwp_ftw.biomesop.declarations.BOPBiomes;
import net.minecraft.world.ChunkPosition; import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldType; import net.minecraft.world.WorldType;
@ -14,6 +12,9 @@ import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.biome.WorldChunkManager;
import net.minecraft.world.gen.layer.GenLayer; import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache; import net.minecraft.world.gen.layer.IntCache;
import tdwp_ftw.biomesop.api.Biomes;
import com.google.common.base.Optional;
public class WorldChunkManagerBOP extends WorldChunkManager public class WorldChunkManagerBOP extends WorldChunkManager
{ {
@ -26,12 +27,12 @@ public class WorldChunkManagerBOP extends WorldChunkManager
private BiomeCache biomeCache; private BiomeCache biomeCache;
/** A list of biomes that the player can spawn in. */ /** A list of biomes that the player can spawn in. */
private List biomesToSpawnIn; private List<BiomeGenBase> biomesToSpawnIn;
protected WorldChunkManagerBOP() protected WorldChunkManagerBOP()
{ {
this.biomeCache = new BiomeCache(this); this.biomeCache = new BiomeCache(this);
this.biomesToSpawnIn = new ArrayList(); this.biomesToSpawnIn = new ArrayList<BiomeGenBase>();
this.biomesToSpawnIn.add(BiomeGenBase.forest); this.biomesToSpawnIn.add(BiomeGenBase.forest);
this.biomesToSpawnIn.add(BiomeGenBase.plains); this.biomesToSpawnIn.add(BiomeGenBase.plains);
this.biomesToSpawnIn.add(BiomeGenBase.taiga); this.biomesToSpawnIn.add(BiomeGenBase.taiga);
@ -40,60 +41,60 @@ public class WorldChunkManagerBOP extends WorldChunkManager
this.biomesToSpawnIn.add(BiomeGenBase.jungle); this.biomesToSpawnIn.add(BiomeGenBase.jungle);
this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); this.biomesToSpawnIn.add(BiomeGenBase.jungleHills);
this.biomesToSpawnIn.add(BOPBiomes.alps); addSpawnBiomes(Biomes.alps);
this.biomesToSpawnIn.add(BOPBiomes.arctic); addSpawnBiomes(Biomes.arctic);
this.biomesToSpawnIn.add(BOPBiomes.badlands); addSpawnBiomes(Biomes.badlands);
this.biomesToSpawnIn.add(BOPBiomes.bambooForest); addSpawnBiomes(Biomes.bambooForest);
this.biomesToSpawnIn.add(BOPBiomes.bayou); addSpawnBiomes(Biomes.bayou);
this.biomesToSpawnIn.add(BOPBiomes.birchForest); addSpawnBiomes(Biomes.birchForest);
this.biomesToSpawnIn.add(BOPBiomes.bog); addSpawnBiomes(Biomes.bog);
this.biomesToSpawnIn.add(BOPBiomes.borealForest); addSpawnBiomes(Biomes.borealForest);
this.biomesToSpawnIn.add(BOPBiomes.chaparral); addSpawnBiomes(Biomes.chaparral);
this.biomesToSpawnIn.add(BOPBiomes.cherryBlossomGrove); addSpawnBiomes(Biomes.cherryBlossomGrove);
this.biomesToSpawnIn.add(BOPBiomes.coniferousForest); addSpawnBiomes(Biomes.coniferousForest);
this.biomesToSpawnIn.add(BOPBiomes.crag); addSpawnBiomes(Biomes.crag);
this.biomesToSpawnIn.add(BOPBiomes.deadForest); addSpawnBiomes(Biomes.deadForest);
this.biomesToSpawnIn.add(BOPBiomes.deciduousForest); addSpawnBiomes(Biomes.deciduousForest);
this.biomesToSpawnIn.add(BOPBiomes.drylands); addSpawnBiomes(Biomes.drylands);
this.biomesToSpawnIn.add(BOPBiomes.dunes); addSpawnBiomes(Biomes.dunes);
this.biomesToSpawnIn.add(BOPBiomes.frostForest); addSpawnBiomes(Biomes.frostForest);
this.biomesToSpawnIn.add(BOPBiomes.glacier); addSpawnBiomes(Biomes.glacier);
this.biomesToSpawnIn.add(BOPBiomes.grassland); addSpawnBiomes(Biomes.grassland);
this.biomesToSpawnIn.add(BOPBiomes.grove); addSpawnBiomes(Biomes.grove);
this.biomesToSpawnIn.add(BOPBiomes.heathland); addSpawnBiomes(Biomes.heathland);
this.biomesToSpawnIn.add(BOPBiomes.highland); addSpawnBiomes(Biomes.highland);
this.biomesToSpawnIn.add(BOPBiomes.lushDesert); addSpawnBiomes(Biomes.lushDesert);
this.biomesToSpawnIn.add(BOPBiomes.lushSwamp); addSpawnBiomes(Biomes.lushSwamp);
this.biomesToSpawnIn.add(BOPBiomes.mangrove); addSpawnBiomes(Biomes.mangrove);
this.biomesToSpawnIn.add(BOPBiomes.mapleWoods); addSpawnBiomes(Biomes.mapleWoods);
this.biomesToSpawnIn.add(BOPBiomes.marsh); addSpawnBiomes(Biomes.marsh);
this.biomesToSpawnIn.add(BOPBiomes.meadow); addSpawnBiomes(Biomes.meadow);
this.biomesToSpawnIn.add(BOPBiomes.mesa); addSpawnBiomes(Biomes.mesa);
this.biomesToSpawnIn.add(BOPBiomes.mountain); addSpawnBiomes(Biomes.mountain);
this.biomesToSpawnIn.add(BOPBiomes.oasis); addSpawnBiomes(Biomes.oasis);
this.biomesToSpawnIn.add(BOPBiomes.orchard); addSpawnBiomes(Biomes.orchard);
this.biomesToSpawnIn.add(BOPBiomes.pasture); addSpawnBiomes(Biomes.pasture);
this.biomesToSpawnIn.add(BOPBiomes.prairie); addSpawnBiomes(Biomes.prairie);
this.biomesToSpawnIn.add(BOPBiomes.quagmire); addSpawnBiomes(Biomes.quagmire);
this.biomesToSpawnIn.add(BOPBiomes.rainforest); addSpawnBiomes(Biomes.rainforest);
this.biomesToSpawnIn.add(BOPBiomes.redwoodForest); addSpawnBiomes(Biomes.redwoodForest);
this.biomesToSpawnIn.add(BOPBiomes.savanna); addSpawnBiomes(Biomes.savanna);
this.biomesToSpawnIn.add(BOPBiomes.scrubland); addSpawnBiomes(Biomes.scrubland);
this.biomesToSpawnIn.add(BOPBiomes.seasonalForest); addSpawnBiomes(Biomes.seasonalForest);
this.biomesToSpawnIn.add(BOPBiomes.shrubland); addSpawnBiomes(Biomes.shrubland);
this.biomesToSpawnIn.add(BOPBiomes.steppe); addSpawnBiomes(Biomes.steppe);
this.biomesToSpawnIn.add(BOPBiomes.temperateRainforest); addSpawnBiomes(Biomes.temperateRainforest);
this.biomesToSpawnIn.add(BOPBiomes.tropicalRainforest); addSpawnBiomes(Biomes.tropicalRainforest);
this.biomesToSpawnIn.add(BOPBiomes.tropics); addSpawnBiomes(Biomes.tropics);
this.biomesToSpawnIn.add(BOPBiomes.tundra); addSpawnBiomes(Biomes.tundra);
this.biomesToSpawnIn.add(BOPBiomes.volcano); addSpawnBiomes(Biomes.volcano);
this.biomesToSpawnIn.add(BOPBiomes.wetland); addSpawnBiomes(Biomes.wetland);
this.biomesToSpawnIn.add(BOPBiomes.woodland); addSpawnBiomes(Biomes.woodland);
this.biomesToSpawnIn.add(BOPBiomes.forestNew); addSpawnBiomes(Biomes.forestNew);
this.biomesToSpawnIn.add(BOPBiomes.plainsNew); addSpawnBiomes(Biomes.plainsNew);
this.biomesToSpawnIn.add(BOPBiomes.taigaNew); addSpawnBiomes(Biomes.taigaNew);
this.biomesToSpawnIn.add(BOPBiomes.jungleNew); addSpawnBiomes(Biomes.jungleNew);
} }
public WorldChunkManagerBOP(long par1, WorldType par3WorldType) public WorldChunkManagerBOP(long par1, WorldType par3WorldType)
@ -112,7 +113,7 @@ public class WorldChunkManagerBOP extends WorldChunkManager
/** /**
* Gets the list of valid biomes for the player to spawn in. * Gets the list of valid biomes for the player to spawn in.
*/ */
public List getBiomesToSpawnIn() public List<BiomeGenBase> getBiomesToSpawnIn()
{ {
return this.biomesToSpawnIn; return this.biomesToSpawnIn;
} }
@ -321,4 +322,10 @@ public class WorldChunkManagerBOP extends WorldChunkManager
{ {
this.biomeCache.cleanupCache(); this.biomeCache.cleanupCache();
} }
private void addSpawnBiomes(Optional<? extends BiomeGenBase> biome)
{
if (biome.isPresent())
this.biomesToSpawnIn.add(biome.get());
}
} }