当前位置: 首页>>代码示例>>Java>>正文


Java EntityChicken.setLocationAndAngles方法代码示例

本文整理汇总了Java中net.minecraft.entity.passive.EntityChicken.setLocationAndAngles方法的典型用法代码示例。如果您正苦于以下问题:Java EntityChicken.setLocationAndAngles方法的具体用法?Java EntityChicken.setLocationAndAngles怎么用?Java EntityChicken.setLocationAndAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.entity.passive.EntityChicken的用法示例。


在下文中一共展示了EntityChicken.setLocationAndAngles方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateEntity

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:Team-Radicool,项目名称:CreepTech,代码行数:19,代码来源:TileEntityIncubator.java

示例2: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:41,代码来源:EntityEgg.java

示例3: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:35,代码来源:EntityEgg.java

示例4: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:41,代码来源:EntityEgg.java

示例5: handleEggs

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:33,代码来源:EggIncubationHandler.java

示例6: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
    if (par1MovingObjectPosition.entityHit != null)
    {
        par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

    if (!this.worldObj.isClient && this.rand.nextInt(8) == 0)
    {
        byte var2 = 1;

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

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

    for (int var5 = 0; var5 < 8; ++var5)
    {
        this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.worldObj.isClient)
    {
        this.setDead();
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:39,代码来源:EntityEgg.java

示例7: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
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)
    {
        byte b0 = 1;

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

        for (int i = 0; i < b0; ++i)
        {
            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);
        }
    }

    for (int j = 0; j < 8; ++j)
    {
        this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:36,代码来源:EntityEgg.java

示例8: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * Called when this EntityThrowable hits a block or entity.
 */
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
    if (par1MovingObjectPosition.entityHit != null)
    {
        par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F);
    }

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

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

        for (int i = 0; i < b0; ++i)
        {
            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);
        }
    }

    for (int j = 0; j < 8; ++j)
    {
        this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:39,代码来源:EntityEgg.java

示例9: onImpact

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
/**
 * 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)
    {
        byte b0 = 1;

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

        for (int i = 0; i < b0; ++i)
        {
            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);
        }
    }

    for (int j = 0; j < 8; ++j)
    {
        this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    }

    if (!this.worldObj.isRemote)
    {
        this.setDead();
    }
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10,代码行数:39,代码来源:EntityGenericEgg.java

示例10: onInitialSpawn

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
@Nullable

    /**
     * Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called
     * when entity is reloaded from nbt. Mainly used for initializing attributes and inventory
     */
    public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata)
    {
        livingdata = super.onInitialSpawn(difficulty, livingdata);
        float f = difficulty.getClampedAdditionalDifficulty();
        this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);

        if (livingdata == null)
        {
            livingdata = new EntityZombie.GroupData(this.world.rand.nextFloat() < 0.05F);
        }

        if (livingdata instanceof EntityZombie.GroupData)
        {
            EntityZombie.GroupData entityzombie$groupdata = (EntityZombie.GroupData)livingdata;

            if (entityzombie$groupdata.isChild)
            {
                this.setChild(true);

                if ((double)this.world.rand.nextFloat() < 0.05D)
                {
                    List<EntityChicken> list = this.world.<EntityChicken>getEntitiesWithinAABB(EntityChicken.class, this.getEntityBoundingBox().expand(5.0D, 3.0D, 5.0D), EntitySelectors.IS_STANDALONE);

                    if (!list.isEmpty())
                    {
                        EntityChicken entitychicken = (EntityChicken)list.get(0);
                        entitychicken.setChickenJockey(true);
                        this.startRiding(entitychicken);
                    }
                }
                else if ((double)this.world.rand.nextFloat() < 0.05D)
                {
                    EntityChicken entitychicken1 = new EntityChicken(this.world);
                    entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
                    entitychicken1.onInitialSpawn(difficulty, (IEntityLivingData)null);
                    entitychicken1.setChickenJockey(true);
                    this.world.spawnEntityInWorld(entitychicken1);
                    this.startRiding(entitychicken1);
                }
            }
        }

        this.setBreakDoorsAItask(this.rand.nextFloat() < f * 0.1F);
        this.setEquipmentBasedOnDifficulty(difficulty);
        this.setEnchantmentBasedOnDifficulty(difficulty);

        if (this.getItemStackFromSlot(EntityEquipmentSlot.HEAD).func_190926_b())
        {
            Calendar calendar = this.world.getCurrentDate();

            if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
            {
                this.setItemStackToSlot(EntityEquipmentSlot.HEAD, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.LIT_PUMPKIN : Blocks.PUMPKIN));
                this.inventoryArmorDropChances[EntityEquipmentSlot.HEAD.getIndex()] = 0.0F;
            }
        }

        this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
        double d0 = this.rand.nextDouble() * 1.5D * (double)f;

        if (d0 > 1.0D)
        {
            this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2));
        }

        if (this.rand.nextFloat() < f * 0.05F)
        {
            this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
            this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
            this.setBreakDoorsAItask(true);
        }

        return livingdata;
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:81,代码来源:EntityZombie.java

