diff --git a/src/main/java/biomesoplenty/api/content/BOPCBiomes.java b/src/main/java/biomesoplenty/api/content/BOPCBiomes.java index ba7ec9ac4..05c59b847 100644 --- a/src/main/java/biomesoplenty/api/content/BOPCBiomes.java +++ b/src/main/java/biomesoplenty/api/content/BOPCBiomes.java @@ -87,6 +87,9 @@ public class BOPCBiomes public static BiomeGenBase visceralHeap; public static BiomeGenBase polarChasm; + //End Biomes + public static BiomeGenBase spectralGarden; + //River Biomes public static BiomeGenBase lushRiver; public static BiomeGenBase dryRiver; diff --git a/src/main/java/biomesoplenty/common/biome/BOPEndBiome.java b/src/main/java/biomesoplenty/common/biome/BOPEndBiome.java new file mode 100644 index 000000000..78eade38e --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/BOPEndBiome.java @@ -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 +{ + 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; + } +} diff --git a/src/main/java/biomesoplenty/common/biome/decoration/BOPEndBiomeDecorator.java b/src/main/java/biomesoplenty/common/biome/decoration/BOPEndBiomeDecorator.java new file mode 100644 index 000000000..32fda1310 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/decoration/BOPEndBiomeDecorator.java @@ -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 +{ + 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)); + } +} diff --git a/src/main/java/biomesoplenty/common/biome/decoration/EndBiomeFeatures.java b/src/main/java/biomesoplenty/common/biome/decoration/EndBiomeFeatures.java new file mode 100644 index 000000000..5184f9a56 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/decoration/EndBiomeFeatures.java @@ -0,0 +1,8 @@ +package biomesoplenty.common.biome.decoration; + +import biomesoplenty.api.biome.BiomeFeatures; + +public class EndBiomeFeatures extends BiomeFeaturesBase +{ + +} diff --git a/src/main/java/biomesoplenty/common/biome/end/BiomeGenSpectralGarden.java b/src/main/java/biomesoplenty/common/biome/end/BiomeGenSpectralGarden.java new file mode 100644 index 000000000..9b7d51fb4 --- /dev/null +++ b/src/main/java/biomesoplenty/common/biome/end/BiomeGenSpectralGarden.java @@ -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); + } +} diff --git a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java index c02d706b6..393184dc5 100644 --- a/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java +++ b/src/main/java/biomesoplenty/common/blocks/BlockBOPGeneric.java @@ -163,7 +163,7 @@ public class BlockBOPGeneric extends Block { 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, 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) && diff --git a/src/main/java/biomesoplenty/common/core/BOPBiomes.java b/src/main/java/biomesoplenty/common/core/BOPBiomes.java index e30f3600c..b62943686 100644 --- a/src/main/java/biomesoplenty/common/core/BOPBiomes.java +++ b/src/main/java/biomesoplenty/common/core/BOPBiomes.java @@ -64,6 +64,7 @@ import static biomesoplenty.api.content.BOPCBiomes.shrubland; import static biomesoplenty.api.content.BOPCBiomes.silkglades; import static biomesoplenty.api.content.BOPCBiomes.sludgepit; 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.steppe; import static biomesoplenty.api.content.BOPCBiomes.temperateRainforest; @@ -94,6 +95,7 @@ import org.apache.logging.log4j.Level; import biomesoplenty.api.BOPObfuscationHelper; import biomesoplenty.api.biome.BOPOverriddenBiome; import biomesoplenty.api.content.BOPCBiomes; +import biomesoplenty.common.biome.end.BiomeGenSpectralGarden; import biomesoplenty.common.biome.nether.BiomeGenBoneyard; import biomesoplenty.common.biome.nether.BiomeGenCorruptedSands; import biomesoplenty.common.biome.nether.BiomeGenPhantasmagoricInferno; @@ -314,6 +316,9 @@ public class BOPBiomes undergarden = registerNetherBiome(BiomeGenUndergarden.class, "Undergarden", 10); polarChasm = registerNetherBiome(BiomeGenPolarChasm.class, "Polar Chasm", 1); + //End Biomes + spectralGarden = registerEndBiome(BiomeGenSpectralGarden.class, "Spectral Garden", 10); + //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); 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.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.spectralGarden, Type.END, Type.FOREST, Type.LUSH, Type.SPOOKY); 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.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); } + private static BiomeGenBase registerEndBiome(Class biomeClass, String biomeName, int weight) + { + return BOPBiomeManager.createAndRegisterBiome(biomeClass, "End", biomeName, BOPBiomeManager.endBiomes, weight); + } + private static void registerOverriddenBiome(Class biomeClass, String[]...overriddenBiomeNames) { for (String[] overriddenBiomeName : overriddenBiomeNames) diff --git a/src/main/java/biomesoplenty/common/world/BOPBiomeManager.java b/src/main/java/biomesoplenty/common/world/BOPBiomeManager.java index 5eb353587..03565577c 100644 --- a/src/main/java/biomesoplenty/common/world/BOPBiomeManager.java +++ b/src/main/java/biomesoplenty/common/world/BOPBiomeManager.java @@ -19,6 +19,7 @@ public class BOPBiomeManager public static List overworldOceanBiomes = new ArrayList(); public static BiomeGenBase[] overworldRiverBiomes = new BiomeGenBase[BiomeGenBase.getBiomeGenArray().length]; public static List netherBiomes = new ArrayList(); + public static List endBiomes = new ArrayList(); public static BiomeGenBase createAndRegisterBiome(Class biomeClass, String biomeType, String biomeName, List biomeList, int weight) {