mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Updated BlockAbilities method to handle more abilities
This commit is contained in:
parent
7a77387a2a
commit
df8fd3dae7
1 changed files with 23 additions and 5 deletions
|
@ -77,6 +77,7 @@ import com.projectkorra.ProjectKorra.Utilities.ParticleEffect;
|
|||
import com.projectkorra.ProjectKorra.airbending.AirBlast;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirBubble;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirBurst;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirCombo;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirScooter;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirShield;
|
||||
import com.projectkorra.ProjectKorra.airbending.AirSpout;
|
||||
|
@ -100,6 +101,7 @@ import com.projectkorra.ProjectKorra.firebending.Combustion;
|
|||
import com.projectkorra.ProjectKorra.firebending.Cook;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBlast;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBurst;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireCombo;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireJet;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireShield;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireStream;
|
||||
|
@ -2132,16 +2134,14 @@ public class Methods {
|
|||
return cap;
|
||||
}
|
||||
|
||||
public static boolean blockAbilities(Player player, List<String> abilitiesToBlock, Location loc, double radius)
|
||||
{
|
||||
public static boolean blockAbilities(Player player, List<String> abilitiesToBlock, Location loc, double radius) {
|
||||
/**
|
||||
* Cycles through a list of ability names to check if any instances of
|
||||
* the abilities exist at a specific location. If an instance of the ability is
|
||||
* found then it will be removed, with the exception FireShield, and AirShield.
|
||||
*/
|
||||
boolean hasBlocked = false;
|
||||
for(String ability : abilitiesToBlock)
|
||||
{
|
||||
for(String ability : abilitiesToBlock){
|
||||
if(ability.equalsIgnoreCase("FireBlast")){
|
||||
hasBlocked = FireBlast.annihilateBlasts(loc, radius, player) || hasBlocked;
|
||||
}
|
||||
|
@ -2169,10 +2169,28 @@ public class Methods {
|
|||
else if(ability.equalsIgnoreCase("AirSpout")){
|
||||
hasBlocked = AirSpout.removeSpouts(loc, radius, player) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("Twister")){
|
||||
hasBlocked = AirCombo.removeAroundPoint(player, "Twister", loc, radius) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("AirStream")){
|
||||
hasBlocked = AirCombo.removeAroundPoint(player, "AirStream", loc, radius) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("AirSweep")){
|
||||
hasBlocked = AirCombo.removeAroundPoint(player, "AirSweep", loc, radius) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("FireKick")){
|
||||
hasBlocked = FireCombo.removeAroundPoint(player, "FireKick", loc, radius) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("FireSpin")){
|
||||
hasBlocked = FireCombo.removeAroundPoint(player, "FireSpin", loc, radius) || hasBlocked;
|
||||
}
|
||||
else if(ability.equalsIgnoreCase("FireWheel")){
|
||||
hasBlocked = FireCombo.removeAroundPoint(player, "FireWheel", loc, radius) || hasBlocked;
|
||||
}
|
||||
}
|
||||
return hasBlocked;
|
||||
}
|
||||
public static boolean isWithinShields(Location loc){
|
||||
public static boolean isWithinShields(Location loc) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("FireShield");
|
||||
list.add("AirShield");
|
||||
|
|
Loading…
Reference in a new issue