Added Spectral Garden and other End-related things

This commit is contained in:
Matt Caughey 2014-07-31 18:25:10 -04:00
parent 42a2b3ea2d
commit ed88488eff
8 changed files with 168 additions and 1 deletions

View file

@ -87,6 +87,9 @@ public class BOPCBiomes
public static BiomeGenBase visceralHeap; public static BiomeGenBase visceralHeap;
public static BiomeGenBase polarChasm; public static BiomeGenBase polarChasm;
//End Biomes
public static BiomeGenBase spectralGarden;
//River Biomes //River Biomes
public static BiomeGenBase lushRiver; public static BiomeGenBase lushRiver;
public static BiomeGenBase dryRiver; public static BiomeGenBase dryRiver;

View file

@ -0,0 +1,36 @@
package biomesoplenty.common.biome;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.world.biome.BiomeGenBase;
import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.common.biome.decoration.BOPEndBiomeDecorator;
import biomesoplenty.common.biome.decoration.BOPNetherBiomeDecorator;
public class BOPEndBiome extends BOPBiome<BOPEndBiomeDecorator>
{
public BOPEndBiome(int id)
{
super(id, BOPEndBiomeDecorator.class);
this.setDisableRain();
this.setTemperatureRainfall(2.0F, 0.0F);
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableCaveCreatureList.clear();
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 4, 4));
}
@SideOnly(Side.CLIENT)
public int getSkyColorByTemp(float p_76731_1_)
{
return 0;
}
}

View file

@ -0,0 +1,83 @@
package biomesoplenty.common.biome.decoration;
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.TREE;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
import biomesoplenty.api.biome.BOPBiome;
import biomesoplenty.api.biome.BOPBiomeDecorator;
import biomesoplenty.common.world.generation.IBOPWorldGenerator;
import biomesoplenty.common.world.generation.WorldGenFieldAssociation;
public class BOPEndBiomeDecorator extends BOPBiomeDecorator<EndBiomeFeatures>
{
public BOPEndBiomeDecorator()
{
super(EndBiomeFeatures.class);
}
@Override
protected void genDecorations(BiomeGenBase biome)
{
BOPBiome bopBiome = (BOPBiome)biome;
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z));
int i;
int x;
int y;
int z;
int perChunk = this.treesPerChunk;
if (this.randomGenerator.nextInt(10) == 0)
{
++perChunk;
}
boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, TREE);
for (i = 0; doGen && i < perChunk; ++i)
{
x = this.chunk_X + this.randomGenerator.nextInt(16) + 8;
z = this.chunk_Z + this.randomGenerator.nextInt(16) + 8;
y = this.nextInt(128);
WorldGenAbstractTree worldgenabstracttree = biome.func_150567_a(this.randomGenerator);
worldgenabstracttree.setScale(1.0D, 1.0D, 1.0D);
if (worldgenabstracttree.generate(this.currentWorld, this.randomGenerator, x, y, z))
{
worldgenabstracttree.func_150524_b(this.currentWorld, this.randomGenerator, x, y, z);
}
}
for (String featureName : bopFeatures.getFeatureNames())
{
if (featureName.equals("bopFlowersPerChunk"))
{
if (!TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS)) continue;
}
else if (featureName.equals("bopGrassPerChunk"))
{
if (!TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, GRASS)) continue;
}
WorldGenFieldAssociation.WorldFeature worldFeature = WorldGenFieldAssociation.getAssociatedFeature(featureName);
if (worldFeature != null)
{
IBOPWorldGenerator worldGenerator = worldFeature.getBOPWorldGenerator();
if (worldGenerator != null)
{
worldGenerator.setupGeneration(currentWorld, randomGenerator, bopBiome, featureName, chunk_X, chunk_Z);
}
}
}
MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Post(currentWorld, randomGenerator, chunk_X, chunk_Z));
}
}

View file

