Java 类net.minecraft.entity.passive.EntityWolf 实例源码

项目:Bewitchment    文件:WolfsbaneBrew.java   
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
    if (amplifier >= 3) {
        if (entity instanceof EntityWolf) {
            entity.addPotionEffect(new PotionEffect(MobEffects.WITHER, 1500, 0));
            entity.attackEntityFrom(DamageSource.MAGIC, 20);
        }
    }

    if (amplifier == 2) {
        if (entity instanceof EntityWolf) {
            entity.attackEntityFrom(DamageSource.MAGIC, 16);
        }
    }

    if (entity instanceof EntityWolf) {
        entity.attackEntityFrom(DamageSource.MAGIC, 10);
    }
}
项目:ForgeHax    文件:EntityUtils.java   
/**
 * Checks if the mob could be possibly hostile towards us (we can't detect their attack target easily)
 * Current entities:
 *                  PigZombie: Aggressive if arms are raised, when arms are put down a internal timer is slowly ticked down from 400
 *                  Wolf: Aggressive if the owner isn't the local player and the wolf is angry
 *                  Enderman: Aggressive if making screaming sounds
 */
public static boolean isMobAggressive(Entity entity) {
    if(entity instanceof EntityPigZombie) {
        // arms raised = aggressive, angry = either game or we have set the anger cooldown
        if(((EntityPigZombie) entity).isArmsRaised() || ((EntityPigZombie) entity).isAngry()) {
            if(!((EntityPigZombie) entity).isAngry()) {
                // set pigmens anger to 400 if it hasn't been angered already
                FastReflection.Fields.EntityPigZombie_angerLevel.set((EntityPigZombie)entity, 400);
            }
            return true;
        }
    } else if(entity instanceof EntityWolf) {
        return ((EntityWolf) entity).isAngry() &&
                !MC.player.equals(((EntityWolf) entity).getOwner());
    } else if(entity instanceof EntityEnderman) {
        return ((EntityEnderman) entity).isScreaming();
    }
    return false;
}
项目:DecompiledMinecraft    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:DecompiledMinecraft    文件:EntitySkeleton.java   
public EntitySkeleton(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIRestrictSun(this));
    this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

    if (worldIn != null && !worldIn.isRemote)
    {
        this.setCombatTask();
    }
}
项目:DecompiledMinecraft    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:DecompiledMinecraft    文件:EntitySkeleton.java   
public EntitySkeleton(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIRestrictSun(this));
    this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

    if (worldIn != null && !worldIn.isRemote)
    {
        this.setCombatTask();
    }
}
项目:BaseClient    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:BaseClient    文件:EntitySkeleton.java   
public EntitySkeleton(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIRestrictSun(this));
    this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

    if (worldIn != null && !worldIn.isRemote)
    {
        this.setCombatTask();
    }
}
项目:BaseClient    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:BaseClient    文件:EntitySkeleton.java   
public EntitySkeleton(World worldIn)
{
    super(worldIn);
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIRestrictSun(this));
    this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
    this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 6.0F, 1.0D, 1.2D));
    this.tasks.addTask(4, new EntityAIWander(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

    if (worldIn != null && !worldIn.isRemote)
    {
        this.setCombatTask();
    }
}
项目:connor41-etfuturum2    文件:EntityRabbit.java   
public EntityRabbit(World world) {
    super(world);
    moveType = EntityRabbit.EnumMoveType.HOP;
    carrotTicks = 0;
    setSize(0.4F, 0.5F);
    ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitJumpHelper(this), "jumpHelper", "field_70767_i");
    ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitMoveHelper(), "moveHelper", "field_70765_h");
    getNavigator().setAvoidsWater(true);
    //      navigator.func_179678_a(2.5F);
    tasks.addTask(1, new EntityAISwimming(this));
    tasks.addTask(1, new EntityRabbit.AIPanic(1.33D));
    tasks.addTask(2, new EntityAIMate(this, 0.8D));
    tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.carrot, false));
    tasks.addTask(5, new EntityRabbit.AIRaidFarm());
    tasks.addTask(5, new EntityAIWander(this, 0.6D));
    tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    tasks.addTask(4, new EntityAIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D));
    tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
    setMovementSpeed(0.0D);
}
项目:connor41-etfuturum2    文件:ServerEventHandler.java   
@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;
            }
        }
    }
}
项目:SerenityCE    文件:KillAura.java   
private boolean entityMatchesTargetTypes(EntityLivingBase entityLivingBase) {
    boolean matches = false;

    if (entityLivingBase instanceof EntityPlayer) {
        matches = players.getValue();
    } else if (entityLivingBase instanceof IMob) {
        matches = mobs.getValue();
    } else if (entityLivingBase instanceof IAnimals) {
        matches = animals.getValue();
    }

    if (mobs.getValue()) {
        if (entityLivingBase instanceof EntityWolf) {
            EntityWolf wolf = (EntityWolf) entityLivingBase;
            matches = wolf.isAngry();
        }
    }

    return matches;
}
项目:uniquecrops    文件:ItemEnderSnooker.java   
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand) {

    List<EntityLivingBase> elb = acquireAllLookTargets(player, 32, 3);
    for (EntityLivingBase target : elb) {
        if (target.canEntityBeSeen(player) && !(target instanceof EntityPlayer)) {
            BlockPos targetpos = target.getPosition();
            BlockPos playerpos = player.getPosition();
            if (!world.isRemote) {
                target.setPositionAndUpdate(playerpos.getX(), playerpos.getY(), playerpos.getZ());
                player.setPositionAndUpdate(targetpos.getX(), targetpos.getY(), targetpos.getZ());
                if (target instanceof EntityWolf && world.rand.nextInt(100) == 0)
                    target.entityDropItem(UCItems.generic.createStack(EnumItems.DOGRESIDUE), 1);
                stack.damageItem(1, player);
                return new ActionResult(EnumActionResult.SUCCESS, stack);
            }
        }
    }
    return new ActionResult(EnumActionResult.PASS, stack);
}
项目:Backmemed    文件:BiomeForest.java   
public BiomeForest(BiomeForest.Type typeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.type = typeIn;
    this.theBiomeDecorator.treesPerChunk = 10;
    this.theBiomeDecorator.grassPerChunk = 2;

    if (this.type == BiomeForest.Type.FLOWER)
    {
        this.theBiomeDecorator.treesPerChunk = 6;
        this.theBiomeDecorator.flowersPerChunk = 100;
        this.theBiomeDecorator.grassPerChunk = 1;
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
    }

    if (this.type == BiomeForest.Type.NORMAL)
    {
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 5, 4, 4));
    }

    if (this.type == BiomeForest.Type.ROOFED)
    {
        this.theBiomeDecorator.treesPerChunk = -999;
    }
}
项目:Backmemed    文件:BiomeTaiga.java   
public BiomeTaiga(BiomeTaiga.Type typeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.type = typeIn;
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (typeIn != BiomeTaiga.Type.MEGA && typeIn != BiomeTaiga.Type.MEGA_SPRUCE)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:Backmemed    文件:LayerWolfCollar.java   
public void doRenderLayer(EntityWolf entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (entitylivingbaseIn.isTamed() && !entitylivingbaseIn.isInvisible())
    {
        this.wolfRenderer.bindTexture(WOLF_COLLAR);
        float[] afloat = EntitySheep.getDyeRgb(entitylivingbaseIn.getCollarColor());

        if (Config.isCustomColors())
        {
            afloat = CustomColors.getWolfCollarColors(entitylivingbaseIn.getCollarColor(), afloat);
        }

        GlStateManager.color(afloat[0], afloat[1], afloat[2]);
        this.wolfRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
项目:CustomWorldGen    文件:BiomeForest.java   
public BiomeForest(BiomeForest.Type typeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.type = typeIn;
    this.theBiomeDecorator.treesPerChunk = 10;
    this.theBiomeDecorator.grassPerChunk = 2;

    if (this.type == BiomeForest.Type.FLOWER)
    {
        this.theBiomeDecorator.treesPerChunk = 6;
        this.theBiomeDecorator.flowersPerChunk = 100;
        this.theBiomeDecorator.grassPerChunk = 1;
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
    }

    if (this.type == BiomeForest.Type.NORMAL)
    {
        this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 5, 4, 4));
    }

    if (this.type == BiomeForest.Type.ROOFED)
    {
        this.theBiomeDecorator.treesPerChunk = -999;
    }
}
项目:CustomWorldGen    文件:BiomeTaiga.java   
public BiomeTaiga(BiomeTaiga.Type typeIn, Biome.BiomeProperties properties)
{
    super(properties);
    this.type = typeIn;
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (typeIn != BiomeTaiga.Type.MEGA && typeIn != BiomeTaiga.Type.MEGA_SPRUCE)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:Overlord    文件:EntityArmyMember.java   
public boolean shouldAttackEntity(EntityLivingBase target){
    EntityLivingBase owner = getOwner();
    if (ConfigValues.HUNTCREEPERS || !(target instanceof EntityCreeper)) {
        if (target instanceof EntityWolf) {
            EntityWolf entitywolf = (EntityWolf) target;

            if (entitywolf.isTamed() && entitywolf.getOwner() == owner || Alliances.getInstance().isAlliedTo(entitywolf.getOwnerId(), getOwnerId()))
                return false;
        }

        if (target instanceof EntityArmyMember)
            if ((getAttackMode() < 2 && Enemies.getInstance().isNotEnemiesWith(((EntityArmyMember) target).getOwnerId(), getOwnerId())) || ((EntityArmyMember) target).getOwnerId().equals(getOwnerId()) || Alliances.getInstance().isAlliedTo(((EntityArmyMember) target).getOwnerId(), getOwnerId()))
                return false;

        return !(target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) && (!(target instanceof EntityHorse) || !((EntityHorse) target).isTame());
    } else
        return false;
}
项目:CrystalMod    文件:WolfAccessories.java   
public static void syncArmor(EntityWolf entity, boolean sendPacket) {
    if (!entity.getEntityWorld().isRemote)
       {
        entity.getEntityAttribute(SharedMonsterAttributes.ARMOR).removeModifier(UUID_ARMOR_ATTRIBUTE);
        ItemStack wolfArmor = getWolfArmorStack(entity);
        WolfArmor armor = getWolfArmor(wolfArmor);
           int i = armor.getProtection();

           if (i != 0)
           {
            entity.getEntityAttribute(SharedMonsterAttributes.ARMOR).applyModifier((new AttributeModifier(UUID_ARMOR_ATTRIBUTE, "Wolf armor bonus", i, 0)).setSaved(false));
           }
           //EntityUtil.getCustomEntityData(entity).setBoolean(EventHandler.NBT_NBTDIRTY, true);
           if(sendPacket){
            CrystalModNetwork.sendToAllAround(new PacketEntityMessage(entity, "CustomDataSync", EntityUtil.getCustomEntityData(entity)), entity);
           }
       }
}
项目:CrystalMod    文件:WolfAccessories.java   
public static boolean handleWolfInteract(EntityPlayer player, ItemStack held, EnumHand hand, EntityWolf entity) {
    if(ItemStackTools.isValid(held) && !entity.getEntityWorld().isRemote){
        if(held.getItem() instanceof IWolfArmor){
            ItemStack lastStack = WolfAccessories.getWolfArmorStack(entity);
            if(ItemStackTools.isValid(lastStack)){
                entity.entityDropItem(lastStack, 0);
            }
            ItemStack copy = ItemStackTools.safeCopy(held);
            if(ItemStackTools.isValid(copy)){
                setWolfArmor(entity, copy);
                if(!player.capabilities.isCreativeMode)player.setHeldItem(hand, ItemUtil.consumeItem(held));
                return true;
            }
        }
    }
    return false;
}
项目:CrystalMod    文件:LayerWolfAccessories.java   
@Override
public void doRenderLayer(EntityWolf entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    boolean invis = entity.isInvisible() || entity.isInvisibleToPlayer(CrystalMod.proxy.getClientPlayer());
    if(invis)return;
    if(ItemStackTools.isValid(WolfAccessories.getWolfArmorStack(entity))){
        ItemStack armorStack = WolfAccessories.getWolfArmorStack(entity);
        GlStateManager.pushMatrix();
        for(int i = 0; i < 2; i++){
            ModelWolfArmor model = null;
            if(i == 0)model = modelWolfArmor0;
            if(i == 1)model = modelWolfArmor1;
            if(model !=null){
                model.setModelAttributes(renderer.getMainModel());
                model.setLivingAnimations(entity, limbSwing, limbSwingAmount, partialTicks);

                //TODO Add leather armor dying support
                renderer.bindTexture(getTexture(WolfAccessories.getWolfArmor(armorStack), i));
                GlStateManager.color(1, 1, 1, 1);
                model.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
            }
        }
        GlStateManager.popMatrix();
    }
}
项目:MidgarCrusade    文件:BiomRoofedForest.java   
public BiomRoofedForest(int p_i45383_1_)
  {
      super(p_i45383_1_);

      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 2, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCentaure.class, 12, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityLutin.class, 14, 4, 6));

      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCaveSpider.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 4));

