fix cooldown for fireshield not applying

This commit is contained in:
PhanaticD 2019-01-20 04:14:54 -05:00
parent fa8b051121
commit e4df313132

View file

@ -1,7 +1,11 @@
package com.projectkorra.projectkorra.firebending;
import java.util.Random;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.ParticleEffect;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -12,12 +16,7 @@ import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.Collision;
import com.projectkorra.projectkorra.attribute.Attribute;
import com.projectkorra.projectkorra.firebending.util.FireDamageTimer;
import com.projectkorra.projectkorra.util.ParticleEffect;
import java.util.Random;
public class FireShield extends FireAbility {
@ -103,12 +102,15 @@ public class FireShield extends FireAbility {
@Override
public void progress() {
if (!this.bPlayer.canBendIgnoreCooldowns(this)) {
this.bPlayer.addCooldown(this);
this.remove();
return;
} else if ((!this.player.isSneaking() && this.shield) || (System.currentTimeMillis() > this.getStartTime() + this.shieldDuration && this.shield && this.shieldDuration > 0)) {
this.bPlayer.addCooldown(this);
this.remove();
return;
} else if (System.currentTimeMillis() > this.getStartTime() + this.discDuration && !this.shield) {
this.bPlayer.addCooldown(this);
this.remove();
return;
}