Java Code Examples for net.minecraft.entity.passive.EntityChicken

The following are top voted examples for showing how to use net.minecraft.entity.passive.EntityChicken. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: DecompiledMinecraft   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 2
Project: DecompiledMinecraft   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 3
Project: BaseClient   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 4
Project: BaseClient   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 5
Project: connor41-etfuturum2   File: ServerEventHandler.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void spawnEvent(EntityJoinWorldEvent event) {
	if (event.entity instanceof EntityPig) {
		EntityPig pig = (EntityPig) event.entity;
		if (EtFuturum.enableBeetroot)
			pig.tasks.addTask(4, new EntityAITempt(pig, 1.2, ModItems.beetroot, false));
	} else if (event.entity instanceof EntityChicken) {
		EntityChicken chicken = (EntityChicken) event.entity;
		if (EtFuturum.enableBeetroot)
			chicken.tasks.addTask(3, new EntityAITempt(chicken, 1.0D, ModItems.beetroot_seeds, false));
	} else if (event.entity instanceof EntityWolf) {
		EntityWolf wolf = (EntityWolf) event.entity;
		if (EtFuturum.enableRabbit)
			wolf.targetTasks.addTask(4, new EntityAITargetNonTamed(wolf, EntityRabbit.class, 200, false));
	} else if (event.entity instanceof EntityVillager) {
		EntityVillager villager = (EntityVillager) event.entity;
		for (Object obj : villager.tasks.taskEntries) {
			EntityAITaskEntry entry = (EntityAITaskEntry) obj;
			if (entry.action instanceof EntityAIOpenDoor) {
				villager.tasks.removeTask(entry.action);
				villager.tasks.addTask(entry.priority, new EntityAIOpenCustomDoor(villager, true));
				break;
			}
		}
	}
}
 
Example 6
Project: connor41-etfuturum2   File: ServerEventHandler.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void interactEntityEvent(EntityInteractEvent event) {
	ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
	if (stack == null)
		return;
	if (!(event.target instanceof EntityAnimal))
		return;

	EntityAnimal animal = (EntityAnimal) event.target;
	if (!animal.isChild()) {
		if (animal instanceof EntityPig) {
			if (stack.getItem() == ModItems.beetroot && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
		} else if (animal instanceof EntityChicken)
			if (stack.getItem() == ModItems.beetroot_seeds && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
	} else if (EtFuturum.enableBabyGrowthBoost && isFoodItem(animal, stack))
		feedBaby(animal, event.entityPlayer, stack);
}
 
Example 7
Project: modName   File: BiomeTropicalShrubland.java   Source Code and License 6 votes vote down vote up
public BiomeTropicalShrubland() {
    super(new Biome.BiomeProperties("Tropical Shrubland")
            .setBaseHeight(0.105f)
            .setHeightVariation(0.15f)
            .setTemperature(1.1f)
            .setRainfall(0.45f)
    );

    this.setRegistryName(Ref.MODID+":tropical_shrubland");
    this.decorator.treesPerChunk = 5;
    this.decorator.grassPerChunk = 10;
    this.decorator.flowersPerChunk = 4;

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 5, 4, 4));
    Ref.BIOMES.add(this);
}
 
Example 8
Project: uniquecrops   File: UCEventHandlerServer.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void maximumOvercluck(LivingEvent.LivingUpdateEvent event) {
	
	if (!event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityChicken) {
		EntityChicken chicken = (EntityChicken)event.getEntityLiving();
		NBTTagCompound tag = chicken.getEntityData();
		if (!chicken.isChild() && tag.hasKey(ItemGeneric.TAG_OVERCLUCK)) {
			int timer = tag.getInteger(ItemGeneric.TAG_OVERCLUCK);
			tag.setInteger(ItemGeneric.TAG_OVERCLUCK, --timer);
			if (--timer <= 0)
			{
	            chicken.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (chicken.worldObj.rand.nextFloat() - chicken.worldObj.rand.nextFloat()) * 0.2F + 1.0F);
	            chicken.dropItem(Items.EGG, 1);
	            timer = chicken.worldObj.rand.nextInt(60) + 900;
	            tag.setInteger(ItemGeneric.TAG_OVERCLUCK, timer);
			}
		}
	}
}
 
Example 9
Project: Backmemed   File: BiomeJungle.java   Source Code and License 6 votes vote down vote up
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 10
Project: CustomWorldGen   File: BiomeJungle.java   Source Code and License 6 votes vote down vote up
public BiomeJungle(boolean isEdgeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.isEdge = isEdgeIn;

    if (isEdgeIn)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!isEdgeIn)
    {
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 11
Project: Gravestone-mod-Extended   File: EntityZombieCat.java   Source Code and License 6 votes vote down vote up
public EntityZombieCat(World world, boolean isHusk) {
    super(world);

    this.setMobType(isHusk ? EnumUndeadMobType.HUSK : EnumUndeadMobType.ZOMBIE);

    ((PathNavigateGround) this.getNavigator()).setCanSwim(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1, false));
    this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1));
    this.tasks.addTask(6, new EntityAIWander(this, 1));
    this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1, false));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
    if (ExtendedConfig.zombiePetsAttackPets) {
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityWolf.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityOcelot.class, false));
    }
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityChicken.class, false));
    }

    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
}
 
