-
-
Save anonymous/58da0ba1e86b42987bab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(event.source.isProjectile()){ | |
Entity strikingArrow = event.source.getSourceOfDamage(); | |
{ | |
if(enchant.allowSlowAoe||enchant.allowPoisonAoe||enchant.allowWitherAOE){ | |
if(Utils.getEnchHelp(player,Enchantments.slowAoe.effectId,player.getHeldItem()) != 0 || (Utils.getEnchHelp(player,Enchantments.poisonAoe.effectId,player.getHeldItem()) != 0|| (Utils.getEnchHelp(player,Enchantments.witherAoe.effectId,player.getHeldItem()) != 0))) | |
{ | |
int level = 0; | |
float splashDamage = event.ammount * (level * 0.13F); | |
AxisAlignedBB boundBox = AxisAlignedBB.getBoundingBox(strikingArrow.posX-3, strikingArrow.posY-3, strikingArrow.posZ-3, strikingArrow.posX+3, strikingArrow.posY+3, strikingArrow.posZ+3); | |
ArrayList<Entity> targetEntities = new ArrayList<Entity>(strikingArrow.worldObj.getEntitiesWithinAABBExcludingEntity(event.entity, boundBox)); | |
ListIterator<Entity> itr = targetEntities.listIterator(); | |
while(itr.hasNext()) | |
{ | |
Entity target = itr.next(); | |
if(target instanceof EntityLivingBase) | |
{ | |
if(enchant.allowSlowAoe){ | |
if(Utils.getEnchHelp(player,Enchantments.slowAoe.effectId,player.getHeldItem()) != 0) | |
{ | |
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, (Enchantments.slowAOETimer*20), Utils.getEnchHelp(player,Enchantments.slowAoe.effectId,player.getHeldItem()))); | |
target.attackEntityFrom(DamageSource.magic, splashDamage); | |
} | |
} | |
if(enchant.allowPoisonAoe){ | |
if(Utils.getEnchHelp(player,Enchantments.poisonAoe.effectId,player.getHeldItem()) != 0) | |
{ | |
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.poison.id, (Enchantments.poisonAOETimer*20), Utils.getEnchHelp(player,Enchantments.poisonAoe.effectId,player.getHeldItem()))); | |
target.attackEntityFrom(DamageSource.magic, splashDamage); | |
} | |
} | |
if(enchant.allowWitherAOE){ | |
if(Utils.getEnchHelp(player,Enchantments.witherAoe.effectId,player.getHeldItem()) != 0) | |
{ | |
((EntityLivingBase)target).addPotionEffect(new PotionEffect(Potion.wither.id, (Enchantments.witherAOETimer *20), Utils.getEnchHelp(player,Enchantments.witherAoe.effectId,player.getHeldItem()))); | |
target.attackEntityFrom(DamageSource.magic, splashDamage); | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment