mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Some abilities can block Combustion
AirShield, AirSwipe, EarthBlast, FireShield, WaterManipulation
This commit is contained in:
parent
5344b0ad8f
commit
9b8060f3ae
|
@ -12,6 +12,7 @@ import org.bukkit.util.Vector;
|
|||
import com.projectkorra.ProjectKorra.Methods;
|
||||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||
import com.projectkorra.ProjectKorra.Ability.AvatarState;
|
||||
import com.projectkorra.ProjectKorra.firebending.Combustion;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBlast;
|
||||
|
||||
public class AirShield {
|
||||
|
@ -51,6 +52,7 @@ public class AirShield {
|
|||
Location origin = player.getLocation();
|
||||
|
||||
FireBlast.removeFireBlastsAroundPoint(origin, radius);
|
||||
Combustion.removeAroundPoint(origin, radius);
|
||||
|
||||
for (Entity entity : Methods.getEntitiesAroundPoint(origin, radius)) {
|
||||
if (Methods.isRegionProtectedFromBuild(player, "AirShield",
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.projectkorra.ProjectKorra.Methods;
|
|||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||
import com.projectkorra.ProjectKorra.Ability.AvatarState;
|
||||
import com.projectkorra.ProjectKorra.earthbending.EarthBlast;
|
||||
import com.projectkorra.ProjectKorra.firebending.Combustion;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBlast;
|
||||
import com.projectkorra.ProjectKorra.firebending.Illumination;
|
||||
import com.projectkorra.ProjectKorra.waterbending.WaterManipulation;
|
||||
|
@ -194,6 +195,8 @@ public class AirSwipe {
|
|||
damage = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
Combustion.removeAroundPoint(location, radius);
|
||||
|
||||
Block block = location.getBlock();
|
||||
for (Block testblock : Methods.getBlocksAroundPoint(location, affectingradius)) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.bukkit.util.Vector;
|
|||
|
||||
import com.projectkorra.ProjectKorra.Methods;
|
||||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||
import com.projectkorra.ProjectKorra.firebending.Combustion;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBlast;
|
||||
import com.projectkorra.ProjectKorra.waterbending.WaterManipulation;
|
||||
|
||||
|
@ -353,6 +354,8 @@ public class EarthBlast {
|
|||
breakBlock();
|
||||
return false;
|
||||
}
|
||||
|
||||
Combustion.removeAroundPoint(location, radius);
|
||||
|
||||
Block block2 = location.getBlock();
|
||||
if (block2.getLocation().equals(sourceblock.getLocation())) {
|
||||
|
|
|
@ -180,6 +180,15 @@ public class Combustion {
|
|||
ParticleEffect.FLAME.display(location, (float) Math.random(), (float) Math.random(), (float) Math.random(), 0, 2);
|
||||
location = location.add(direction.clone().multiply(speedfactor));
|
||||
}
|
||||
|
||||
public static void removeAroundPoint(Location loc, double radius) {
|
||||
for (Player player: instances.keySet()) {
|
||||
Combustion combustion = instances.get(player);
|
||||
if (combustion.location.distance(loc) <= radius) {
|
||||
instances.remove(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void progressAll() {
|
||||
for (Player player: instances.keySet()) {
|
||||
|
|
|
@ -164,6 +164,7 @@ public class FireShield {
|
|||
WaterManipulation.removeAroundPoint(location, discradius);
|
||||
EarthBlast.removeAroundPoint(location, discradius);
|
||||
FireStream.removeAroundPoint(location, discradius);
|
||||
Combustion.removeAroundPoint(location, discradius);
|
||||
for (Entity entity: Methods.getEntitiesAroundPoint(location, discradius)) {
|
||||
if (entity instanceof Projectile) {
|
||||
entity.remove();
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.projectkorra.ProjectKorra.ProjectKorra;
|
|||
import com.projectkorra.ProjectKorra.TempBlock;
|
||||
import com.projectkorra.ProjectKorra.Ability.AvatarState;
|
||||
import com.projectkorra.ProjectKorra.earthbending.EarthBlast;
|
||||
import com.projectkorra.ProjectKorra.firebending.Combustion;
|
||||
import com.projectkorra.ProjectKorra.firebending.FireBlast;
|
||||
|
||||
public class WaterManipulation {
|
||||
|
@ -308,6 +309,8 @@ public class WaterManipulation {
|
|||
new WaterReturn(player, sourceblock);
|
||||
return false;
|
||||
}
|
||||
|
||||
Combustion.removeAroundPoint(location, radius);
|
||||
|
||||
location = location.clone().add(direction);
|
||||
|
||||
|
|
Loading…
Reference in a new issue