this.topBlock = BlockRegister.GRASS;
this.fillerBlock = BlockRegister.DIRT;
this.setBiomeName("Mystic Roofed Forest");
this.theBiomeDecorator.grassPerChunk = 16;
      ((BiomeDecoratorMagic) this.theBiomeDecorator).berry_per_chunk = 6;
this.theBiomeDecorator.treesPerChunk = 10;
  }
项目:MidgarCrusade    文件:BiomMagicForest.java   
public BiomMagicForest(int p_i45383_1_)
  {
      super(p_i45383_1_);

      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 2, 4, 6));
      this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityStymph.class, 10, 4, 6));

      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityLutin.class, 14, 4, 6));   
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCentaure.class, 12, 4, 6));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCaveSpider.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 8, 2, 4));
      this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityGobelin.class, 8, 2, 4));

this.topBlock = Blocks.grass;
this.fillerBlock = Blocks.dirt;
this.setBiomeName("Mystic Forest");
this.theBiomeDecorator.grassPerChunk = 16;
      ((BiomeDecoratorMagic) this.theBiomeDecorator).berry_per_chunk = 6;
this.theBiomeDecorator.treesPerChunk = 6;
  }
项目:Gravestone-mod-Extended    文件:EntityZombieDog.java   
public EntityZombieDog(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));
    }
    this.targetTasks.addTask(4, new EntityAINearestAttackableHorse(this, false));
    if (ExtendedConfig.zombiePetsAttackAnimals) {
        this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntitySheep.class, false));
    }
}
项目:Gravestone-mod-Extended    文件:EntityZombieCat.java   
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));
}
项目:Gravestone-mod-Extended    文件:CorpseHelper.java   
public static List<ItemStack> getCorpse(Entity entity, EnumCorpse type) {
    NBTTagCompound nbtTag = new NBTTagCompound();
    switch (type) {
        case VILLAGER:
            VillagerCorpseHelper.setNbt((EntityVillager) entity, nbtTag);
            break;
        case HORSE:
            HorseCorpseHelper.setNbt((AbstractHorse) entity, nbtTag);
            break;
        case DOG:
            DogCorpseHelper.setNbt((EntityWolf) entity, nbtTag);
            break;
        case CAT:
            CatCorpseHelper.setNbt((EntityOcelot) entity, nbtTag);
            break;
    }

    List<ItemStack> corpse = new ArrayList<>();
    ItemStack stack = new ItemStack(GSBlock.CORPSE, 1, type.ordinal());
    stack.setTagCompound(nbtTag);
    corpse.add(stack);
    return corpse;
}
项目:wolfarmor    文件:WolfArmorGuiHandler.java   
/**
 * Returns a Server side Container to be displayed to the user.
 *
 * @param ID     The Gui ID Number
 * @param player The player viewing the Gui
 * @param world  The current world
 * @param x      X Position
 * @param y      Y Position
 * @param z      Z Position
 * @return A GuiScreen/Container to be displayed to the user, null if none.
 */