Example 12
Project: MC-Prefab   File: StructureChickenCoop.java   Source Code and License 6 votes vote down vote up
/**
 * This method is used after the main building is build for any additional
 * structures or modifications.
 * 
 * @param configuration The structure configuration.
 * @param world The current world.
 * @param originalPos The original position clicked on.
 * @param assumedNorth The assumed northern direction.
 * @param player The player which initiated the construction.
 */
@Override
public void AfterBuilding(StructureConfiguration configuration, World world, BlockPos originalPos, EnumFacing assumedNorth, EntityPlayer player)
{
	if (this.chickenCoopBlockPos != null)
	{
		// For the chicken coop, spawn 1 chicken above a hay bale.
		for (int i = 0; i < 1; i++)
		{
			EntityChicken entity = new EntityChicken(world);
			entity.setPosition(this.chickenCoopBlockPos.getX(), this.chickenCoopBlockPos.getY(), this.chickenCoopBlockPos.getZ());
			world.spawnEntity(entity);
		}
		
		this.chickenCoopBlockPos = null;
	}
}
 
Example 13
Project: PopularMMOS-EpicProportions-Mod   File: EntityKitty.java   Source Code and License 6 votes vote down vote up
public EntityKitty(World p_i1688_1_)
{
    super(p_i1688_1_);
    this.setSize(0.6F, 0.8F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
    //this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
    this.tasks.addTask(6, new EntityAIKittySit(this, 1.33D));
    this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
    this.tasks.addTask(8, new EntityAIOcelotAttack(this));
    this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
    this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
    this.hasCustomNameTag();
    this.setCustomNameTag("Kitty");
}
 
Example 14
Project: ThermalRecycling   File: Material.java   Source Code and License 6 votes vote down vote up
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase target) {

	if (target.worldObj.isRemote || ItemStackHelper.getItemDamage(stack) != WORMS)
		return false;

	if (target instanceof EntityChicken) {

		// If the chicken is a child, make it an adult. If it is
		// an adult, accelerate egg laying.
		final EntityChicken chicken = (EntityChicken) target;
		if (chicken.isChild()) {
			chicken.setGrowingAge(-1);
		} else {
			chicken.timeUntilNextEgg -= random.nextInt(EGG_ACCELERATION) + EGG_ACCELERATION;
		}

		stack.stackSize--;

		return true;
	}

	return false;
}
 
Example 15
Project: Et-Futurum   File: ServerEventHandler.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void spawnEvent(EntityJoinWorldEvent event) {
	if (event.entity instanceof EntityPig) {
		EntityPig pig = (EntityPig) event.entity;
		if (EtFuturum.enableBeetroot)
			pig.tasks.addTask(4, new EntityAITempt(pig, 1.2, ModItems.beetroot, false));
	} else if (event.entity instanceof EntityChicken) {
		EntityChicken chicken = (EntityChicken) event.entity;
		if (EtFuturum.enableBeetroot)
			chicken.tasks.addTask(3, new EntityAITempt(chicken, 1.0D, ModItems.beetroot_seeds, false));
	} else if (event.entity instanceof EntityWolf) {
		EntityWolf wolf = (EntityWolf) event.entity;
		if (EtFuturum.enableRabbit)
			wolf.targetTasks.addTask(4, new EntityAITargetNonTamed(wolf, EntityRabbit.class, 200, false));
	} else if (event.entity instanceof EntityVillager) {
		EntityVillager villager = (EntityVillager) event.entity;
		for (Object obj : villager.tasks.taskEntries) {
			EntityAITaskEntry entry = (EntityAITaskEntry) obj;
			if (entry.action instanceof EntityAIOpenDoor) {
				villager.tasks.removeTask(entry.action);
				villager.tasks.addTask(entry.priority, new EntityAIOpenCustomDoor(villager, true));
				break;
			}
		}
	}
}
 
Example 16
Project: Et-Futurum   File: ServerEventHandler.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public void interactEntityEvent(EntityInteractEvent event) {
	ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
	if (stack == null)
		return;
	if (!(event.target instanceof EntityAnimal))
		return;

	EntityAnimal animal = (EntityAnimal) event.target;
	if (!animal.isChild()) {
		if (animal instanceof EntityPig) {
			if (stack.getItem() == ModItems.beetroot && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
		} else if (animal instanceof EntityChicken)
			if (stack.getItem() == ModItems.beetroot_seeds && EtFuturum.enableBeetroot)
				setAnimalInLove(animal, event.entityPlayer, stack);
	} else if (EtFuturum.enableBabyGrowthBoost && isFoodItem(animal, stack))
		feedBaby(animal, event.entityPlayer, stack);
}
 
Example 17
Project: It-s-About-Time-Minecraft-Mod   File: EntityVelociraptor.java   Source Code and License 6 votes vote down vote up
public EntityVelociraptor(World world)
  {
      super(world);
      this.setSize(1F, 0.6F);
      isCarnivore = true;
      minSize = 0.2F;
maxSize = 1.4F;
adultAge = 10;
maxAge = 16;
      this.tasks.addTask(8, new EntityAITempt(this, 1.2D, Items.chicken, false));
      this.tasks.addTask(10, new MobAIWatchClosestWhenAwake(this, EntityPlayer.class, 8.0F));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityChicken.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCow.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntitySheep.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityCompsognathus.class, 200, false));
      this.targetTasks.addTask(4, new EntityAITargetNonTamed(this, EntityPig.class, 200, false));

      this.setTamed(false);
  }
 
Example 18
Project: Resilience-Client-Source   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 19
Project: CreepTech   File: TileEntityIncubator.java   Source Code and License 6 votes vote down vote up
@Override
public void updateEntity(){
    if(PowerStored > 0 && slot != null && slot.getItem().equals(Items.egg)) {
        Tick++;
        if(Tick % 10 == 0){
            PowerStored--;
        }
    }
    System.out.println("Tick: " + Integer.toString(Tick));
    System.out.println("ChickTick: " + Integer.toString(ChickenTick));
    if(slot != null && slot.getItem().equals(Items.egg) && Tick == ChickenTick + 48000){
        ChickenTick = 0;
        EntityChicken entityChicken = new EntityChicken(this.worldObj);
        entityChicken.setLocationAndAngles(pos.getX() + .5, pos.getY() + 1, pos.getZ() + .5, 0.0F, 0.0F);
        entityChicken.setGrowingAge(-24000);
        this.worldObj.spawnEntityInWorld(entityChicken);
    }
}
 
Example 20
Project: Magicians-Artifice   File: RitualFlight.java   Source Code and License 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public void uncontainedEffect(int x, int y, int z, World world, EntityPlayer player) {
    super.uncontainedEffect(x, y, z, world, player);
    Vec3 cornerstone = Vec3.createVectorHelper(x,y,z);
    List<Entity> playerMPs = world.loadedEntityList;
    for (int i = 0; i < playerMPs.size();i++) {
        Entity entity = playerMPs.get(i);
        if (entity instanceof EntityLivingBase) {
            if (!(entity instanceof EntityPlayer) && !(entity instanceof EntityBat) && !(entity instanceof EntityChicken)) {
                 Vec3 location = Vec3.createVectorHelper(entity.posX,entity.posY,entity.posZ);
                if (location.distanceTo(cornerstone) < 100) {
                    entity.motionY += 3.0F;
                }
            }
        }
    }
}
 
Example 21
Project: ZeroQuest   File: BiomeGenRedSeed.java   Source Code and License 6 votes vote down vote up
public BiomeGenRedSeed(int id) {
    super(id);
   	this.waterColorMultiplier = 0x003333;
    this.theBiomeDecorator.treesPerChunk = -999;
    this.theBiomeDecorator.flowersPerChunk = 4;
    this.theBiomeDecorator.grassPerChunk = 10;
    this.flowers.clear();
    this.addFlower(Blocks.red_flower,    4,  3);
    this.addFlower(Blocks.red_flower,    5,  3);
    this.addFlower(Blocks.red_flower,    6,  3);
    this.addFlower(Blocks.red_flower,    7,  3);
    this.addFlower(ModBlocks.nileBlackFlower,    0, 20);
    this.addFlower(ModBlocks.nileBlackFlower,    3, 20);
    this.addFlower(ModBlocks.nileBlackFlower,    8, 20);
    this.addFlower(ModBlocks.nileBlackFlower, 0, 30);
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRedZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
}
 
Example 22
Project: ZeroQuest   File: BiomeGenBioZone.java   Source Code and License 6 votes vote down vote up
public BiomeGenBioZone(int id) {
    super(id);
    this.theBiomeDecorator.generateLakes = true;
    this.theBiomeDecorator.treesPerChunk = 4;
    this.spawnableMonsterList.clear();
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
}
 
Example 23
Project: ZeroQuest   File: BiomeGenBlueNile.java   Source Code and License 6 votes vote down vote up
public BiomeGenBlueNile(int id) {
    super(id);
    //topBlock = (byte)ModBlocks.nileGrass.blockID;
    //fillerBlock = (byte)ModBlocks.nileDirt.blockID;
   	this.waterColorMultiplier = 0x003333;
   	this.theBiomeDecorator.treesPerChunk = 9;
   	this.theBiomeDecorator.grassPerChunk = 3;
   	this.theBiomeDecorator.flowersPerChunk = 2;
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.add(new SpawnListEntry(EntityZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityBat.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 5, 1, 5)); 
}
 
Example 24
Project: ZeroQuest   File: BiomeGenDarkLand.java   Source Code and License 6 votes vote down vote up
public BiomeGenDarkLand(int id) {
    super(id);
    //topBlock = (byte)ModBlocks.nileGrass.blockID;
    //fillerBlock = (byte)ModBlocks.nileDirt.blockID;
   	this.waterColorMultiplier = 0x666600;
   	this.theBiomeDecorator.treesPerChunk = 1;
   	this.theBiomeDecorator.grassPerChunk = 1;
   	this.theBiomeDecorator.flowersPerChunk = -999;
    this.theBiomeDecorator.generateLakes = true;
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.add(new SpawnListEntry(EntityDarkZertum.class, 100, 4, 4));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityBat.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 5, 1, 5)); 
}
 
Example 25
Project: ZeroQuest   File: BiomeGenRedSeed.java   Source Code and License 6 votes vote down vote up
public BiomeGenRedSeed(int id) {
    super(id);
   	this.waterColorMultiplier = 0x003333;
    this.theBiomeDecorator.treesPerChunk = -999;
    this.theBiomeDecorator.flowersPerChunk = 4;
    this.theBiomeDecorator.grassPerChunk = 10;
    this.flowers.clear();
    this.addFlower(Blocks.red_flower.getDefaultState(), 4);
    this.addFlower(ModBlocks.nileBlackFlower.getDefaultState(), 90);
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityHorse.class, 5, 2, 6));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
}
 
