mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
restore previous behavior for airsuction where you could only affect yourself if a origin cloud was set
This commit is contained in:
parent
1f72980dc8
commit
551de94f7e
1 changed files with 10 additions and 0 deletions
|
@ -45,6 +45,7 @@ public class AirSuction extends AirAbility {
|
||||||
private Location location;
|
private Location location;
|
||||||
private Location origin;
|
private Location origin;
|
||||||
private Vector direction;
|
private Vector direction;
|
||||||
|
private boolean canAffectSelf;
|
||||||
|
|
||||||
public AirSuction(final Player player) {
|
public AirSuction(final Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
|
@ -78,6 +79,7 @@ public class AirSuction extends AirAbility {
|
||||||
this.cooldown = getConfig().getLong("Abilities.Air.AirSuction.Cooldown");
|
this.cooldown = getConfig().getLong("Abilities.Air.AirSuction.Cooldown");
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
this.origin = getTargetLocation();
|
this.origin = getTargetLocation();
|
||||||
|
this.canAffectSelf = true;
|
||||||
|
|
||||||
if (GeneralMethods.isRegionProtectedFromBuild(player, this.getName(), origin)) {
|
if (GeneralMethods.isRegionProtectedFromBuild(player, this.getName(), origin)) {
|
||||||
return;
|
return;
|
||||||
|
@ -195,6 +197,9 @@ public class AirSuction extends AirAbility {
|
||||||
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || ((entity instanceof Player) && Commands.invincible.contains(((Player) entity).getName()))){
|
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation()) || ((entity instanceof Player) && Commands.invincible.contains(((Player) entity).getName()))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if((entity.getEntityId() == player.getEntityId()) && !canAffectSelf){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
final Vector velocity = entity.getVelocity();
|
final Vector velocity = entity.getVelocity();
|
||||||
final double max = this.speed;
|
final double max = this.speed;
|
||||||
final Vector push = this.direction.clone();
|
final Vector push = this.direction.clone();
|
||||||
|
@ -269,6 +274,7 @@ public class AirSuction extends AirAbility {
|
||||||
} else {
|
} else {
|
||||||
suc = new AirSuction(player);
|
suc = new AirSuction(player);
|
||||||
suc.setOrigin(player.getEyeLocation().clone());
|
suc.setOrigin(player.getEyeLocation().clone());
|
||||||
|
suc.setCanEffectSelf(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (suc.getOrigin() != null) {
|
if (suc.getOrigin() != null) {
|
||||||
|
@ -393,6 +399,10 @@ public class AirSuction extends AirAbility {
|
||||||
this.cooldown = cooldown;
|
this.cooldown = cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCanEffectSelf(final boolean affect) {
|
||||||
|
this.canAffectSelf = affect;
|
||||||
|
}
|
||||||
|
|
||||||
public static int getSelectParticles() {
|
public static int getSelectParticles() {
|
||||||
return getConfig().getInt("Abilities.Air.AirSuction.SelectParticles");
|
return getConfig().getInt("Abilities.Air.AirSuction.SelectParticles");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue