Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package doggytalents.talent;
- import java.util.Iterator;
- import java.util.List;
- import doggytalents.api.inferface.ITalent;
- import doggytalents.entity.EntityDog;
- import doggytalents.lib.Constants;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.monster.EntitySilverfish;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.SoundEvents;
- import net.minecraft.potion.PotionEffect;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.math.AxisAlignedBB;
- import net.minecraft.util.math.MathHelper;
- public class RoaringGale extends ITalent{
- int cooldown2;
- @Override
- public void onLivingUpdate(EntityDog dog) {
- int level = dog.talents.getLevel(this);
- int masterOrder = dog.masterOrder();
- if (masterOrder == 4 && dog.getHealth() > Constants.lowHealthLevel && !dog.isChild()) {
- if (level >= 0) {
- byte damage = (byte) level;
- if (level == 5) {
- damage = 10;
- }
- if (dog.getEntityWorld().isRemote) {
- if (this.cooldown2 > 0) {
- this.cooldown2--;
- // System.out.println(this.cooldown2);
- }
- }
- List<EntityMob> list = dog.world.<EntityMob>getEntitiesWithinAABB(EntityMob.class, dog.getEntityBoundingBox().grow(level * 4, 4D, level * 4).expand(0.0D, (double)dog.world.getHeight(), 0.0D));
- //List list = dog.world.getEntitiesWithinAABB(EntityMob.class, dog.getEntityBoundingBox().grow(level * 3, 4D, level * 3));
- //Iterator iterator = list.iterator();
- if(!list.isEmpty()) {
- for(EntityMob mob : list) {
- if (cooldown2 <= 0) {
- dog.playSound(SoundEvents.ENTITY_WOLF_GROWL, 1f, 1f);
- mob.spawnExplosionParticle();
- int knockback = level;
- mob.attackEntityFrom(DamageSource.GENERIC, damage);
- mob.addVelocity(-MathHelper.sin(mob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F, 0.1D, MathHelper.cos(mob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F);
- cooldown2 = level == 5 ? 20 : 50;
- }
- }
- }
- /*while (iterator.hasNext()) {
- EntityMob entityMob = (EntityMob) iterator.next();
- if (dog.getRNG().nextInt(20) == 0) {
- if (cooldown2 <= 0) {
- dog.playSound(SoundEvents.ENTITY_WOLF_GROWL, 1f, 1f);
- entityMob.spawnExplosionParticle();
- int knockback = level;
- entityMob.attackEntityFrom(DamageSource.GENERIC, damage);
- entityMob.addVelocity(-MathHelper.sin(entityMob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F, 0.1D, MathHelper.cos(entityMob.rotationYaw * (float) Math.PI / 180.0F) * knockback * 0.5F);
- cooldown2 = level == 5 ? 20 : 50;
- }
- }
- }*/
- }
- }
- }
- @Override
- public String getKey() {
- return "roaringgale";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement