Package net.minecraft.entity

Examples of net.minecraft.entity.EntityAgeable


    {
      if(!(o instanceof EntityAgeable))
      {
        continue;
      }
      EntityAgeable a = (EntityAgeable)o;
      if((a.getGrowingAge() < 0 && !_moveOld) || (a.getGrowingAge() >= 0 && _moveOld))
      {
        BlockPosition bp = BlockPosition.fromFactoryTile(this);
        bp.moveBackwards(1);
        a.setPosition(bp.x + 0.5, bp.y + 0.5, bp.z + 0.5);
       
        return true;
      }
    }
    setIdleTicks(getIdleTicksMax());
View Full Code Here


    /**
     * Spawns a baby animal of the same type.
     */
    private void spawnBaby() {
        EntityAgeable baby = this.theAnimal.createChild(this.targetMate);

        if(baby instanceof EntityAnimal) {
            this.theAnimal.setGrowingAge(3600); // 6000
            this.targetMate.setGrowingAge(3600); // 6000
            this.theAnimal.resetInLove();
            this.targetMate.resetInLove();
            baby.setGrowingAge(-12000); // -24000

            modifyAI((EntityAnimal)baby);

            Random rand = this.theAnimal.getRNG();
            if(baby instanceof EntityOcelot) {
                EntityOcelot cat = (EntityOcelot)baby;
                if(rand.nextInt(10) == 0) {
                    cat.setTameSkin(baby.worldObj.rand.nextInt(4));
                }
            }

            double x = rand.nextGaussian() * 0.2D;
            double z = rand.nextGaussian() * 0.2D;
            baby.setLocationAndAngles(this.theAnimal.posX + x, this.theAnimal.posY, this.theAnimal.posZ + z, 0.0F, 0.0F);
            this.theWorld.spawnEntityInWorld(baby);

            for(int i = 0; i < 7; ++i) {
                double px = rand.nextGaussian() * 0.02D;
                double py = rand.nextGaussian() * 0.02D;
 
View Full Code Here

    @Override
    public int testCarts(List<EntityMinecart> carts) {
        for (EntityMinecart cart : carts) {
            if (cart.riddenByEntity instanceof EntityAgeable) {
                EntityAgeable ageable = (EntityAgeable) cart.riddenByEntity;
                return ageable.isChild() ? NO_POWER : FULL_POWER;
            }
            if (cart.riddenByEntity != null) {
                return FULL_POWER;
            }
        }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.EntityAgeable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.