Example 26
Project: ZeroQuest   File: BiomeGenBioZone.java   Source Code and License 6 votes vote down vote up
public BiomeGenBioZone(int id) {
    super(id);
    this.theBiomeDecorator.generateLakes = true;
    this.theBiomeDecorator.treesPerChunk = 4;
    this.spawnableMonsterList.clear();
    this.addFlower(ModBlocks.nileBlueFlower.getDefaultState(), 90);
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 5, 1, 5));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 5, 1, 5)); 
}
 
Example 27
Project: reptiles   File: EntityMegalania.java   Source Code and License 6 votes vote down vote up
public EntityMegalania(World world) {
    super(world);
    float scaleFactor = 2.5f;
    setSize(1.0F * scaleFactor, 0.6F * scaleFactor);
    setPathPriority(PathNodeType.WATER, 0.0f);
    setHealth(60.0f);

    tasks.addTask(0, new EntityAISwimming(this));
    tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
    tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, true));
    tasks.addTask(3, new EntityAIWander(this, 0.9));
    tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    tasks.addTask(5, new EntityAILookIdle(this));

    targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
    targetTasks.addTask(2, new EntityAINearestAttackableTarget<>(this, EntityChicken.class, true));
    targetTasks.addTask(3, new EntityAINearestAttackableTarget<>(this, EntityPig.class, true));
    targetTasks.addTask(4, new EntityAINearestAttackableTarget<>(this, EntityPlayer.class, true));
    targetTasks.addTask(5, new EntityAINearestAttackableTarget<>(this, EntitySheep.class, true));
    targetTasks.addTask(6, new EntityAINearestAttackableTarget<>(this, EntityCow.class, true));
    targetTasks.addTask(7, new EntityAINearestAttackableTarget<>(this, EntitySkeleton.class, true));
    targetTasks.addTask(8, new EntityAINearestAttackableTarget<>(this, EntityRabbit.class, true));
}
 
Example 28
Project: NausicaaMod   File: EntityFoxSquirrel.java   Source Code and License 6 votes vote down vote up
public EntityFoxSquirrel(World par1World)
{
    super(par1World);
    this.setSize(0.6F, 0.8F);
    this.getNavigator().setAvoidsWater(true);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, this.aiSit);
    this.tasks.addTask(3, this.aiTempt = new EntityAITempt(this, 0.6D, Items.fish, true));
    this.tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
    this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
    this.tasks.addTask(6, new EntityAIOcelotSit(this, 1.33D));
    this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
    this.tasks.addTask(8, new EntityAIOcelotAttack(this));
    this.tasks.addTask(9, new EntityAIMate(this, 0.8D));
    this.tasks.addTask(10, new EntityAIWander(this, 0.8D));
    this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    this.targetTasks.addTask(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
}
 
Example 29
Project: Cauldron   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 30
Project: Cauldron   File: BiomeGenJungle.java   Source Code and License 6 votes vote down vote up
public BiomeGenJungle(int p_i45379_1_, boolean p_i45379_2_)
{
    super(p_i45379_1_);
    this.field_150614_aC = p_i45379_2_;

    if (p_i45379_2_)
    {
        this.theBiomeDecorator.treesPerChunk = 2;
    }
    else
    {
        this.theBiomeDecorator.treesPerChunk = 50;
    }

    this.theBiomeDecorator.grassPerChunk = 25;
    this.theBiomeDecorator.flowersPerChunk = 4;

    if (!p_i45379_2_)
    {
        this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityOcelot.class, 2, 1, 1));
    }

    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
}
 
Example 31
Project: RuneCraftery   File: EntityOcelot.java   Source Code and License 6 votes vote down vote up
public EntityOcelot(World p_i1688_1_) {
   super(p_i1688_1_);
   this.func_70105_a(0.6F, 0.8F);
   this.func_70661_as().func_75491_a(true);
   this.field_70714_bg.func_75776_a(1, new EntityAISwimming(this));
   this.field_70714_bg.func_75776_a(2, this.field_70911_d);
   this.field_70714_bg.func_75776_a(3, this.field_70914_e = new EntityAITempt(this, 0.6D, Item.field_77754_aU.field_77779_bT, true));
   this.field_70714_bg.func_75776_a(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
   this.field_70714_bg.func_75776_a(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 5.0F));
   this.field_70714_bg.func_75776_a(6, new EntityAIOcelotSit(this, 1.33D));
   this.field_70714_bg.func_75776_a(7, new EntityAILeapAtTarget(this, 0.3F));
   this.field_70714_bg.func_75776_a(8, new EntityAIOcelotAttack(this));
   this.field_70714_bg.func_75776_a(9, new EntityAIMate(this, 0.8D));
   this.field_70714_bg.func_75776_a(10, new EntityAIWander(this, 0.8D));
   this.field_70714_bg.func_75776_a(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
   this.field_70715_bh.func_75776_a(1, new EntityAITargetNonTamed(this, EntityChicken.class, 750, false));
}
 
Example 32
Project: DecompiledMinecraft   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 33
Project: DecompiledMinecraft   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition p_70184_1_)
{
    if (p_70184_1_.entityHit != null)
    {
        p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
    {
        int i = 1;

        if (this.rand.nextInt(32) == 0)
        {
            i = 4;
        }

        for (int j = 0; j < i; ++j)
        {
            EntityChicken entitychicken = new EntityChicken(this.worldObj);
            entitychicken.setGrowingAge(-24000);
            entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            this.worldObj.spawnEntityInWorld(entitychicken);
        }
    }

    double d0 = 0.08D;

    for (int k = 0; k < 8; ++k)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.egg)});
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
Example 34
Project: DecompiledMinecraft   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 35
Project: DecompiledMinecraft   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition p_70184_1_)
{
    if (p_70184_1_.entityHit != null)
    {
        p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
    {
        int i = 1;

        if (this.rand.nextInt(32) == 0)
        {
            i = 4;
        }

        for (int j = 0; j < i; ++j)
        {
            EntityChicken entitychicken = new EntityChicken(this.worldObj);
            entitychicken.setGrowingAge(-24000);
            entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            this.worldObj.spawnEntityInWorld(entitychicken);
        }
    }

    double d0 = 0.08D;

    for (int k = 0; k < 8; ++k)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.egg)});
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
Example 36
Project: DecompiledMinecraft   File: RenderChicken.java   Source Code and License 5 votes vote down vote up
/**
 * Defines what float the third param in setRotationAngles of ModelBase is
 */
