Java Code Examples for net.minecraft.entity.IRangedAttackMob

The following are top voted examples for showing how to use net.minecraft.entity.IRangedAttackMob. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: DecompiledMinecraft   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.field_96562_i = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 2
Project: DecompiledMinecraft   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.field_96562_i = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 3
Project: BaseClient   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.field_96562_i = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 4
Project: BaseClient   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.field_96562_i = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 5
Project: Backmemed   File: EntityAIAttackRanged.java   Source Code and License 6 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.attackIntervalMin = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.attackRadius = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 6
Project: CustomWorldGen   File: EntityAIAttackRanged.java   Source Code and License 6 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.attackIntervalMin = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.attackRadius = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 7
Project: 4Space-5   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6)
{
    this.rangedAttackTime = -1;

    if (!(par1IRangedAttackMob instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = par1IRangedAttackMob;
        this.entityHost = (EntityLiving) par1IRangedAttackMob;
        this.entityMoveSpeed = par2;
        this.field_96561_g = par4;
        this.maxRangedAttackTime = par5;
        this.field_96562_i = par6;
        this.field_82642_h = par6 * par6;
        this.setMutexBits(3);
    }
}
 
Example 8
Project: Coding   File: EntityAISpearAttack.java   Source Code and License 6 votes vote down vote up
public EntityAISpearAttack(IRangedAttackMob entityAttacker, double targetSpeed, int p_i1650_4_, 
		int attackWaitTime, float p_i1650_6_) {
    this.rangedAttackTime = -1;

    if (!(entityAttacker instanceof EntityLivingBase)) {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else {
        this.rangedAttackEntityHost = entityAttacker;
        this.entityHost = (EntityLiving)entityAttacker;
        this.entityMoveSpeed = targetSpeed;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = attackWaitTime;
        this.field_96562_i = p_i1650_6_;
        this.field_82642_h = p_i1650_6_ * p_i1650_6_;
        this.setMutexBits(3);
    }
}
 
Example 9
Project: Herdcraft   File: EntityAIHerdArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIHerdArrowAttack(IRangedAttackMob host, double moveSpeed, int minRangedAttackTime, int maxRangedAttackTime, float attackRange, int cautionAngle, boolean clockwise, boolean interuptableByRange)
{
    this.rangedAttackTime = -1;

    if (!(host instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = host;
        this.entityHost = (EntityLiving)host;
        this.entityMoveSpeed = moveSpeed;
        this.minRangedAttackTime = minRangedAttackTime;
        this.maxRangedAttackTime = maxRangedAttackTime;
        this.attackRange = attackRange;
        this.attackRangeSquared = attackRange * attackRange;
        this.cautionAngle = cautionAngle;
        this.clockwise = clockwise;
        this.interuptableByRange = interuptableByRange;
        this.setMutexBits(3);
    }
}
 
Example 10
Project: Resilience-Client-Source   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6)
{
    this.rangedAttackTime = -1;

    if (!(par1IRangedAttackMob instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = par1IRangedAttackMob;
        this.entityHost = (EntityLiving)par1IRangedAttackMob;
        this.entityMoveSpeed = par2;
        this.field_96561_g = par4;
        this.maxRangedAttackTime = par5;
        this.field_96562_i = par6;
        this.field_82642_h = par6 * par6;
        this.setMutexBits(3);
    }
}
 
Example 11
Project: ZeroQuest   File: EntityAICustomArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAICustomArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_)
{
    this.rangedAttackTime = -1;

    if (!(p_i1650_1_ instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = p_i1650_1_;
        this.entityHost = (EntityLiving)p_i1650_1_;
        this.entityMoveSpeed = p_i1650_2_;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = p_i1650_5_;
        this.field_96562_i = p_i1650_6_;
        this.field_82642_h = p_i1650_6_ * p_i1650_6_;
        this.setMutexBits(8);
    }
}
 
Example 12
Project: ZeroQuest   File: EntityAIIceAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIIceAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_) {
	this.rangedAttackTime = -1;

	if (!(p_i1650_1_ instanceof EntityLivingBase)) {
		throw new IllegalArgumentException("IceAttackGoal requires Mob implements RangedAttackMob");
	}
	else {
		this.rangedAttackEntityHost = p_i1650_1_;
		this.entityHost = (EntityZertumEntity) p_i1650_1_;
		this.entityMoveSpeed = p_i1650_2_;
		this.field_96561_g = p_i1650_4_;
		this.maxRangedAttackTime = p_i1650_5_;
		this.field_96562_i = p_i1650_6_;
		this.maxAttackDistance = p_i1650_6_ * p_i1650_6_;
		this.setMutexBits(4);
	}
}
 
Example 13
Project: ExpandedRailsMod   File: EntityAIAttackRanged.java   Source Code and License 6 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int p_i1650_4_, int maxAttackTime, float maxAttackDistanceIn)
{
    this.rangedAttackTime = -1;

    if (!(attacker instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = attacker;
        this.entityHost = (EntityLiving)attacker;
        this.entityMoveSpeed = movespeed;
        this.attackIntervalMin = p_i1650_4_;
        this.maxRangedAttackTime = maxAttackTime;
        this.attackRadius = maxAttackDistanceIn;
        this.maxAttackDistance = maxAttackDistanceIn * maxAttackDistanceIn;
        this.setMutexBits(3);
    }
}
 
Example 14
Project: Cauldron   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_)
{
    this.rangedAttackTime = -1;

    if (!(p_i1650_1_ instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = p_i1650_1_;
        this.entityHost = (EntityLiving)p_i1650_1_;
        this.entityMoveSpeed = p_i1650_2_;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = p_i1650_5_;
        this.field_96562_i = p_i1650_6_;
        this.field_82642_h = p_i1650_6_ * p_i1650_6_;
        this.setMutexBits(3);
    }
}
 
Example 15
Project: Cauldron   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_)
{
    this.rangedAttackTime = -1;

    if (!(p_i1650_1_ instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = p_i1650_1_;
        this.entityHost = (EntityLiving)p_i1650_1_;
        this.entityMoveSpeed = p_i1650_2_;
        this.field_96561_g = p_i1650_4_;
        this.maxRangedAttackTime = p_i1650_5_;
        this.field_96562_i = p_i1650_6_;
        this.field_82642_h = p_i1650_6_ * p_i1650_6_;
        this.setMutexBits(3);
    }
}
 
Example 16
Project: RuneCraftery   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6)
{
    this.rangedAttackTime = -1;

    if (!(par1IRangedAttackMob instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = par1IRangedAttackMob;
        this.entityHost = (EntityLiving)par1IRangedAttackMob;
        this.entityMoveSpeed = par2;
        this.field_96561_g = par4;
        this.maxRangedAttackTime = par5;
        this.field_96562_i = par6;
        this.field_82642_h = par6 * par6;
        this.setMutexBits(3);
    }
}
 
Example 17
Project: IceAndShadow2   File: EntityAINyxRangedAttack.java   Source Code and License 6 votes vote down vote up
public EntityAINyxRangedAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6,
		boolean los) {
	rangedAttackTime = -1;

	if (!(par1IRangedAttackMob instanceof EntityLivingBase))
		throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
	else {
		rangedAttackEntityHost = par1IRangedAttackMob;
		entityHost = (EntityLiving) par1IRangedAttackMob;
		entityMoveSpeed = par2;
		minRangedAttackTime = par4;
		maxRangedAttackTime = par5;
		range = par6;
		rangeSq = par6 * par6;
		reqLOS = los;
		setMutexBits(3);
	}
}
 
Example 18
Project: BetterNutritionMod   File: EntityAIArrowAttack.java   Source Code and License 6 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6)
{
    this.rangedAttackTime = -1;

    if (!(par1IRangedAttackMob instanceof EntityLivingBase))
    {
        throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
    }
    else
    {
        this.rangedAttackEntityHost = par1IRangedAttackMob;
        this.entityHost = (EntityLiving)par1IRangedAttackMob;
        this.entityMoveSpeed = par2;
        this.field_96561_g = par4;
        this.maxRangedAttackTime = par5;
        this.field_96562_i = par6;
        this.field_82642_h = par6 * par6;
        this.setMutexBits(3);
    }
}
 
