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

The following are top voted examples for showing how to use net.minecraft.entity.passive.EntityWolf. 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: Bewitchment   File: WolfsbaneBrew.java   View source code 6 votes vote down vote up
@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);
	}
}
 
Example 2
Project: ForgeHax   File: EntityUtils.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 3
Project: DecompiledMinecraft   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 4
Project: DecompiledMinecraft   File: EntitySkeleton.java   View source code 6 votes vote down vote up
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();
    }
}
 
Example 5
Project: DecompiledMinecraft   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 6
Project: DecompiledMinecraft   File: EntitySkeleton.java   View source code 6 votes vote down vote up
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();
    }
}
 
Example 7
Project: BaseClient   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 8
Project: BaseClient   File: EntitySkeleton.java   View source code 6 votes vote down vote up
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();
    }
}
 
Example 9
Project: BaseClient   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 10
Project: BaseClient   File: EntitySkeleton.java   View source code 6 votes vote down vote up
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();
    }
}
 
Example 11
Project: connor41-etfuturum2   File: EntityRabbit.java   View source code 6 votes vote down vote up
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);
}
 
Example 12
Project: connor41-etfuturum2   File: ServerEventHandler.java   View source code 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 13
Project: SerenityCE   File: KillAura.java   View source code 6 votes vote down vote up
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;
}
 
Example 14
Project: uniquecrops   File: ItemEnderSnooker.java   View source code 6 votes vote down vote up
@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);
}
 
Example 15
Project: Backmemed   File: BiomeForest.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 16
Project: Backmemed   File: BiomeTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 17
Project: Backmemed   File: LayerWolfCollar.java   View source code 6 votes vote down vote up
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);
    }
}
 
Example 18
Project: CustomWorldGen   File: BiomeForest.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 19
Project: CustomWorldGen   File: BiomeTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 20
Project: Overlord   File: EntityArmyMember.java   View source code 6 votes vote down vote up
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;
}
 
Example 21
Project: CrystalMod   File: WolfAccessories.java   View source code 6 votes vote down vote up
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);
           }
       }
}
 
Example 22
Project: CrystalMod   File: WolfAccessories.java   View source code 6 votes vote down vote up
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;
}
 
Example 23
Project: CrystalMod   File: LayerWolfAccessories.java   View source code 6 votes vote down vote up
@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();
	}
}
 
Example 24
Project: MidgarCrusade   File: BiomRoofedForest.java   View source code 6 votes vote down vote up
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;
  }
 
Example 25
Project: MidgarCrusade   File: BiomMagicForest.java   View source code 6 votes vote down vote up
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;
  }
 
Example 26
Project: Gravestone-mod-Extended   File: EntityZombieDog.java   View source code 6 votes vote down vote up
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));
    }
}
 
Example 27
Project: Gravestone-mod-Extended   File: EntityZombieCat.java   View source code 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 28
Project: Gravestone-mod-Extended   File: CorpseHelper.java   View source code 6 votes vote down vote up
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;
}
 
Example 29
Project: wolfarmor   File: WolfArmorGuiHandler.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 30
Project: wolfarmor   File: WolfArmorGuiHandler.java   View source code 6 votes vote down vote up
/**
 * 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;
}
 
Example 31
Project: BeeBarker   File: EventHandlerServer.java   View source code 6 votes vote down vote up
@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));
            }
        }
    }
}
 
Example 32
Project: Et-Futurum   File: EntityRabbit.java   View source code 6 votes vote down vote up
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);
}
 
Example 33
Project: Et-Futurum   File: ServerEventHandler.java   View source code 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 34
Project: Resilience-Client-Source   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 35
Project: Resilience-Client-Source   File: RenderWolf.java   View source code 6 votes vote down vote up
/**
 * 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;
    }
}
 
Example 36
Project: RidiculousWorld   File: BiomeGenSpooky.java   View source code 6 votes vote down vote up
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;
}
 
Example 37
Project: Sophisticated-wolves   File: RenderSophisticatedWolf.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 38
Project: Sophisticated-wolves   File: RenderSophisticatedWolf.java   View source code 6 votes vote down vote up
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;
    }
}
 
Example 39
Project: Sophisticated-wolves   File: CompatibilityWolfArmor.java   View source code 6 votes vote down vote up
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;
    }
 
Example 40
Project: Cauldron   File: BiomeGenTaiga.java   View source code 6 votes vote down vote up
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;
    }
}