protected float handleRotationFloat(EntityChicken livingBase, float partialTicks)
{
    float f = livingBase.field_70888_h + (livingBase.wingRotation - livingBase.field_70888_h) * partialTicks;
    float f1 = livingBase.field_70884_g + (livingBase.destPos - livingBase.field_70884_g) * partialTicks;
    return (MathHelper.sin(f) + 1.0F) * f1;
}
 
Example 37
Project: BaseClient   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 38
Project: BaseClient   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition p_70184_1_)
{
    if (p_70184_1_.entityHit != null)
    {
        p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
    {
        int i = 1;

        if (this.rand.nextInt(32) == 0)
        {
            i = 4;
        }

        for (int j = 0; j < i; ++j)
        {
            EntityChicken entitychicken = new EntityChicken(this.worldObj);
            entitychicken.setGrowingAge(-24000);
            entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            this.worldObj.spawnEntityInWorld(entitychicken);
        }
    }

    double d0 = 0.08D;

    for (int k = 0; k < 8; ++k)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.egg)});
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
Example 39
Project: BaseClient   File: RenderChicken.java   Source Code and License 5 votes vote down vote up
/**
 * Defines what float the third param in setRotationAngles of ModelBase is
 */
protected float handleRotationFloat(EntityChicken livingBase, float partialTicks)
{
    float f = livingBase.field_70888_h + (livingBase.wingRotation - livingBase.field_70888_h) * partialTicks;
    float f1 = livingBase.field_70884_g + (livingBase.destPos - livingBase.field_70884_g) * partialTicks;
    return (MathHelper.sin(f) + 1.0F) * f1;
}
 
Example 40
Project: BaseClient   File: BiomeGenBase.java   Source Code and License 5 votes vote down vote up
protected BiomeGenBase(int id)
{
    this.minHeight = height_Default.rootHeight;
    this.maxHeight = height_Default.variation;
    this.temperature = 0.5F;
    this.rainfall = 0.5F;
    this.waterColorMultiplier = 16777215;
    this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
    this.enableRain = true;
    this.worldGeneratorTrees = new WorldGenTrees(false);
    this.worldGeneratorBigTree = new WorldGenBigTree(false);
    this.worldGeneratorSwamp = new WorldGenSwamp();
    this.biomeID = id;
    biomeList[id] = this;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 41
Project: BaseClient   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition p_70184_1_)
{
    if (p_70184_1_.entityHit != null)
    {
        p_70184_1_.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
    {
        int i = 1;

        if (this.rand.nextInt(32) == 0)
        {
            i = 4;
        }

        for (int j = 0; j < i; ++j)
        {
            EntityChicken entitychicken = new EntityChicken(this.worldObj);
            entitychicken.setGrowingAge(-24000);
            entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            this.worldObj.spawnEntityInWorld(entitychicken);
        }
    }

    double d0 = 0.08D;

    for (int k = 0; k < 8; ++k)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.egg)});
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
Example 42
Project: BaseClient   File: RenderChicken.java   Source Code and License 5 votes vote down vote up
/**
 * Defines what float the third param in setRotationAngles of ModelBase is
 */
protected float handleRotationFloat(EntityChicken livingBase, float partialTicks)
{
    float f = livingBase.field_70888_h + (livingBase.wingRotation - livingBase.field_70888_h) * partialTicks;
    float f1 = livingBase.field_70884_g + (livingBase.destPos - livingBase.field_70884_g) * partialTicks;
    return (MathHelper.sin(f) + 1.0F) * f1;
}
 
Example 43
Project: connor41-etfuturum2   File: ServerEventHandler.java   Source Code and License 5 votes vote down vote up
private boolean isFoodItem(EntityAnimal animal, ItemStack food) {
	if (animal.isBreedingItem(food))
		return true;
	else if (animal instanceof EntityPig && food.getItem() == ModItems.beetroot && EtFuturum.enableBeetroot)
		return true;
	else if (animal instanceof EntityChicken && food.getItem() == ModItems.beetroot_seeds && EtFuturum.enableBeetroot)
		return true;
	else
		return false;
}
 
Example 44
Project: uniquecrops   File: ItemGeneric.java   Source Code and License 5 votes vote down vote up
@Override
public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase elb, EnumHand hand) {
	
	if (stack.getItemDamage() == 19 && elb instanceof EntityChicken) {
		NBTTagCompound tag = elb.getEntityData();
		if (!elb.isChild() && !tag.hasKey(TAG_OVERCLUCK))
		{
			tag.setInteger(TAG_OVERCLUCK, elb.worldObj.rand.nextInt(60) + 900);
			if (!player.capabilities.isCreativeMode)
				stack.stackSize--;
			return true;
		}
	}
	return super.itemInteractionForEntity(stack, player, elb, hand);
}
 