Example 19
Project: MobBlocker   File: TileEntityChunkProtector.java   Source Code and License 5 votes vote down vote up
/**
 * Destroys skeleton arrows in the protected area
 * Checks whether the arrow was shot by a class deriving from IRangedAttackMob
 * Sets the arrow on fire for visual effect by default
 * An arrow already on fire is killed
 * The effect of this is that the arrow, for one tick, is engulfed in flame, as it looks strange to have the arrow disappear for no reason
 * @param chunkBounds AxisAlignedBB in which block should act
 */
private void killArrows(AxisAlignedBB chunkBounds) {
	List<EntityArrow> list =  world.getEntitiesWithinAABB(EntityArrow.class, chunkBounds);
	for (EntityArrow arrow : list) {
		if (arrow.shootingEntity instanceof IRangedAttackMob) {
			if (arrow.isBurning()) {
				arrow.setDead();
			} else {
				arrow.setFire(1);
				arrow.addVelocity(-arrow.motionX, 0, -arrow.motionZ);
			}
		}
	}
}
 
Example 20
Project: MobBlocker   File: TileEntityAreaProtector.java   Source Code and License 5 votes vote down vote up
/**
 * Destroys skeleton arrows in the protected area
 * Checks whether the arrow was shot by a class deriving from IRangedAttackMob
 * Sets the arrow on fire for visual effect by default
 * An arrow already on fire is killed
 * The effect of this is that the arrow, for one tick, is engulfed in flame, as it looks strange to have the arrow disappear for no reason
 * @param areaBounds AxisAlignedBB in which block should act
 */