@Override
@Nullable
public Object getServerGuiElement(int ID,
                                  @Nonnull EntityPlayer player,
                                  @Nonnull World world,
                                  int x,
                                  int y,
                                  int z) {
    Entity entity = world.getEntityByID(ID);

    if (entity != null && entity.hasCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null)) {
        IWolfArmorCapability wolfArmor = entity.getCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null);
        if (wolfArmor != null) {
            return new ContainerWolfInventory(player.inventory, wolfArmor.getInventory(), (EntityWolf) entity, player);
        }
    }
    return null;
}
项目:wolfarmor    文件:WolfArmorGuiHandler.java   
/**
 * Returns a Container to be displayed to the user. On the client side, this
 * needs to return a instance of GuiScreen On the server side, this needs to
 * return a instance of Container
 *
 * @param ID     The Gui ID Number
 * @param player The player viewing the Gui
 * @param world  The current world
 * @param x      X Position
 * @param y      Y Position
 * @param z      Z Position
 * @return A GuiScreen/Container to be displayed to the user, null if none.
 */
@Override
@Nullable
public Object getClientGuiElement(int ID,
                                  @Nonnull EntityPlayer player,
                                  @Nonnull World world,
                                  int x,
                                  int y,
                                  int z) {
    Entity entity = world.getEntityByID(ID);

    if (entity != null && entity.hasCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null)) {
        IWolfArmorCapability wolfArmor = entity.getCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null);
        if (wolfArmor != null) {
            return new GuiWolfInventory(player.inventory, wolfArmor.getInventory(), (EntityWolf) entity, player);
        }
    }
    return null;
}
项目:BeeBarker    文件:EventHandlerServer.java   
@SubscribeEvent
public void onPlaySoundAtEntity(PlaySoundAtEntityEvent event)
{
    if(event.getEntity() instanceof EntityWolf && event.getSound() == SoundEvents.ENTITY_WOLF_AMBIENT && !event.getEntity().world.isRemote)
    {
        EntityWolf wolf = (EntityWolf)event.getEntity();
        NBTTagCompound wolfData = wolf.getEntityData();
        if(wolfData.getBoolean(BARKABLE_STRING) && wolf.getRNG().nextFloat() < 0.05F)
        {
            for(int i = 0; i < wolf.getRNG().nextInt(5) + 1; i++)
            {
                wolf.world.spawnEntity(new EntityBee(wolf.world, wolf));
            }
        }
    }
}
项目:Et-Futurum    文件:EntityRabbit.java   
public EntityRabbit(World world) {
    super(world);
    moveType = EntityRabbit.EnumMoveType.HOP;
    carrotTicks = 0;
    setSize(0.4F, 0.5F);
    ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitJumpHelper(this), "jumpHelper", "field_70767_i");
    ReflectionHelper.setPrivateValue(EntityLiving.class, this, new EntityRabbit.RabbitMoveHelper(), "moveHelper", "field_70765_h");
    getNavigator().setAvoidsWater(true);
    //      navigator.func_179678_a(2.5F);
    tasks.addTask(1, new EntityAISwimming(this));
    tasks.addTask(1, new EntityRabbit.AIPanic(1.33D));
    tasks.addTask(2, new EntityAIMate(this, 0.8D));
    tasks.addTask(3, new EntityAITempt(this, 1.0D, Items.carrot, false));
    tasks.addTask(5, new EntityRabbit.AIRaidFarm());
    tasks.addTask(5, new EntityAIWander(this, 0.6D));
    tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
    tasks.addTask(4, new EntityAIAvoidEntity(this, EntityWolf.class, 16.0F, 1.33D, 1.33D));
    tasks.addTask(4, new EntityAIAvoidEntity(this, EntityPlayer.class, 16.0F, 0.8D, 1.33D));
    setMovementSpeed(0.0D);
}
项目:Et-Futurum    文件:ServerEventHandler.java   
@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;
            }
        }
    }
}
项目:Resilience-Client-Source    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}
项目:Resilience-Client-Source    文件:RenderWolf.java   
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntityWolf par1EntityWolf, int par2, float par3)
{
    if (par2 == 0 && par1EntityWolf.getWolfShaking())
    {
        float var5 = par1EntityWolf.getBrightness(par3) * par1EntityWolf.getShadingWhileShaking(par3);
        this.bindTexture(wolfTextures);
        GL11.glColor3f(var5, var5, var5);
        return 1;
    }
    else if (par2 == 1 && par1EntityWolf.isTamed())
    {
        this.bindTexture(wolfCollarTextures);
        int var4 = par1EntityWolf.getCollarColor();
        GL11.glColor3f(EntitySheep.fleeceColorTable[var4][0], EntitySheep.fleeceColorTable[var4][1], EntitySheep.fleeceColorTable[var4][2]);
        return 1;
    }
    else
    {
        return -1;
    }
}
项目:RidiculousWorld    文件:BiomeGenSpooky.java   
public BiomeGenSpooky(int id)
{
    super(id);
    this.spawnableCreatureList.clear();
    this.theBiomeDecorator.treesPerChunk = 10;
    this.theBiomeDecorator.grassPerChunk = 2;
    this.theBiomeDecorator.mushroomsPerChunk = 1;
    this.spawnableCreatureList.clear();
    this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 10, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityWitch.class, 10, 4, 4));
    this.spawnableMonsterList.add(new SpawnListEntry(EntityFrankenstein.class, 90, 4, 4));
    BiomeManager.addBiome(BiomeManager.BiomeType.COOL, new BiomeEntry(this, Config.spookyWeight));
    BiomeManager.addStrongholdBiome(this);
    BiomeDictionary.registerBiomeType(this, Type.SPOOKY, Type.MAGICAL, Type.FOREST);
    setBiomeName("Spooky Forest");
    setTemperatureRainfall(0.25F, 0.5F);
    setColor(0xF2A100);
    this.waterColorMultiplier = 0x970E0E;
}
项目:Sophisticated-wolves    文件:RenderSophisticatedWolf.java   
public int getWolfNameColor(EntityWolf wolf) {
    if (wolf.getHealth() < 20) {
        if (wolf.getHealth() < 16) {
            if (wolf.getHealth() < 11) {
                if (wolf.getHealth() < 6) {
                    return 0xffff0202;
                }
                return 0xfffe5656;
            }
            return 0xffff9696;
        }
        return 0xfffecccc;
    } else {
        return 0xffffffff;
    }
}
项目:Sophisticated-wolves    文件:RenderSophisticatedWolf.java   
public int getSitNameColor(EntityWolf wolf) {
    if (wolf.getHealth() < 20) {
        if (wolf.getHealth() < 16) {
            if (wolf.getHealth() < 11) {
                if (wolf.getHealth() < 6) {
                    return 0x40ff0202;
                }
                return 0x40fe5656;
            }
            return 0x40ff9696;
        }
        return 0x40fecccc;
    } else {
        return 0x40ffffff;
    }
}
项目:Sophisticated-wolves    文件:CompatibilityWolfArmor.java   
public static NBTTagCompound storeWolfItems(EntityWolf wolf, NBTTagCompound nbt) {
        if (wolf.hasCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null)) {
            IWolfArmorCapability wolfCapability = wolf.getCapability(CapabilityWolfArmor.WOLF_ARMOR_CAPABILITY, null);
            if (wolfCapability != null) {
                nbt.setBoolean("HasChest", wolfCapability.getHasChest());
                if (wolfCapability.getHasChest()) {
//                    wolfCapability.setInventory(wolfCapability.getInventory());//TODO setInventory!!!!
//                    NBTTagCompound itemsNBT = new NBTTagCompound();
//                    wolfCapability.getArmorItemStack().writeToNBT(itemsNBT);
//                    nbt.setTag("Items", itemsNBT);
                    wolfCapability.dropInventoryContents();
                }
                if (wolfCapability.getHasArmor()) {
                    NBTTagCompound armorNBT = new NBTTagCompound();
                    wolfCapability.getArmorItemStack().writeToNBT(armorNBT);
                    nbt.setTag("Armor", armorNBT);
                }
            }
        }
        return nbt;
    }
项目:Cauldron    文件:BiomeGenTaiga.java   
public BiomeGenTaiga(int p_i45385_1_, int p_i45385_2_)
{
    super(p_i45385_1_);
    this.field_150644_aH = p_i45385_2_;
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityWolf.class, 8, 4, 4));
    this.theBiomeDecorator.treesPerChunk = 10;

    if (p_i45385_2_ != 1 && p_i45385_2_ != 2)
    {
        this.theBiomeDecorator.grassPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 1;
    }
    else
    {
        this.theBiomeDecorator.grassPerChunk = 7;
        this.theBiomeDecorator.deadBushPerChunk = 1;
        this.theBiomeDecorator.mushroomsPerChunk = 3;
    }
}