mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-07-07 04:55:17 +00:00
- Added cooldown to AirScooter (same cd as firejet by default)
This commit is contained in:
parent
94cc849767
commit
329b01f3aa
|
@ -20,6 +20,7 @@ public class AirScooter extends AirAbility {
|
||||||
private double speed;
|
private double speed;
|
||||||
private double interval;
|
private double interval;
|
||||||
private double radius;
|
private double radius;
|
||||||
|
private long cooldown;
|
||||||
private double maxHeightFromGround;
|
private double maxHeightFromGround;
|
||||||
private Block floorblock;
|
private Block floorblock;
|
||||||
private Random random;
|
private Random random;
|
||||||
|
@ -30,18 +31,21 @@ public class AirScooter extends AirAbility {
|
||||||
|
|
||||||
public AirScooter(Player player) {
|
public AirScooter(Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
if (check(player)) {
|
|
||||||
|
if (check(player))
|
||||||
return;
|
return;
|
||||||
} else if (!player.isSprinting() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|
else if (!player.isSprinting() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|
||||||
|| player.getEyeLocation().getBlock().isLiquid()) {
|
|| player.getEyeLocation().getBlock().isLiquid())
|
||||||
return;
|
return;
|
||||||
} else if (GeneralMethods.isSolid(player.getLocation().add(0, -.5, 0).getBlock())) {
|
else if (GeneralMethods.isSolid(player.getLocation().add(0, -.5, 0).getBlock()))
|
||||||
|
return;
|
||||||
|
else if (bPlayer.isOnCooldown(this))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
this.speed = getConfig().getDouble("Abilities.Air.AirScooter.Speed");
|
this.speed = getConfig().getDouble("Abilities.Air.AirScooter.Speed");
|
||||||
this.interval = getConfig().getDouble("Abilities.Air.AirScooter.Interval");
|
this.interval = getConfig().getDouble("Abilities.Air.AirScooter.Interval");
|
||||||
this.radius = getConfig().getDouble("Abilities.Air.AirScooter.Radius");
|
this.radius = getConfig().getDouble("Abilities.Air.AirScooter.Radius");
|
||||||
|
this.cooldown = getConfig().getLong("Abilities.Air.AirScooter.Cooldown");
|
||||||
this.maxHeightFromGround = getConfig().getDouble("Abilities.Air.AirScooter.MaxHeightFromGround");
|
this.maxHeightFromGround = getConfig().getDouble("Abilities.Air.AirScooter.MaxHeightFromGround");
|
||||||
this.random = new Random();
|
this.random = new Random();
|
||||||
this.angles = new ArrayList<>();
|
this.angles = new ArrayList<>();
|
||||||
|
@ -138,6 +142,7 @@ public class AirScooter extends AirAbility {
|
||||||
@Override
|
@Override
|
||||||
public void remove() {
|
public void remove() {
|
||||||
super.remove();
|
super.remove();
|
||||||
|
bPlayer.addCooldown(this);
|
||||||
player.setAllowFlight(canFly);
|
player.setAllowFlight(canFly);
|
||||||
player.setFlying(hadFly);
|
player.setFlying(hadFly);
|
||||||
}
|
}
|
||||||
|
@ -169,7 +174,7 @@ public class AirScooter extends AirAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getCooldown() {
|
public long getCooldown() {
|
||||||
return 0;
|
return cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -222,4 +227,8 @@ public class AirScooter extends AirAbility {
|
||||||
public void setFloorblock(Block floorblock) {
|
public void setFloorblock(Block floorblock) {
|
||||||
this.floorblock = floorblock;
|
this.floorblock = floorblock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCooldown(long cooldown) {
|
||||||
|
this.cooldown = cooldown;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,6 +284,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Air.AirScooter.Speed", 0.675);
|
config.addDefault("Abilities.Air.AirScooter.Speed", 0.675);
|
||||||
config.addDefault("Abilities.Air.AirScooter.Interval", 100);
|
config.addDefault("Abilities.Air.AirScooter.Interval", 100);
|
||||||
config.addDefault("Abilities.Air.AirScooter.Radius", 1);
|
config.addDefault("Abilities.Air.AirScooter.Radius", 1);
|
||||||
|
config.addDefault("Abilities.Air.AirScooter.Cooldown", 7000);
|
||||||
config.addDefault("Abilities.Air.AirScooter.MaxHeightFromGround", 7);
|
config.addDefault("Abilities.Air.AirScooter.MaxHeightFromGround", 7);
|
||||||
|
|
||||||
config.addDefault("Abilities.Air.Tornado.Enabled", true);
|
config.addDefault("Abilities.Air.Tornado.Enabled", true);
|
||||||
|
|
Loading…
Reference in a new issue