private void killArrows(AxisAlignedBB areaBounds) {
	List<EntityArrow> list =  world.getEntitiesWithinAABB(EntityArrow.class, areaBounds);
	for (EntityArrow arrow : list) {
		if (arrow.shootingEntity instanceof IRangedAttackMob) {
			if (arrow.isBurning()) {
				arrow.setDead();
			} else {
				arrow.setFire(1);
				arrow.addVelocity(-arrow.motionX, 0, -arrow.motionZ);
			}
		}
	}
}
 
Example 21
Project: RuneCraftery   File: EntityAIArrowAttack.java   Source Code and License 5 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_) {
   this.field_75320_d = -1;
   if(!(p_i1650_1_ instanceof EntityLivingBase)) {
      throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
   } else {
      this.field_82641_b = p_i1650_1_;
      this.field_75322_b = (EntityLiving)p_i1650_1_;
      this.field_75321_e = p_i1650_2_;
      this.field_96561_g = p_i1650_4_;
      this.field_75325_h = p_i1650_5_;
      this.field_96562_i = p_i1650_6_;
      this.field_82642_h = p_i1650_6_ * p_i1650_6_;
      this.func_75248_a(3);
   }
}
 
Example 22
Project: EnderZoo   File: EntityAIRangedAttack.java   Source Code and License 5 votes vote down vote up
public EntityAIRangedAttack(IRangedAttackMob host, double moveSpeed, int minTimeBetweenAttacks, int maxTimeBetweenAttacks, float range) {
  timeUntilNextAttack = -1;

  rangedAttackEntityHost = host;
  entityHost = (EntityLiving) host;
  entityMoveSpeed = moveSpeed;
  minRangedAttackTime = minTimeBetweenAttacks;
  maxRangedAttackTime = maxTimeBetweenAttacks;
  attackRange = range;
  attackRangeSq = attackRange * attackRange;
  setMutexBits(3);
}
 
Example 23
Project: EnderZoo   File: EntityAIMountedArrowAttack.java   Source Code and License 5 votes vote down vote up
public EntityAIMountedArrowAttack(IRangedAttackMob host, double moveSpeed, double mountedEntityMoveSpeed, int minAttackTime, int maxAttackTime,
    float attackRange, boolean useRunAwayTactic) {
  timeUntilNextAttack = -1;
  rangedAttackEntityHost = host;
  entityHost = (EntityLiving) host;
  entityMoveSpeed = moveSpeed;
  this.mountedEntityMoveSpeed = mountedEntityMoveSpeed;
  minRangedAttackTime = minAttackTime;
  maxRangedAttackTime = maxAttackTime;
  this.attackRange = attackRange;
  attackRangeSq = attackRange * attackRange;
  this.useRunAwayTactic = useRunAwayTactic;
  setMutexBits(3);
}
 