示例11: onSpawnWithEgg

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_)
{
    Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_);
    float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);

    if (p_110161_1_1 == null)
    {
        p_110161_1_1 = new EntityClown.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null);
    }

    if (p_110161_1_1 instanceof EntityClown.GroupData)
    {
    	EntityClown.GroupData groupdata = (EntityClown.GroupData)p_110161_1_1;

        if (groupdata.field_142046_b)
        {
            this.setVillager(true);
        }

        if (groupdata.field_142048_a)
        {
            this.setChild(true);

            if ((double)this.worldObj.rand.nextFloat() < 0.05D)
            {
                List list = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b);

                if (!list.isEmpty())
                {
                    EntityChicken entitychicken = (EntityChicken)list.get(0);
                    entitychicken.func_152117_i(true);
                    this.mountEntity(entitychicken);
                }
            }
            else if ((double)this.worldObj.rand.nextFloat() < 0.05D)
            {
                EntityChicken entitychicken1 = new EntityChicken(this.worldObj);
                entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
                entitychicken1.onSpawnWithEgg((IEntityLivingData)null);
                entitychicken1.func_152117_i(true);
                this.worldObj.spawnEntityInWorld(entitychicken1);
                this.mountEntity(entitychicken1);
            }
        }
    }

    this.func_146070_a(this.rand.nextFloat() < f * 0.1F);
    this.addRandomArmor();
    this.enchantEquipment();

    if (this.getEquipmentInSlot(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
    double d0 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);

    if (d0 > 1.0D)
    {
        this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2));
    }

    if (this.rand.nextFloat() < f * 0.05F)
    {
        this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
        this.func_146070_a(true);
    }

    return (IEntityLivingData)p_110161_1_1;
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:80,代码来源:EntityClown.java

示例12: recieveMana

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
@Override
/** Nothing to see here Vazkii ◕_◕ */
public void recieveMana(int mana) {
	EntityChicken chicken = new EntityChicken(worldObj);
	chicken.setLocationAndAngles(xCoord, yCoord, zCoord, 0, 0);
	teleportEntity(chicken);

	if(diallingTo == null && diallingFrom == null)
		return;

	TileEntityStargateController sgc = null;
	if(this.diallingTo.worldObj.getTileEntity(this.diallingTo.x, this.diallingTo.y, this.diallingTo.z) instanceof TileEntityStargateController)
		sgc = (TileEntityStargateController) this.diallingTo.worldObj.getTileEntity(this.diallingTo.x, this.diallingTo.y, this.diallingTo.z);

	if(sgc == null)
		return;

	EnumDirection toShape = sgc.direction; //Dialling To
	if(toShape == null)
		toShape = EnumDirection.getShapeOfStargate(sgc);

	int xDifference = (int) (chicken.posX - xCoord);
	int zDifference = (int) (chicken.posZ - zCoord);
	
	if(xDifference < 0)
		xDifference *= -1;

	if(zDifference < 0)
		zDifference *= -1;
	
	EntityManaBurst burst = new EntityManaBurst(worldObj);
	burst.setLocationAndAngles(((int) chicken.posX) + 0.5, ((int) chicken.posY) + 0.5, ((int) chicken.posZ) + 0.5, 0, 0);
	burst.setColor(new Color(new Random().nextInt(256), new Random().nextInt(256), new Random().nextInt(256)).getRGB());
	burst.setMana(mana - (xDifference / 10) - (zDifference / 10));
	burst.setStartingMana(mana);
	burst.setMinManaLoss(0);
	burst.setManaLossPerTick(1);
	burst.setGravity(0F);
	burst.setMotion(toShape.isXAxis() ? toShape.isPositive() ? 0.5 : toShape.isNegative() ? -0.5 : 0 : 0, toShape.isYAxis() ? toShape.isPositive() ? 0.5 : toShape.isNegative() ? -0.5 : 0 : 0, toShape.isZAxis() ? toShape.isPositive() ? 0.5 : toShape.isNegative() ? -0.5 : 0 : 0);
	worldObj.spawnEntityInWorld(burst);
}
 