@ -0,0 +1,8 @@
package biomesoplenty.common.biome.decoration;
import biomesoplenty.api.biome.BiomeFeatures;
public class EndBiomeFeatures extends BiomeFeaturesBase
{
}

View file

@ -0,0 +1,25 @@
package biomesoplenty.common.biome.end;
import net.minecraft.init.Blocks;
import biomesoplenty.api.content.BOPCBlocks;
import biomesoplenty.common.biome.BOPEndBiome;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
public class BiomeGenSpectralGarden extends BOPEndBiome
{
public BiomeGenSpectralGarden(int id)
{
super(id);
this.setColor(15657658);
this.topBlock = BOPCBlocks.bopGrass;
this.fillerBlock = Blocks.end_stone;
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.bopFeatures.bopGrassPerChunk = 10;
this.theBiomeDecorator.bopFeatures.weightedGrassGen.put(new WorldGenBOPTallGrass(BOPCBlocks.plants, 4), 1D);
}
}

View file

@ -163,7 +163,7 @@ public class BlockBOPGeneric extends Block
{ {
if (biome != null) if (biome != null)
{ {
if (!areBiomesEqual(biome, BOPCBiomes.boneyard) && !areBiomesEqual(biome, BOPCBiomes.visceralHeap) && !areBiomesEqual(biome, BOPCBiomes.polarChasm) && !areBiomesEqual(biome, BOPCBiomes.undergarden) && if (!areBiomesEqual(biome, BOPCBiomes.spectralGarden) && !areBiomesEqual(biome, BOPCBiomes.boneyard) && !areBiomesEqual(biome, BOPCBiomes.visceralHeap) && !areBiomesEqual(biome, BOPCBiomes.polarChasm) && !areBiomesEqual(biome, BOPCBiomes.undergarden) &&
!areBiomesEqual(biome, BOPCBiomes.corruptedSands) && !areBiomesEqual(biome, BOPCBiomes.phantasmagoricInferno) && !areBiomesEqual(biome, BOPCBiomes.lushRiver) && !areBiomesEqual(biome, BOPCBiomes.dryRiver) && !areBiomesEqual(biome, BOPCBiomes.corruptedSands) && !areBiomesEqual(biome, BOPCBiomes.phantasmagoricInferno) && !areBiomesEqual(biome, BOPCBiomes.lushRiver) && !areBiomesEqual(biome, BOPCBiomes.dryRiver) &&
!areBiomesEqual(biome, BiomeGenBase.beach) && !areBiomesEqual(biome, BiomeGenBase.coldBeach) && !areBiomesEqual(biome, BiomeGenBase.stoneBeach) && !areBiomesEqual(biome, BiomeGenBase.frozenOcean) && !areBiomesEqual(biome, BiomeGenBase.beach) && !areBiomesEqual(biome, BiomeGenBase.coldBeach) && !areBiomesEqual(biome, BiomeGenBase.stoneBeach) && !areBiomesEqual(biome, BiomeGenBase.frozenOcean) &&
!areBiomesEqual(biome, BiomeGenBase.frozenRiver) && !areBiomesEqual(biome, BiomeGenBase.hell) && !areBiomesEqual(biome, BiomeGenBase.river) && !areBiomesEqual(biome, BiomeGenBase.sky) && !areBiomesEqual(biome, BiomeGenBase.frozenRiver) && !areBiomesEqual(biome, BiomeGenBase.hell) && !areBiomesEqual(biome, BiomeGenBase.river) && !areBiomesEqual(biome, BiomeGenBase.sky) &&

View file

@ -64,6 +64,7 @@ import static biomesoplenty.api.content.BOPCBiomes.shrubland;
import static biomesoplenty.api.content.BOPCBiomes.silkglades; import static biomesoplenty.api.content.BOPCBiomes.silkglades;
import static biomesoplenty.api.content.BOPCBiomes.sludgepit; import static biomesoplenty.api.content.BOPCBiomes.sludgepit;
import static biomesoplenty.api.content.BOPCBiomes.snowyConiferousForest; import static biomesoplenty.api.content.BOPCBiomes.snowyConiferousForest;
import static biomesoplenty.api.content.BOPCBiomes.spectralGarden;
import static biomesoplenty.api.content.BOPCBiomes.spruceWoods; import static biomesoplenty.api.content.BOPCBiomes.spruceWoods;
import static biomesoplenty.api.content.BOPCBiomes.steppe; import static biomesoplenty.api.content.BOPCBiomes.steppe;
import static biomesoplenty.api.content.BOPCBiomes.temperateRainforest; import static biomesoplenty.api.content.BOPCBiomes.temperateRainforest;
@ -94,6 +95,7 @@ import org.apache.logging.log4j.Level;
import biomesoplenty.api.BOPObfuscationHelper; import biomesoplenty.api.BOPObfuscationHelper;
import biomesoplenty.api.biome.BOPOverriddenBiome; import biomesoplenty.api.biome.BOPOverriddenBiome;
import biomesoplenty.api.content.BOPCBiomes; import biomesoplenty.api.content.BOPCBiomes;
import biomesoplenty.common.biome.end.BiomeGenSpectralGarden;
import biomesoplenty.common.biome.nether.BiomeGenBoneyard; import biomesoplenty.common.biome.nether.BiomeGenBoneyard;
import biomesoplenty.common.biome.nether.BiomeGenCorruptedSands; import biomesoplenty.common.biome.nether.BiomeGenCorruptedSands;
import biomesoplenty.common.biome.nether.BiomeGenPhantasmagoricInferno; import biomesoplenty.common.biome.nether.BiomeGenPhantasmagoricInferno;
@ -314,6 +316,9 @@ public class BOPBiomes
undergarden = registerNetherBiome(BiomeGenUndergarden.class, "Undergarden", 10); undergarden = registerNetherBiome(BiomeGenUndergarden.class, "Undergarden", 10);
polarChasm = registerNetherBiome(BiomeGenPolarChasm.class, "Polar Chasm", 1); polarChasm = registerNetherBiome(BiomeGenPolarChasm.class, "Polar Chasm", 1);
//End Biomes
spectralGarden = registerEndBiome(BiomeGenSpectralGarden.class, "Spectral Garden", 10);
//River Biomes //River Biomes
lushRiver = registerOverworldRiverBiome(BiomeGenLushRiver.class, "Lush River", lushSwamp, lavenderFields, flowerField, bambooForest, cherryBlossomGrove, lushDesert, meadow, spruceWoods, rainforest, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleEdge, BiomeGenBase.jungleHills); lushRiver = registerOverworldRiverBiome(BiomeGenLushRiver.class, "Lush River", lushSwamp, lavenderFields, flowerField, bambooForest, cherryBlossomGrove, lushDesert, meadow, spruceWoods, rainforest, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleEdge, BiomeGenBase.jungleHills);
dryRiver = registerOverworldRiverBiome(BiomeGenDryRiver.class, "Dry River", outback, steppe, BiomeGenBase.desert, BiomeGenBase.desertHills); dryRiver = registerOverworldRiverBiome(BiomeGenDryRiver.class, "Dry River", outback, steppe, BiomeGenBase.desert, BiomeGenBase.desertHills);
@ -415,6 +420,7 @@ public class BOPBiomes
BiomeDictionary.registerBiomeType(BOPCBiomes.shrubland, Type.PLAINS, Type.SPARSE, Type.DRY); BiomeDictionary.registerBiomeType(BOPCBiomes.shrubland, Type.PLAINS, Type.SPARSE, Type.DRY);
BiomeDictionary.registerBiomeType(BOPCBiomes.silkglades, Type.SWAMP, Type.FOREST, Type.SPOOKY, Type.DEAD); BiomeDictionary.registerBiomeType(BOPCBiomes.silkglades, Type.SWAMP, Type.FOREST, Type.SPOOKY, Type.DEAD);
BiomeDictionary.registerBiomeType(BOPCBiomes.sludgepit, Type.SWAMP, Type.FOREST, Type.WASTELAND, Type.WET, Type.DEAD, Type.SPOOKY); BiomeDictionary.registerBiomeType(BOPCBiomes.sludgepit, Type.SWAMP, Type.FOREST, Type.WASTELAND, Type.WET, Type.DEAD, Type.SPOOKY);
BiomeDictionary.registerBiomeType(BOPCBiomes.spectralGarden, Type.END, Type.FOREST, Type.LUSH, Type.SPOOKY);
BiomeDictionary.registerBiomeType(BOPCBiomes.spruceWoods, Type.FOREST, Type.CONIFEROUS, Type.LUSH, Type.DENSE); BiomeDictionary.registerBiomeType(BOPCBiomes.spruceWoods, Type.FOREST, Type.CONIFEROUS, Type.LUSH, Type.DENSE);
BiomeDictionary.registerBiomeType(BOPCBiomes.steppe, Type.PLAINS, Type.SANDY, Type.DRY, Type.HOT, Type.SAVANNA, Type.SPARSE, Type.DEAD); BiomeDictionary.registerBiomeType(BOPCBiomes.steppe, Type.PLAINS, Type.SANDY, Type.DRY, Type.HOT, Type.SAVANNA, Type.SPARSE, Type.DEAD);
BiomeDictionary.registerBiomeType(BOPCBiomes.temperateRainforest, Type.FOREST, Type.HILLS, Type.WET, Type.CONIFEROUS, Type.LUSH); BiomeDictionary.registerBiomeType(BOPCBiomes.temperateRainforest, Type.FOREST, Type.HILLS, Type.WET, Type.CONIFEROUS, Type.LUSH);
@ -535,6 +541,11 @@ public class BOPBiomes
return BOPBiomeManager.createAndRegisterBiome(biomeClass, "Nether", biomeName, BOPBiomeManager.netherBiomes, weight); return BOPBiomeManager.createAndRegisterBiome(biomeClass, "Nether", biomeName, BOPBiomeManager.netherBiomes, weight);
} }
private static BiomeGenBase registerEndBiome(Class<? extends BiomeGenBase> biomeClass, String biomeName, int weight)
{
return BOPBiomeManager.createAndRegisterBiome(biomeClass, "End", biomeName, BOPBiomeManager.endBiomes, weight);
}
private static void registerOverriddenBiome(Class<? extends BOPOverriddenBiome> biomeClass, String[]...overriddenBiomeNames) private static void registerOverriddenBiome(Class<? extends BOPOverriddenBiome> biomeClass, String[]...overriddenBiomeNames)
{ {
for (String[] overriddenBiomeName : overriddenBiomeNames) for (String[] overriddenBiomeName : overriddenBiomeNames)

View file

@ -19,6 +19,7 @@ public class BOPBiomeManager
public static List<Integer> overworldOceanBiomes = new ArrayList(); public static List<Integer> overworldOceanBiomes = new ArrayList();
public static BiomeGenBase[] overworldRiverBiomes = new BiomeGenBase[BiomeGenBase.getBiomeGenArray().length]; public static BiomeGenBase[] overworldRiverBiomes = new BiomeGenBase[BiomeGenBase.getBiomeGenArray().length];
public static List<BiomeEntry> netherBiomes = new ArrayList(); public static List<BiomeEntry> netherBiomes = new ArrayList();
public static List<BiomeEntry> endBiomes = new ArrayList();
public static BiomeGenBase createAndRegisterBiome(Class<? extends BiomeGenBase> biomeClass, String biomeType, String biomeName, List<BiomeEntry> biomeList, int weight) public static BiomeGenBase createAndRegisterBiome(Class<? extends BiomeGenBase> biomeClass, String biomeType, String biomeName, List<BiomeEntry> biomeList, int weight)
{ {