Example 45
Project: uniquecrops   File: GrowthSteps.java   Source Code and License 5 votes vote down vote up
@Override
public boolean canAdvance(World world, BlockPos pos, IBlockState state) {
	
	Entity item = null, chicken = null;
	List<Entity> entities = world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.add(-3, 0, -3), pos.add(3, 1, 3)));
	for (Entity ent : entities) {
		if (!ent.isDead) {
			if (ent instanceof EntityChicken)
				chicken = ent;
			if (ent instanceof EntityItem && ((EntityItem)ent).getEntityItem().getItem() == Items.BOWL)
				item = ent;
			if (item != null && chicken != null)
				break;
		}
	}
	if (chicken != null && item != null) {
		AxisAlignedBB aabb = new AxisAlignedBB(chicken.getPosition().add(0, 0, 0), chicken.getPosition().add(1, 1, 1));
		List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(chicken, aabb);
		for (Entity entity : list) {
			if (entity != null && entity == item) {
				EntityItem ei = new EntityItem(item.worldObj, item.posX, item.posY, item.posZ, new ItemStack(UCItems.teriyaki));
				((EntityItem)item).getEntityItem().stackSize--;
				if (((EntityItem)item).getEntityItem().stackSize <= 0)
					item.setDead();
				chicken.setDead();
				UCPacketHandler.sendToNearbyPlayers(world, pos, new PacketUCEffect(EnumParticleTypes.EXPLOSION_NORMAL, chicken.posX, chicken.posY + 0.5D, chicken.posZ, 3));
				if (!world.isRemote)
					world.spawnEntityInWorld(ei);
				return true;
			}
		}
	}
	else if (chicken != null) {
		UCPacketHandler.sendToNearbyPlayers(world, pos, new PacketUCEffect(EnumParticleTypes.HEART, chicken.posX, chicken.posY + 1D, chicken.posZ, 3));
		return true;
	}
	return false;
}
 
Example 46
Project: Backmemed   File: Biome.java   Source Code and License 5 votes vote down vote up
protected Biome(Biome.BiomeProperties properties)
{
    this.biomeName = properties.biomeName;
    this.baseHeight = properties.baseHeight;
    this.heightVariation = properties.heightVariation;
    this.temperature = properties.temperature;
    this.rainfall = properties.rainfall;
    this.waterColor = properties.waterColor;
    this.enableSnow = properties.enableSnow;
    this.enableRain = properties.enableRain;
    this.baseBiomeRegName = properties.baseBiomeRegName;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 95, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombieVillager.class, 5, 1, 1));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new Biome.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new Biome.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
 
Example 47
Project: Backmemed   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (result.entityHit != null)
    {
        result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.world.isRemote)
    {
        if (this.rand.nextInt(8) == 0)
        {
            int i = 1;

            if (this.rand.nextInt(32) == 0)
            {
                i = 4;
            }

            for (int j = 0; j < i; ++j)
            {
                EntityChicken entitychicken = new EntityChicken(this.world);
                entitychicken.setGrowingAge(-24000);
                entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
                this.world.spawnEntityInWorld(entitychicken);
            }
        }

        this.world.setEntityState(this, (byte)3);
        this.setDead();
    }
}
 
Example 48
Project: Backmemed   File: RenderChicken.java   Source Code and License 5 votes vote down vote up
/**
 * Defines what float the third param in setRotationAngles of ModelBase is
 */
protected float handleRotationFloat(EntityChicken livingBase, float partialTicks)
{
    float f = livingBase.oFlap + (livingBase.wingRotation - livingBase.oFlap) * partialTicks;
    float f1 = livingBase.oFlapSpeed + (livingBase.destPos - livingBase.oFlapSpeed) * partialTicks;
    return (MathHelper.sin(f) + 1.0F) * f1;
}
 
Example 49
Project: CustomWorldGen   File: Biome.java   Source Code and License 5 votes vote down vote up
public Biome(Biome.BiomeProperties properties)
{
    this.biomeName = properties.biomeName;
    this.baseHeight = properties.baseHeight;
    this.heightVariation = properties.heightVariation;
    this.temperature = properties.temperature;
    this.rainfall = properties.rainfall;
    this.waterColor = properties.waterColor;
    this.enableSnow = properties.enableSnow;
    this.enableRain = properties.enableRain;
    this.baseBiomeRegName = properties.baseBiomeRegName;
    this.theBiomeDecorator = this.createBiomeDecorator();
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 10, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 8, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySpider.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 100, 4, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
    this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityWitch.class, 5, 1, 1));
    this.spawnableWaterCreatureList.add(new Biome.SpawnListEntry(EntitySquid.class, 10, 4, 4));
    this.spawnableCaveCreatureList.add(new Biome.SpawnListEntry(EntityBat.class, 10, 8, 8));
    this.addDefaultFlowers();
}
 
