Rename to getLivingWithinRadius for clarity
This commit is contained in:
@@ -38,7 +38,7 @@ public class EntityBlizzard extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -25,7 +25,7 @@ public class EntityCombustionRune extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(width/2, posX, posY, posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(width/2, posX, posY, posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class EntityDecay extends EntityMagicConstruct {
|
||||
0.6F + rand.nextFloat() * 0.15F);
|
||||
|
||||
if(!this.world.isRemote){
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(1.0d, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(1.0d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
for(EntityLivingBase target : targets){
|
||||
if(target != this.getCaster()){
|
||||
|
||||
@@ -63,7 +63,7 @@ public class EntityEarthquake extends EntityMagicConstruct {
|
||||
}
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils
|
||||
.getEntitiesWithinRadius((this.ticksExisted * speed) + 1.5, this.posX, this.posY, this.posZ, world);
|
||||
.getLivingWithinRadius((this.ticksExisted * speed) + 1.5, this.posX, this.posY, this.posZ, world);
|
||||
|
||||
// In this particular instance, the caster is completely unaffected because they will always be in the
|
||||
// centre.
|
||||
|
||||
@@ -32,7 +32,7 @@ public class EntityFireRing extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(2.5d, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(2.5d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -29,7 +29,7 @@ public class EntityFireSigil extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(width/2, posX, posY, posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(width/2, posX, posY, posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class EntityFrostSigil extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(1.0d, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(1.0d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -105,7 +105,7 @@ public class EntityHammer extends EntityMagicConstruct {
|
||||
|
||||
double seekerRange = Spells.lightning_hammer.getProperty(Spell.EFFECT_RADIUS).doubleValue();
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(seekerRange, this.posX,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(seekerRange, this.posX,
|
||||
this.posY + 1, this.posZ, world);
|
||||
|
||||
int maxTargets = Spells.lightning_hammer.getProperty(LightningHammer.SECONDARY_MAX_TARGETS).intValue();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class EntityHealAura extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(2.5, posX, posY, posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(2.5, posX, posY, posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class EntityLightningSigil extends EntityMagicConstruct {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(1.0d, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(1.0d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
@@ -60,7 +60,7 @@ public class EntityLightningSigil extends EntityMagicConstruct {
|
||||
// Secondary chaining effect
|
||||
double seekerRange = Spells.lightning_sigil.getProperty(Spell.EFFECT_RADIUS).doubleValue();
|
||||
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getEntitiesWithinRadius(seekerRange,
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getLivingWithinRadius(seekerRange,
|
||||
target.posX, target.posY + target.height / 2, target.posZ, world);
|
||||
|
||||
for(int j = 0; j < Math.min(secondaryTargets.size(),
|
||||
|
||||
@@ -72,7 +72,7 @@ public class EntityTornado extends EntityMagicConstruct {
|
||||
|
||||
if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -69,7 +69,7 @@ public class EntityFirebomb extends EntityBomb {
|
||||
|
||||
double range = Spells.firebomb.getProperty(Spell.BLAST_RADIUS).floatValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(range, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(range, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -53,7 +53,7 @@ public class EntityForceOrb extends EntityBomb {
|
||||
|
||||
double blastRadius = Spells.force_orb.getProperty(Spell.BLAST_RADIUS).floatValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(blastRadius, this.posX,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(blastRadius, this.posX,
|
||||
this.posY, this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -72,7 +72,7 @@ public class EntityIceCharge extends EntityBomb {
|
||||
|
||||
double radius = Spells.ice_charge.getProperty(Spell.EFFECT_RADIUS).floatValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
// Slows targets
|
||||
|
||||
@@ -74,7 +74,7 @@ public class EntityPoisonBomb extends EntityBomb {
|
||||
|
||||
double range = Spells.poison_bomb.getProperty(Spell.EFFECT_RADIUS).floatValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(range, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(range, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EntitySmokeBomb extends EntityBomb {
|
||||
|
||||
double range = Spells.smoke_bomb.getProperty(Spell.BLAST_RADIUS).floatValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(range, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(range, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
int duration = Spells.smoke_bomb.getProperty(Spell.EFFECT_DURATION).intValue();
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EntitySparkBomb extends EntityBomb {
|
||||
|
||||
double seekerRange = Spells.spark_bomb.getProperty(Spell.EFFECT_RADIUS).doubleValue() * blastMultiplier;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(seekerRange, this.posX, this.posY,
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(seekerRange, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
for(int i = 0; i < Math.min(targets.size(), Spells.spark_bomb.getProperty(SECONDARY_MAX_TARGETS).intValue()); i++){
|
||||
|
||||
@@ -480,7 +480,7 @@ public class ItemArtefact extends Item {
|
||||
// Spell properties allow all three of the above spells to be dealt with the same way - neat!
|
||||
float healthGained = event.getSpell().getProperty(Spell.HEALTH).floatValue() * event.getModifiers().get(SpellModifiers.POTENCY);
|
||||
|
||||
List<EntityLivingBase> nearby = EntityUtils.getEntitiesWithinRadius(4, player.posX, player.posY, player.posZ, event.getWorld());
|
||||
List<EntityLivingBase> nearby = EntityUtils.getLivingWithinRadius(4, player.posX, player.posY, player.posZ, event.getWorld());
|
||||
|
||||
for(EntityLivingBase entity : nearby){
|
||||
if(AllyDesignationSystem.isAllied(player, entity) && entity.getHealth() > 0 && entity.getHealth() < entity.getMaxHealth()){
|
||||
@@ -656,7 +656,7 @@ public class ItemArtefact extends Item {
|
||||
if(EntityUtils.isMeleeDamage(event.getSource()) && mainhandItem.getItem() instanceof ItemWand
|
||||
&& ((ItemWand)mainhandItem.getItem()).element == Element.LIGHTNING){
|
||||
|
||||
EntityUtils.getEntitiesWithinRadius(3, player.posX, player.posY, player.posZ, world).stream()
|
||||
EntityUtils.getLivingWithinRadius(3, player.posX, player.posY, player.posZ, world).stream()
|
||||
.filter(EntityUtils::isLiving)
|
||||
.filter(e -> e != player)
|
||||
.min(Comparator.comparingDouble(player::getDistanceSq))
|
||||
|
||||
@@ -195,7 +195,7 @@ public class ItemLightningHammer extends Item implements IConjuredItem {
|
||||
|
||||
if(attackStrength == 1){ // Only chains when the attack meter is full
|
||||
|
||||
List<EntityLivingBase> nearby = EntityUtils.getEntitiesWithinRadius(CHAINING_RANGE, hit.posX, hit.posY, hit.posZ, hit.world);
|
||||
List<EntityLivingBase> nearby = EntityUtils.getLivingWithinRadius(CHAINING_RANGE, hit.posX, hit.posY, hit.posZ, hit.world);
|
||||
|
||||
nearby.remove(hit);
|
||||
nearby.remove(wielder);
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ChainLightning extends SpellRay {
|
||||
* modifiers.get(SpellModifiers.POTENCY));
|
||||
|
||||
// Secondary chaining effect
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(SECONDARY_RANGE).doubleValue(), target.posX, target.posY + target.height / 2, target.posZ, world);
|
||||
|
||||
secondaryTargets.remove(target);
|
||||
@@ -62,7 +62,7 @@ public class ChainLightning extends SpellRay {
|
||||
|
||||
// Tertiary chaining effect
|
||||
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(TERTIARY_RANGE).doubleValue(), secondaryTarget.posX,
|
||||
secondaryTarget.posY + secondaryTarget.height / 2, secondaryTarget.posZ, world);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Detonate extends SpellRay {
|
||||
|
||||
if(!world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(getProperty(BLAST_RADIUS).doubleValue()
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(getProperty(BLAST_RADIUS).doubleValue()
|
||||
* modifiers.get(WizardryItems.blast_upgrade), pos.getX(), pos.getY(), pos.getZ(), world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -23,7 +23,7 @@ public class GroupHeal extends Spell {
|
||||
|
||||
boolean flag = false;
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(getProperty(EFFECT_RADIUS).floatValue()
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(getProperty(EFFECT_RADIUS).floatValue()
|
||||
* modifiers.get(WizardryItems.blast_upgrade), caster.posX, caster.posY, caster.posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -39,7 +39,7 @@ public class IceAge extends Spell {
|
||||
|
||||
float radius = getProperty(EFFECT_RADIUS).floatValue() * modifiers.get(WizardryItems.blast_upgrade);
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
if(AllyDesignationSystem.isValidTarget(caster, target)){
|
||||
|
||||
@@ -38,7 +38,7 @@ public class LightningPulse extends Spell {
|
||||
|
||||
if(caster.onGround){
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(EFFECT_RADIUS).floatValue() * modifiers.get(WizardryItems.blast_upgrade),
|
||||
caster.posX, caster.posY, caster.posZ, world);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class LightningWeb extends SpellRay {
|
||||
|
||||
// Secondary chaining effect
|
||||
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(SECONDARY_RANGE).floatValue(), target.posX, target.posY + target.height / 2,
|
||||
target.posZ, world);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class LightningWeb extends SpellRay {
|
||||
|
||||
// Tertiary chaining effect
|
||||
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(TERTIARY_RANGE).floatValue(), secondaryTarget.posX,
|
||||
secondaryTarget.posY + secondaryTarget.height / 2, secondaryTarget.posZ, world);
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public class MindControl extends SpellRay {
|
||||
// As of 1.1, this now uses the creature's follow range, like normal targeting. It also
|
||||
// no longer lasts until the creature dies; instead it is a potion effect which continues to
|
||||
// set the target until it wears off.
|
||||
List<EntityLivingBase> possibleTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> possibleTargets = EntityUtils.getLivingWithinRadius(
|
||||
target.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).getAttributeValue(),
|
||||
target.posX, target.posY, target.posZ, world);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class PlagueOfDarkness extends Spell {
|
||||
|
||||
double radius = getProperty(EFFECT_RADIUS).floatValue() * modifiers.get(WizardryItems.blast_upgrade);
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
if(AllyDesignationSystem.isValidTarget(caster, target)
|
||||
@@ -75,8 +75,7 @@ public class PlagueOfDarkness extends Spell {
|
||||
.clr(0.8f, 0, 0.05f)
|
||||
.spawn(world);
|
||||
}
|
||||
|
||||
caster.swingArm(hand);
|
||||
|
||||
this.playSound(world, caster, ticksInUse, -1, modifiers);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class Shockwave extends Spell {
|
||||
|
||||
double radius = getProperty(BLAST_RADIUS).floatValue() * modifiers.get(WizardryItems.blast_upgrade);
|
||||
|
||||
List<EntityLivingBase> targets = EntityUtils.getEntitiesWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
List<EntityLivingBase> targets = EntityUtils.getLivingWithinRadius(radius, caster.posX, caster.posY, caster.posZ, world);
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ShulkerBullet extends Spell {
|
||||
|
||||
double range = getProperty(RANGE).floatValue() * modifiers.get(WizardryItems.range_upgrade);
|
||||
|
||||
List<EntityLivingBase> possibleTargets = EntityUtils.getEntitiesWithinRadius(range, x, y, z, world);
|
||||
List<EntityLivingBase> possibleTargets = EntityUtils.getLivingWithinRadius(range, x, y, z, world);
|
||||
|
||||
possibleTargets.remove(caster);
|
||||
possibleTargets.removeIf(t -> t instanceof EntityArmorStand);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class Thunderstorm extends Spell {
|
||||
// entityNBT.setInteger("summoningPlayer", entityplayer.entityId);
|
||||
|
||||
// Secondary chaining effect
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> secondaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(SECONDARY_RANGE).doubleValue(), x, y + 1, z, world);
|
||||
|
||||
for(int j = 0; j < Math.min(secondaryTargets.size(), getProperty(SECONDARY_MAX_TARGETS).intValue()); j++){
|
||||
@@ -102,7 +102,7 @@ public class Thunderstorm extends Spell {
|
||||
|
||||
// Tertiary chaining effect
|
||||
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getEntitiesWithinRadius(
|
||||
List<EntityLivingBase> tertiaryTargets = EntityUtils.getLivingWithinRadius(
|
||||
getProperty(TERTIARY_RANGE).doubleValue(), secondaryTarget.posX,
|
||||
secondaryTarget.posY + secondaryTarget.height / 2, secondaryTarget.posZ, world);
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public final class EntityUtils {
|
||||
* @param z The z coordinate to search around
|
||||
* @param world The world to search in
|
||||
*/
|
||||
public static List<EntityLivingBase> getEntitiesWithinRadius(double radius, double x, double y, double z, World world){
|
||||
public static List<EntityLivingBase> getLivingWithinRadius(double radius, double x, double y, double z, World world){
|
||||
return getEntitiesWithinRadius(radius, x, y, z, world, EntityLivingBase.class);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public final class EntityUtils {
|
||||
* this does not exclude any entities; if any specific entities are to be excluded this must be checked when
|
||||
* iterating through the list.
|
||||
*
|
||||
* @see EntityUtils#getEntitiesWithinRadius(double, double, double, double, World)
|
||||
* @see EntityUtils#getLivingWithinRadius(double, double, double, double, World)
|
||||
* @param radius The search radius
|
||||
* @param x The x coordinate to search around
|
||||
* @param y The y coordinate to search around
|
||||
|
||||
Reference in New Issue
Block a user