Example 24
Project: ProgressiveDifficulty   File: AddDamageModifier.java   Source Code and License 4 votes vote down vote up
@Override
public boolean validForEntity(EntityLiving entity) {
    return !(entity instanceof IRangedAttackMob);
}
 
Example 25
Project: Infernum   File: EntityAIAttackRangedWitherBolt.java   Source Code and License 4 votes vote down vote up
public void updateTask() {
	EntityLivingBase entitylivingbase = this.entity.getAttackTarget();

	if (entitylivingbase != null) {
		double d0 = this.entity.getDistanceSq(entitylivingbase.posX, entitylivingbase.getEntityBoundingBox().minY,
				entitylivingbase.posZ);
		boolean flag = this.entity.getEntitySenses().canSee(entitylivingbase);
		boolean flag1 = this.seeTime > 0;

		if (flag != flag1) {
			this.seeTime = 0;
		}

		if (flag) {
			++this.seeTime;
		} else {
			--this.seeTime;
		}

		if (d0 <= (double) this.maxAttackDistance && this.seeTime >= 20) {
			this.entity.getNavigator().clearPathEntity();
			++this.strafingTime;
		} else {
			this.entity.getNavigator().tryMoveToEntityLiving(entitylivingbase, this.moveSpeedAmp);
			this.strafingTime = -1;
		}

		if (this.strafingTime >= 20) {
			if ((double) this.entity.getRNG().nextFloat() < 0.3D) {
				this.strafingClockwise = !this.strafingClockwise;
			}

			if ((double) this.entity.getRNG().nextFloat() < 0.3D) {
				this.strafingBackwards = !this.strafingBackwards;
			}

			this.strafingTime = 0;
		}

		if (this.strafingTime > -1) {
			if (d0 > (double) (this.maxAttackDistance * 0.75F)) {
				this.strafingBackwards = false;
			} else if (d0 < (double) (this.maxAttackDistance * 0.25F)) {
				this.strafingBackwards = true;
			}

			this.entity.getMoveHelper().strafe(this.strafingBackwards ? -0.5F : 0.5F,
					this.strafingClockwise ? 0.5F : -0.5F);
			this.entity.faceEntity(entitylivingbase, 30.0F, 30.0F);
		} else {
			this.entity.getLookHelper().setLookPositionWithEntity(entitylivingbase, 30.0F, 30.0F);
		}
		
		if (attackTime >= 0) {
			if (this.entity instanceof EntityPigZombieMage) {
				((EntityPigZombieMage) this.entity).chargeAnimation();
			}
		}

		if (this.entity.isHandActive()) {
			if (!flag && this.seeTime < -60) {
				this.entity.resetActiveHand();
			} else if (flag) {

				if (this.entity instanceof IRangedAttackMob) {
					this.entity.resetActiveHand();
					((IRangedAttackMob) this.entity).attackEntityWithRangedAttack(entitylivingbase, 0.5F);

					this.attackTime = this.attackCooldown;
				}
			}
		} else if (--this.attackTime <= 0 && this.seeTime >= -60) {
			this.entity.setActiveHand(EnumHand.MAIN_HAND);
		}
	}
}
 
