add config option for gliding firejet, and make default false and change airscooter sitting default to false

This commit is contained in:
PhanaticD 2019-01-18 22:29:20 -05:00
parent 11227a981a
commit 593d3225ff
3 changed files with 15 additions and 7 deletions

View file

@ -1672,9 +1672,10 @@ public class PKListener implements Listener {
return;
}
}
if (CoreAbility.getAbility(player, FireJet.class) != null) {
event.setCancelled(true);
if (ConfigManager.getConfig().getBoolean("Abilities.Fire.FireJet.ShowGliding")) {
if (CoreAbility.getAbility(player, FireJet.class) != null) {
event.setCancelled(true);
}
}
}

View file

@ -817,7 +817,7 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirBurst.AngleTheta", 10);
config.addDefault("Abilities.Air.AirScooter.Enabled", true);
config.addDefault("Abilities.Air.AirScooter.ShowSitting", true);
config.addDefault("Abilities.Air.AirScooter.ShowSitting", false);
config.addDefault("Abilities.Air.AirScooter.Speed", 0.675);
config.addDefault("Abilities.Air.AirScooter.Interval", 100);
config.addDefault("Abilities.Air.AirScooter.Radius", 1);
@ -1363,6 +1363,7 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireJet.Speed", 0.8);
config.addDefault("Abilities.Fire.FireJet.Duration", 2000);
config.addDefault("Abilities.Fire.FireJet.Cooldown", 7000);
config.addDefault("Abilities.Fire.FireJet.ShowGliding", false);
config.addDefault("Abilities.Fire.FireManipulation.Enabled", false);

View file

@ -28,6 +28,7 @@ public class FireJet extends FireAbility {
private double speed;
private Random random;
private Boolean previousGlidingState;
private Boolean showGliding;
public FireJet(final Player player) {
super(player);
@ -49,6 +50,7 @@ public class FireJet extends FireAbility {
this.duration = getConfig().getLong("Abilities.Fire.FireJet.Duration");
this.speed = getConfig().getDouble("Abilities.Fire.FireJet.Speed");
this.cooldown = getConfig().getLong("Abilities.Fire.FireJet.Cooldown");
this.showGliding = getConfig().getBoolean("Abilities.Fire.FireJet.ShowGliding");
this.random = new Random();
this.speed = this.getDayFactor(this.speed);
@ -80,8 +82,10 @@ public class FireJet extends FireAbility {
this.time = System.currentTimeMillis();
this.start();
previousGlidingState = player.isGliding();
player.setGliding(true);
if (showGliding) {
previousGlidingState = player.isGliding();
player.setGliding(true);
}
this.bPlayer.addCooldown(this);
}
}
@ -118,7 +122,9 @@ public class FireJet extends FireAbility {
@Override
public void remove() {
super.remove();
this.player.setGliding(previousGlidingState);
if (showGliding) {
this.player.setGliding(previousGlidingState);
}
flightHandler.removeInstance(this.player, this.getName());
this.player.setFallDistance(0);
}