开发者ID:UnderMybrella,项目名称:Minegate,代码行数:42,代码来源:TileEntityStargatePortal.java

示例13: onSpawnWithEgg

import net.minecraft.entity.passive.EntityChicken; //导入方法依赖的package包/类
public IEntityLivingData onSpawnWithEgg(IEntityLivingData p_110161_1_)
{
    Object p_110161_1_1 = super.onSpawnWithEgg(p_110161_1_);
    float f = this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);
    this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * f);

    if (p_110161_1_1 == null)
    {
        p_110161_1_1 = new EntityZombie.GroupData(this.worldObj.rand.nextFloat() < ForgeModContainer.zombieBabyChance, this.worldObj.rand.nextFloat() < 0.05F, null);
    }

    if (p_110161_1_1 instanceof EntityZombie.GroupData)
    {
        EntityZombie.GroupData groupdata = (EntityZombie.GroupData)p_110161_1_1;

        if (groupdata.field_142046_b)
        {
            this.setVillager(true);
        }

        if (groupdata.field_142048_a)
        {
            this.setChild(true);

            if ((double)this.worldObj.rand.nextFloat() < 0.05D)
            {
                List list = this.worldObj.selectEntitiesWithinAABB(EntityChicken.class, this.boundingBox.expand(5.0D, 3.0D, 5.0D), IEntitySelector.field_152785_b);

                if (!list.isEmpty())
                {
                    EntityChicken entitychicken = (EntityChicken)list.get(0);
                    entitychicken.func_152117_i(true);
                    this.mountEntity(entitychicken);
                }
            }
            else if ((double)this.worldObj.rand.nextFloat() < 0.05D)
            {
                EntityChicken entitychicken1 = new EntityChicken(this.worldObj);
                entitychicken1.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
                entitychicken1.onSpawnWithEgg((IEntityLivingData)null);
                entitychicken1.func_152117_i(true);
                this.worldObj.spawnEntityInWorld(entitychicken1);
                this.mountEntity(entitychicken1);
            }
        }
    }

    this.func_146070_a(this.rand.nextFloat() < f * 0.1F);
    this.addRandomArmor();
    this.enchantEquipment();

    if (this.getEquipmentInSlot(4) == null)
    {
        Calendar calendar = this.worldObj.getCurrentDate();

        if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
        {
            this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Blocks.lit_pumpkin : Blocks.pumpkin));
            this.equipmentDropChances[4] = 0.0F;
        }
    }

    this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
    double d0 = this.rand.nextDouble() * 1.5D * (double)this.worldObj.func_147462_b(this.posX, this.posY, this.posZ);

    if (d0 > 1.0D)
    {
        this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", d0, 2));
    }

    if (this.rand.nextFloat() < f * 0.05F)
    {
        this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
        this.func_146070_a(true);
    }

    return (IEntityLivingData)p_110161_1_1;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:80,代码来源:EntityZombie.java


注:本文中的net.minecraft.entity.passive.EntityChicken.setLocationAndAngles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。