Example 26
Project: DecompiledMinecraft   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1649_4_, float p_i1649_5_)
{
    this(attacker, movespeed, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 27
Project: DecompiledMinecraft   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1649_4_, float p_i1649_5_)
{
    this(attacker, movespeed, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 28
Project: BaseClient   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1649_4_, float p_i1649_5_)
{
    this(attacker, movespeed, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 29
Project: BaseClient   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob attacker, double movespeed, int p_i1649_4_, float p_i1649_5_)
{
    this(attacker, movespeed, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 30
Project: Backmemed   File: EntityAIAttackRanged.java   Source Code and License 4 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int maxAttackTime, float maxAttackDistanceIn)
{
    this(attacker, movespeed, maxAttackTime, maxAttackTime, maxAttackDistanceIn);
}
 
Example 31
Project: CustomWorldGen   File: EntityAIAttackRanged.java   Source Code and License 4 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int maxAttackTime, float maxAttackDistanceIn)
{
    this(attacker, movespeed, maxAttackTime, maxAttackTime, maxAttackDistanceIn);
}
 
Example 32
Project: 4Space-5   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5)
{
    this(par1IRangedAttackMob, par2, par4, par4, par5);
}
 
Example 33
Project: Coding   File: EntityAISpearAttack.java   Source Code and License 4 votes vote down vote up
public EntityAISpearAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_)
{
    this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 34
Project: Herdcraft   File: EntityAIHerdArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIHerdArrowAttack(IRangedAttackMob host, double moveSpeed, int rangedAttackTime, float attackRange, int cautionAngle, boolean clockwise, boolean interuptableByRange)
{
    this(host, moveSpeed, rangedAttackTime, rangedAttackTime, attackRange, cautionAngle, clockwise, interuptableByRange);
}
 
Example 35
Project: Resilience-Client-Source   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5)
{
    this(par1IRangedAttackMob, par2, par4, par4, par5);
}
 
Example 36
Project: CustomAI   File: EntityAIVanillaWorker.java   Source Code and License 4 votes vote down vote up
@Override
public boolean isSuitableForEntity(EntityLiving entity, Class<? extends EntityAIBase> c)
{
    if(c == EntityAICreeperSwell.class && !(entity instanceof EntityCreeper))
        return false;
    else if(c == EntityAIAvoidEntity.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIAttackOnCollide.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIWander.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAINearestAttackableTarget.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIHurtByTarget.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIArrowAttack.class && !(entity instanceof IRangedAttackMob))
        return false;
    else if(c == EntityAIBeg.class && !(entity instanceof EntityWolf))
        return false;
    else if(c == EntityAIDefendVillage.class && !(entity instanceof EntityIronGolem))
        return false;
    else if(c == EntityAIFleeSun.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIFollowGolem.class && !(entity instanceof EntityVillager))
        return false;
    else if(c == EntityAIFollowOwner.class && !(entity instanceof EntityTameable))
        return false;
    else if(c == EntityAIFollowParent.class && !(entity instanceof EntityAnimal))
        return false;
    else if(c == EntityAILookAtTradePlayer.class && !(entity instanceof EntityVillager))
        return false;
    else if(c == EntityAILookAtVillager.class && !(entity instanceof EntityIronGolem))
        return false;
    else if(c == EntityAIMate.class && !(entity instanceof EntityAnimal))
        return false;
    else if(c == EntityAIPanic.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAITempt.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIMoveIndoors.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIMoveThroughVillage.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIOcelotSit.class && !(entity instanceof EntityOcelot))
        return false;
    else if(c == EntityAIPlay.class && !(entity instanceof EntityVillager))
        return false;
    else if(c == EntityAIRestrictOpenDoor.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIRestrictSun.class && !(entity instanceof EntityCreature))
        return false;
    else if(c == EntityAIRunAroundLikeCrazy.class && !(entity instanceof EntityHorse))
        return false;
    else if(c == EntityAISit.class && !(entity instanceof EntityTameable))
        return false;
    else if(c == EntityAITargetNonTamed.class && !(entity instanceof EntityTameable))
        return false;
    else if(c == EntityAITradePlayer.class && !(entity instanceof EntityVillager))
        return false;
    else if(c == EntityAIVillagerMate.class && !(entity instanceof EntityVillager))
        return false;
    else if(c == EntityAIOwnerHurtTarget.class && !(entity instanceof EntityTameable))
        return false;
    else if(c == EntityAIOwnerHurtByTarget.class && !(entity instanceof EntityTameable))
        return false;
    return true;
}
 
Example 37
Project: ZeroQuest   File: EntityAICustomArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAICustomArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_)
{
    this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 38
Project: ZeroQuest   File: EntityAIIceAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIIceAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_) {
	this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 39
Project: ExpandedRailsMod   File: EntityAIAttackRanged.java   Source Code and License 4 votes vote down vote up
public EntityAIAttackRanged(IRangedAttackMob attacker, double movespeed, int maxAttackTime, float maxAttackDistanceIn)
{
    this(attacker, movespeed, maxAttackTime, maxAttackTime, maxAttackDistanceIn);
}
 
Example 40
Project: Cauldron   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_)
{
    this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 41
Project: Cauldron   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_)
{
    this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 42
Project: RuneCraftery   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_) {
   this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
}
 
