mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Breathbending Updates
Added a method to free an entity from breathbending, and allowed players to use simple bendings (AirSwipe, WaterManipulation, FireBlast, EarthBlast) even if they are being BreathBent.
This commit is contained in:
parent
15afefe181
commit
13ee8969f3
2 changed files with 21 additions and 7 deletions
|
@ -78,6 +78,7 @@ import com.projectkorra.ProjectKorra.airbending.AirShield;
|
|||
import com.projectkorra.ProjectKorra.airbending.AirSpout;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirSuction;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirSwipe;
|
||||
import com.projectkorra.ProjectKorra.airbending.Breathbending;
|
||||
import com.projectkorra.ProjectKorra.airbending.Tornado;
|
||||
import com.projectkorra.ProjectKorra.chiblocking.Paralyze;
|
||||
import com.projectkorra.ProjectKorra.chiblocking.RapidPunch;
|
||||
|
@ -1837,5 +1838,11 @@ public class Methods {
|
|||
if(effect.equals(PotionEffectType.INVISIBILITY)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void breakBreathbendingHold(Entity entity) {
|
||||
if(Breathbending.isBreathbent(entity)) {
|
||||
Breathbending.breakBreathbend(entity);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -305,8 +305,14 @@ public class PKListener implements Listener {
|
|||
Player player = event.getPlayer();
|
||||
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
if(Breathbending.isBreathbent(player)) {
|
||||
if(!Methods.getBoundAbility(player).equalsIgnoreCase("AirSwipe") || !Methods.getBoundAbility(player).equalsIgnoreCase("FireBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("EarthBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("WaterManipulation")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (Paralyze.isParalyzed(player) || Bloodbending.isBloodbended(player) || Breathbending.isBreathbent(player)) {
|
||||
if (Paralyze.isParalyzed(player) || Bloodbending.isBloodbended(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -622,8 +628,14 @@ public class PKListener implements Listener {
|
|||
if (event.isCancelled()) return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if(Breathbending.isBreathbent(player)) {
|
||||
if(!Methods.getBoundAbility(player).equalsIgnoreCase("AirSwipe") || !Methods.getBoundAbility(player).equalsIgnoreCase("FireBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("EarthBlast") || !Methods.getBoundAbility(player).equalsIgnoreCase("WaterManipulation")) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (Bloodbending.isBloodbended(player) || Paralyze.isParalyzed(player) || Breathbending.isBreathbent(player)) {
|
||||
if (Bloodbending.isBloodbended(player) || Paralyze.isParalyzed(player)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
@ -1005,11 +1017,6 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (Breathbending.isBreathbent(e.getEntity())) {
|
||||
if(e.getCause() == DamageCause.CUSTOM) {
|
||||
Breathbending.breakBreathbend(e.getEntity());
|
||||
}
|
||||
}
|
||||
|
||||
Entity en = e.getEntity();
|
||||
if (en instanceof Player) {
|
||||
|
|
Loading…
Reference in a new issue