Added animals to the Promised Lands. Only thing that is left to do is limiting the amount spawned.

This commit is contained in:
Adubbz 2013-05-13 08:22:17 +10:00
parent f922679099
commit af38870e90
6 changed files with 85 additions and 1 deletions

View file

@ -3,6 +3,8 @@ package biomesoplenty.biomes;
import java.awt.Color;
import java.util.Random;
import cpw.mods.fml.common.Loader;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPConfiguration;
@ -13,8 +15,11 @@ import biomesoplenty.worldgen.WorldGenPromisedTree3;
import biomesoplenty.worldgen.WorldGenWaterSpring;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -49,6 +54,19 @@ public class BiomeGenPromisedLandForest extends BiomeGenBase
this.customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
this.theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
this.spawnableMonsterList.add(new SpawnListEntry(EntityCow.class, 6, 1, 4));
if (Loader.isModLoaded("TwilightForest"))
{
try {
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBighorn"), 2, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFDeer"), 4, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBird"), 2, 1, 3));
} catch (ClassNotFoundException e) {
System.out.println("[BiomesOPlenty] There was an error while integrating Twilight Forest with Biomes O' Plenty!");
e.printStackTrace();
}
}
}
/**

View file

@ -3,6 +3,8 @@ package biomesoplenty.biomes;
import java.awt.Color;
import java.util.Random;
import cpw.mods.fml.common.Loader;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPConfiguration;
@ -14,8 +16,10 @@ import biomesoplenty.worldgen.WorldGenPromisedTree3;
import biomesoplenty.worldgen.WorldGenWaterSpring;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraft.world.gen.feature.WorldGenerator;
@ -48,6 +52,18 @@ public class BiomeGenPromisedLandPlains extends BiomeGenBase
this.customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
this.theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
if (Loader.isModLoaded("TwilightForest"))
{
try {
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBird"), 2, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBunny"), 4, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFSquirrel"), 4, 1, 2));
} catch (ClassNotFoundException e) {
System.out.println("[BiomesOPlenty] There was an error while integrating Twilight Forest with Biomes O' Plenty!");
e.printStackTrace();
}
}
}
/**

View file

@ -3,17 +3,23 @@ package biomesoplenty.biomes;
import java.awt.Color;
import java.util.Random;
import cpw.mods.fml.common.Loader;
import biomesoplenty.api.Blocks;
import biomesoplenty.configuration.BOPBlocks;
import biomesoplenty.configuration.BOPConfiguration;
import biomesoplenty.integration.ThaumcraftIntegration;
import biomesoplenty.worldgen.WorldGenPromisedShrub;
import biomesoplenty.worldgen.WorldGenPromisedTree;
import biomesoplenty.worldgen.WorldGenPromisedWillowTree;
import biomesoplenty.worldgen.WorldGenWaterSpring;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenPromisedLandSwamp extends BiomeGenBase
@ -49,6 +55,18 @@ public class BiomeGenPromisedLandSwamp extends BiomeGenBase
this.customBiomeDecorator.generateClouds = true;
//this.customBiomeDecorator.generateLakes = false;
this.theWorldGenerator = new WorldGenWaterSpring(Block.waterMoving.blockID, 8);
this.spawnableMonsterList.add(new SpawnListEntry(EntityPig.class, 4, 1, 4));
if (Loader.isModLoaded("TwilightForest"))
{
try {
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFBird"), 2, 1, 3));
this.spawnableMonsterList.add(new SpawnListEntry(Class.forName("twilightforest.entity.passive.EntityTFRaven"), 1, 1, 2));
} catch (ClassNotFoundException e) {
System.out.println("[BiomesOPlenty] There was an error while integrating Twilight Forest with Biomes O' Plenty!");
e.printStackTrace();
}
}
}
/**

View file

@ -6,10 +6,13 @@ import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import net.minecraft.block.BlockStep;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Icon;
@ -56,7 +59,7 @@ public class BlockBOPGrass extends Block
{
return blockIcon[meta][side];
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void getSubBlocks(int blockID, CreativeTabs creativeTabs, List list) {

View file

@ -1,5 +1,6 @@
package biomesoplenty.helpers;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLiving;
@ -7,8 +8,18 @@ import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.Event.HasResult;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.LivingPackSizeEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.mobs.ai.EntityAITemptArmour;
@ -34,4 +45,16 @@ public class EntitiesHelper
if (entity instanceof EntityCow)
((EntityLiving)entity).tasks.addTask(3, new EntityAITemptArmour((EntityCreature) entity, 0.25F, Items.flowerBand.get().itemID, 3, false));
}
@ForgeSubscribe
public void canEntitySpawn(LivingSpawnEvent event)
{
int i = MathHelper.floor_double(event.entity.posX);
int j = MathHelper.floor_double(event.entity.boundingBox.minY);
int k = MathHelper.floor_double(event.entity.posZ);
if (event.entity.worldObj.getBlockId(i, j - 1, k) == Blocks.holyGrass.get().blockID && event.entity.worldObj.getFullBlockLightValue(i, j, k) > 8)
event.setResult(Result.ALLOW);
}
}

View file

@ -137,6 +137,12 @@ public class WorldProviderPromised extends WorldProvider
var6 *= var3 * 0.91F + 0.09F;
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6);
}
@Override
public void setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)
{
allowPeaceful = true;
}
@Override
public String getWelcomeMessage()