Example 43
Project: RuneCraftery   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5)
{
    this(par1IRangedAttackMob, par2, par4, par4, par5);
}
 
Example 44
Project: IceAndShadow2   File: EntityAINyxRangedAttack.java   Source Code and License 4 votes vote down vote up
public EntityAINyxRangedAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5) {
	this(par1IRangedAttackMob, par2, par4, par4, par5);
}
 
Example 45
Project: IceAndShadow2   File: EntityAINyxRangedAttack.java   Source Code and License 4 votes vote down vote up
public EntityAINyxRangedAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6) {
	this(par1IRangedAttackMob, par2, par4, par5, par6, true);
}
 
Example 46
Project: IceAndShadow2   File: NyxItemBowFrostShort.java   Source Code and License 4 votes vote down vote up
@Override
public EntityAIBase getEntityUseTask(EntityLivingBase user) {
	return new EntityAINyxRangedAttack((IRangedAttackMob) user, user.getAIMoveSpeed(), 25, 35, 24.0F);
}
 
Example 47
Project: IceAndShadow2   File: NyxItemBowFrostLong.java   Source Code and License 4 votes vote down vote up
@Override
public EntityAIBase getEntityUseTask(EntityLivingBase user) {
	return new EntityAINyxRangedAttack((IRangedAttackMob) user, user.getAIMoveSpeed(), 25, 35, 24.0F);
}
 
Example 48
Project: EnderZoo   File: EntityAIRangedAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIRangedAttack(IRangedAttackMob host, double moveSpeed, int timeBetweenAttacks, float attackRange) {
  this(host, moveSpeed, timeBetweenAttacks, timeBetweenAttacks, attackRange);
}
 
Example 49
Project: BetterNutritionMod   File: EntityAIArrowAttack.java   Source Code and License 4 votes vote down vote up
public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5)
{
    this(par1IRangedAttackMob, par2, par4, par4, par5);
}
 
Example 50
Project: Sojourn   File: MobEventHandler.java   Source Code and License 4 votes vote down vote up
public int getDifficultyValue(World world, EntityLivingBase entityLiving)
{
    int difficulty = 0;
    int armorLevel = 0;
    int weaponLevel = 0;
    int groupSize = 0;
    float meleeRangedRatio = 0F;
    
    int worldScaleDifficulty = world.difficultySetting;
    
    int numPlayers = 0;
    int numMobs = 0;
    
    List<Entity> entities = world.loadedEntityList;
    for (Entity ent : entities)
    {
        if(ent.getDistance(entityLiving.posX, entityLiving.posY, entityLiving.posZ) > 128)
            continue;
        if (ent instanceof EntityPlayer)
        {
            armorLevel *= numPlayers;
            weaponLevel *= numPlayers;
            Group group = GroupManager.groups().getGroupFromPlayer(((EntityPlayer) ent).username);
            if (group != null)
            {
                if (group.getSize() > groupSize)
                    groupSize = group.getSize();
            }
            int tempWepValue = 0;
            for(ItemStack item : ((EntityPlayer) ent).inventory.mainInventory)
            {
                if (item != null && item.getMaxDamage() > tempWepValue)
                    tempWepValue = item.getMaxDamage();
            }
            armorLevel += ((EntityPlayer) ent).inventory.getTotalArmorValue();
            weaponLevel += tempWepValue;
            numPlayers++;
            armorLevel /= numPlayers;
            weaponLevel /= numPlayers;
        }
        else if (ent instanceof EntityMob)
        {
            meleeRangedRatio *= numMobs;
            
            if (ent instanceof IRangedAttackMob)
            {
                meleeRangedRatio += 1;
            }
            else
            {
                meleeRangedRatio -= 1;
            }
            
            meleeRangedRatio /= numMobs++;
        }
    }
    
    
    if (accountForArmor)
        difficulty += armorLevel * armorScale;
    if (accountForWeapons)
        difficulty += weaponLevel * weaponScale;
    if (accountForDifficulty)
    {
        if (!harderHardMode)
            worldScaleDifficulty /= 2;
        difficulty += worldScaleDifficulty;
    }
    difficulty += groupSize;
    return difficulty;
}