Example 50
Project: CustomWorldGen   File: EntityEgg.java   Source Code and License 5 votes vote down vote up
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(RayTraceResult result)
{
    if (result.entityHit != null)
    {
        result.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0)
    {
        int i = 1;

        if (this.rand.nextInt(32) == 0)
        {
            i = 4;
        }

        for (int j = 0; j < i; ++j)
        {
            EntityChicken entitychicken = new EntityChicken(this.worldObj);
            entitychicken.setGrowingAge(-24000);
            entitychicken.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
            this.worldObj.spawnEntityInWorld(entitychicken);
        }
    }

    double d0 = 0.08D;

    for (int k = 0; k < 8; ++k)
    {
        this.worldObj.spawnParticle(EnumParticleTypes.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, ((double)this.rand.nextFloat() - 0.5D) * 0.08D, new int[] {Item.getIdFromItem(Items.EGG)});
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
Example 51
Project: CustomWorldGen   File: RenderChicken.java   Source Code and License 5 votes vote down vote up
/**
 * Defines what float the third param in setRotationAngles of ModelBase is
 */
protected float handleRotationFloat(EntityChicken livingBase, float partialTicks)
{
    float f = livingBase.oFlap + (livingBase.wingRotation - livingBase.oFlap) * partialTicks;
    float f1 = livingBase.oFlapSpeed + (livingBase.destPos - livingBase.oFlapSpeed) * partialTicks;
    return (MathHelper.sin(f) + 1.0F) * f1;
}
 
Example 52
Project: Possessed   File: PossessHandler.java   Source Code and License 5 votes vote down vote up
public static void onPreInit() {
    PossessHandler.registerHandler(new BlazeHandler());
    PossessHandler.registerHandler(new ChickenHandler());
    PossessHandler.registerHandler(new CreeperHandler());
    PossessHandler.registerHandler(new DragonHandler());
    PossessHandler.registerHandler(new EndermanHandler());
    PossessHandler.registerHandler(new FlyingHandler(EntityFlying.class, new ResourceLocation(Possessed.MODID, "flying")));
    PossessHandler.registerHandler(new FlyingHandler(EntityBat.class, new ResourceLocation(Possessed.MODID, "bat_flying")));
    PossessHandler.registerHandler(new FlyingHandler(EntityBlaze.class, new ResourceLocation(Possessed.MODID, "blaze_flying")));
    PossessHandler.registerHandler(new GhastHandler());
    PossessHandler.registerHandler(new GrassEatHandler(EntityCow.class, new ResourceLocation(Possessed.MODID, "cow_grass")));
    PossessHandler.registerHandler(new GrassEatHandler(EntityChicken.class, new ResourceLocation(Possessed.MODID, "chicken_grass")));
    PossessHandler.registerHandler(new GrassEatHandler(EntityPig.class, new ResourceLocation(Possessed.MODID, "pig_grass")));
    PossessHandler.registerHandler(new GrassEatHandler(EntityHorse.class, new ResourceLocation(Possessed.MODID, "horse_grass")));
    PossessHandler.registerHandler(new GuardianHandler());
    PossessHandler.registerHandler(new IronGolemHandler());
    PossessHandler.registerHandler(new OcelotHandler());
    PossessHandler.registerHandler(new PolarBearHandler());
    PossessHandler.registerHandler(new RabbitHandler());
    PossessHandler.registerHandler(new SheepHandler());
    PossessHandler.registerHandler(new ShulkerHandler());
    PossessHandler.registerHandler(new SkeletonHandler());
    PossessHandler.registerHandler(new SlimeHandler());
    PossessHandler.registerHandler(new SnowmanHandler());
    PossessHandler.registerHandler(new SpiderHandler());
    PossessHandler.registerHandler(new SquidHandler());
    PossessHandler.registerHandler(new WaterMobHandler());
    PossessHandler.registerHandler(new WitherHandler());
    PossessHandler.registerHandler(new ZombieHandler());
}
 
Example 53
Project: BetterWithAddons   File: EggIncubationHandler.java   Source Code and License 5 votes vote down vote up
private void handleEggs()
{
    if(TrackedItemsIterator == null || !TrackedItemsIterator.hasNext())
    {
        TrackedItems.addAll(TrackedItemsAdd);
        TrackedItemsAdd.clear();
        TrackedItemsIterator = TrackedItems.iterator();
    }
    else
    {
        EntityItem entity = TrackedItemsIterator.next();
        World world = entity.world;
        ItemStack stack = entity.getEntityItem();
        BlockPos pos = entity.getPosition();
        boolean remove = false;
        if(entity.isDead || stack.isEmpty() || stack.getItem() != Items.EGG || stack.getCount() > 1)
            remove = true;
        else if((int) ReflectionHelper.getPrivateValue(EntityItem.class, entity, "d", "field_70292_b", "age") > 5400 && hasPadding(world,pos.down()) && hasLitLight(world,pos.up()))
        {
            world.playSound(null,entity.posX,entity.posY,entity.posZ, SoundEvents.ENTITY_CHICKEN_EGG, SoundCategory.NEUTRAL,  0.25F, world.rand.nextFloat() * 1.5F + 1.0F);
            EntityChicken chick = new EntityChicken(world);
            chick.setGrowingAge(-24000);
            chick.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, 0F, 0F);
            world.spawnEntity(chick);
            stack.shrink(1);
            if (stack.isEmpty()) entity.setDead();
        }

        if(remove)
            TrackedItemsIterator.remove();
    }
}
 
Example 54
Project: ToroQuest   File: CivilizationHandlers.java   Source Code and License 5 votes vote down vote up
private boolean isAnimal(EntityLivingBase victim) {
	return victim instanceof EntityCow ||
			victim instanceof EntityHorse ||
			victim instanceof EntityPig ||
			victim instanceof EntityDonkey ||
			victim instanceof EntityChicken ||
			victim instanceof EntitySheep;
}
 
Example 55
Project: FairyFactions   File: Spawner.java   Source Code and License 5 votes vote down vote up
public Spawner() {
	biomeList = new ArrayList();

	try {
		Field afield[] = (BiomeGenBase.class).getDeclaredFields();
		LinkedList linkedlist = new LinkedList();

		for (int j = 0; j < afield.length; j++) {
			Class class1 = afield[j].getType();

			if ((afield[j].getModifiers() & 8) != 0 && class1.isAssignableFrom(BiomeGenBase.class)) {
				BiomeGenBase biomegenbase = (BiomeGenBase) afield[j].get(null);
				biomeList.add(biomegenbase.biomeName);

				if (!(biomegenbase instanceof BiomeGenHell) && !(biomegenbase instanceof BiomeGenEnd)) {
					linkedlist.add(biomegenbase);
				}
			}
		}

		standardBiomes = (BiomeGenBase[]) linkedlist.toArray(new BiomeGenBase[0]);
		customCreatureSpawnList = new List[biomeList.size()];
		customMobSpawnList = new List[biomeList.size()];
		customAquaticSpawnList = new List[biomeList.size()];
		entityClasses = new List[3];
		vanillaClassList = new ArrayList<Class>();
		vanillaClassList.add(EntityChicken.class);
		vanillaClassList.add(EntityCow.class);
		vanillaClassList.add(EntityPig.class);
		vanillaClassList.add(EntitySheep.class);
		vanillaClassList.add(EntityWolf.class);
		vanillaClassList.add(EntitySquid.class);
		clearLists();
	} catch (IllegalAccessException exception) {
		throw new RuntimeException(exception);
	}
}
 
Example 56
Project: FairyFactions   File: Spawner.java   Source Code and License 5 votes vote down vote up
public final int despawnVanillaAnimals(World worldObj) {
	int count = 0;

	for (int j = 0; j < worldObj.loadedEntityList.size(); j++) {
		Entity entity = (Entity) worldObj.loadedEntityList.get(j);

		if ((entity instanceof EntityLiving) && (entity instanceof EntityCow || entity instanceof EntitySheep
				|| entity instanceof EntityPig || entity instanceof EntityChicken || entity instanceof EntitySquid
				|| entity instanceof EntityWolf)) {
			count += entityDespawnCheck(worldObj, (EntityLiving) entity);
		}
	}

	return count;
}
 
Example 57
Project: FairyFactions   File: EntityFairy.java   Source Code and License 5 votes vote down vote up
@Override
public double getYOffset() {
	if (ridingEntity != null) {
		if (this.worldObj.isRemote) {
			return yOffset - ( flymode() ? 1.15F : 1.35f );
		}

		return yOffset + ( flymode() ? 0.65F : 0.55F )
				- ( ridingEntity instanceof EntityChicken ? 0.0F : 0.15F );
	} else {
		return yOffset;
	}
}
 
Example 58
Project: PopularMMOS-EpicProportions-Mod   File: EntityFred2_0.java   Source Code and License 5 votes vote down vote up
/**
 * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
 * use this to react to sunlight and start to burn.
 */
public void onLivingUpdate()
{
    if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())
    {
        float f = this.getBrightness(1.0F);

        if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
        {
            boolean flag = true;
            ItemStack itemstack = this.getEquipmentInSlot(4);

            if (itemstack != null)
            {
                if (itemstack.isItemStackDamageable())
                {
                    itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2));

                    if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage())
                    {
                        this.renderBrokenItemStack(itemstack);
                        this.setCurrentItemOrArmor(4, (ItemStack)null);
                    }
                }

                flag = false;
            }

            
        }
    }

    if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken)
    {
        ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D);
    }

    super.onLivingUpdate();
}
 
Example 59
Project: PopularMMOS-EpicProportions-Mod   File: EntityNinjaMaster.java   Source Code and License 5 votes vote down vote up
/**
 * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
 * use this to react to sunlight and start to burn.
 */
public void onLivingUpdate()
{
    if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())
    {
        float f = this.getBrightness(1.0F);

        if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
        {
            boolean flag = true;
            ItemStack itemstack = this.getEquipmentInSlot(4);

            if (itemstack != null)
            {
                if (itemstack.isItemStackDamageable())
                {
                    itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2));

                    if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage())
                    {
                        this.renderBrokenItemStack(itemstack);
                        this.setCurrentItemOrArmor(4, (ItemStack)null);
                    }
                }

                flag = false;
            }

            
        }
    }

    if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken)
    {
        ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D);
    }

    super.onLivingUpdate();
}
 
Example 60
Project: PopularMMOS-EpicProportions-Mod   File: EntityCandyPopper.java   Source Code and License 5 votes vote down vote up
/**
 * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
 * use this to react to sunlight and start to burn.
 */
public void onLivingUpdate()
{
    if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())
    {
        float f = this.getBrightness(1.0F);

        if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
        {
            boolean flag = true;
            ItemStack itemstack = this.getEquipmentInSlot(4);

            if (itemstack != null)
            {
                if (itemstack.isItemStackDamageable())
                {
                    itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2));

                    if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage())
                    {
                        this.renderBrokenItemStack(itemstack);
                        this.setCurrentItemOrArmor(4, (ItemStack)null);
                    }
                }

                flag = false;
            }

            
        }
    }

    if (this.isRiding() && this.getAttackTarget() != null && this.ridingEntity instanceof EntityChicken)
    {
        ((EntityLiving)this.ridingEntity).getNavigator().setPath(this.getNavigator().getPath(), 1.5D);
    }

    super.onLivingUpdate();
}