mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-22 16:05:01 +00:00
Various config options (#1076)
## Additions * Added a configurable AirSweep hit radius called "Radius" with a default of 1 * Added a configurable option to enable/disable WaterArms bound messages that are independent of the BendingPreview option, called "DisplayBoundMsg" under the WaterArms config, with a default of false * Added a configurable option to allow/prohibit FastSwim while WaterArms is in use, called "AllowWaterArms" under the FastSwim config, with a default of false
This commit is contained in:
parent
2d27c3cbbe
commit
c4f60e4e69
4 changed files with 19 additions and 4 deletions
|
@ -1583,9 +1583,12 @@ public class PKListener implements Listener {
|
||||||
public void onPlayerSlotChange(final PlayerItemHeldEvent event) {
|
public void onPlayerSlotChange(final PlayerItemHeldEvent event) {
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final int slot = event.getNewSlot() + 1;
|
final int slot = event.getNewSlot() + 1;
|
||||||
GeneralMethods.displayMovePreview(player, slot);
|
|
||||||
|
|
||||||
if (!ConfigManager.defaultConfig.get().getBoolean("Properties.BendingPreview")) {
|
if (ConfigManager.defaultConfig.get().getBoolean("Properties.BendingPreview")) {
|
||||||
|
GeneralMethods.displayMovePreview(player, slot);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ConfigManager.defaultConfig.get().getBoolean("Abilities.Water.WaterArms.DisplayBoundMsg")) {
|
||||||
final WaterArms waterArms = CoreAbility.getAbility(player, WaterArms.class);
|
final WaterArms waterArms = CoreAbility.getAbility(player, WaterArms.class);
|
||||||
if (waterArms != null) {
|
if (waterArms != null) {
|
||||||
waterArms.displayBoundMsg(event.getNewSlot() + 1);
|
waterArms.displayBoundMsg(event.getNewSlot() + 1);
|
||||||
|
|
|
@ -42,6 +42,7 @@ public class AirSweep extends AirAbility implements ComboAbility {
|
||||||
private Vector direction;
|
private Vector direction;
|
||||||
private ArrayList<Entity> affectedEntities;
|
private ArrayList<Entity> affectedEntities;
|
||||||
private ArrayList<BukkitRunnable> tasks;
|
private ArrayList<BukkitRunnable> tasks;
|
||||||
|
private double radius;
|
||||||
|
|
||||||
public AirSweep(final Player player) {
|
public AirSweep(final Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
|
@ -62,6 +63,7 @@ public class AirSweep extends AirAbility implements ComboAbility {
|
||||||
this.speed = getConfig().getDouble("Abilities.Air.AirSweep.Speed");
|
this.speed = getConfig().getDouble("Abilities.Air.AirSweep.Speed");
|
||||||
this.knockback = getConfig().getDouble("Abilities.Air.AirSweep.Knockback");
|
this.knockback = getConfig().getDouble("Abilities.Air.AirSweep.Knockback");
|
||||||
this.cooldown = getConfig().getLong("Abilities.Air.AirSweep.Cooldown");
|
this.cooldown = getConfig().getLong("Abilities.Air.AirSweep.Cooldown");
|
||||||
|
this.radius = getConfig().getDouble("Abilities.Air.AirSweep.Radius");
|
||||||
|
|
||||||
if (this.bPlayer.isAvatarState()) {
|
if (this.bPlayer.isAvatarState()) {
|
||||||
this.cooldown = 0;
|
this.cooldown = 0;
|
||||||
|
@ -188,7 +190,7 @@ public class AirSweep extends AirAbility implements ComboAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i % 3 == 0) {
|
if (i % 3 == 0) {
|
||||||
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(loc, 2.5)) {
|
for (final Entity entity : GeneralMethods.getEntitiesAroundPoint(loc, radius)) {
|
||||||
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) {
|
if (GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) {
|
||||||
this.remove();
|
this.remove();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -943,11 +943,13 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Air.AirSweep.Damage", 3);
|
config.addDefault("Abilities.Air.AirSweep.Damage", 3);
|
||||||
config.addDefault("Abilities.Air.AirSweep.Knockback", 3.5);
|
config.addDefault("Abilities.Air.AirSweep.Knockback", 3.5);
|
||||||
config.addDefault("Abilities.Air.AirSweep.Cooldown", 6000);
|
config.addDefault("Abilities.Air.AirSweep.Cooldown", 6000);
|
||||||
|
config.addDefault("Abilities.Air.AirSweep.Radius", 1);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.Passive.FastSwim.Enabled", true);
|
config.addDefault("Abilities.Water.Passive.FastSwim.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.Passive.FastSwim.Cooldown", 0);
|
config.addDefault("Abilities.Water.Passive.FastSwim.Cooldown", 0);
|
||||||
config.addDefault("Abilities.Water.Passive.FastSwim.Duration", 0);
|
config.addDefault("Abilities.Water.Passive.FastSwim.Duration", 0);
|
||||||
config.addDefault("Abilities.Water.Passive.FastSwim.SpeedFactor", 0.7);
|
config.addDefault("Abilities.Water.Passive.FastSwim.SpeedFactor", 0.7);
|
||||||
|
config.addDefault("Abilities.Water.Passive.FastSwim.AllowWaterArms", false);
|
||||||
config.addDefault("Abilities.Water.Passive.Hydrosink.Enabled", true);
|
config.addDefault("Abilities.Water.Passive.Hydrosink.Enabled", true);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.Bloodbending.Enabled", true);
|
config.addDefault("Abilities.Water.Bloodbending.Enabled", true);
|
||||||
|
@ -1071,6 +1073,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.Plantbending.RegrowTime", 180000);
|
config.addDefault("Abilities.Water.Plantbending.RegrowTime", 180000);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.WaterArms.Enabled", true);
|
config.addDefault("Abilities.Water.WaterArms.Enabled", true);
|
||||||
|
config.addDefault("Abilities.Water.WaterArms.DisplayBoundMsg", false);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.WaterArms.Arms.InitialLength", 4);
|
config.addDefault("Abilities.Water.WaterArms.Arms.InitialLength", 4);
|
||||||
config.addDefault("Abilities.Water.WaterArms.Arms.SourceGrabRange", 12);
|
config.addDefault("Abilities.Water.WaterArms.Arms.SourceGrabRange", 12);
|
||||||
|
|
|
@ -16,6 +16,7 @@ public class FastSwim extends WaterAbility implements PassiveAbility {
|
||||||
private long cooldown;
|
private long cooldown;
|
||||||
private double swimSpeed;
|
private double swimSpeed;
|
||||||
private long duration;
|
private long duration;
|
||||||
|
private boolean allowWaterArms;
|
||||||
|
|
||||||
public FastSwim(final Player player) {
|
public FastSwim(final Player player) {
|
||||||
super(player);
|
super(player);
|
||||||
|
@ -30,13 +31,19 @@ public class FastSwim extends WaterAbility implements PassiveAbility {
|
||||||
this.cooldown = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Cooldown");
|
this.cooldown = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Cooldown");
|
||||||
this.swimSpeed = ConfigManager.getConfig().getDouble("Abilities.Water.Passive.FastSwim.SpeedFactor");
|
this.swimSpeed = ConfigManager.getConfig().getDouble("Abilities.Water.Passive.FastSwim.SpeedFactor");
|
||||||
this.duration = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Duration");
|
this.duration = ConfigManager.getConfig().getLong("Abilities.Water.Passive.FastSwim.Duration");
|
||||||
|
this.allowWaterArms = ConfigManager.getConfig().getBoolean("Abilities.Water.Passive.FastSwim.AllowWaterArms");
|
||||||
|
|
||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void progress() {
|
public void progress() {
|
||||||
if (!this.bPlayer.canUsePassive(this) || !this.bPlayer.canBendPassive(this) || CoreAbility.hasAbility(this.player, WaterSpout.class) || CoreAbility.hasAbility(this.player, EarthArmor.class) || CoreAbility.hasAbility(this.player, WaterArms.class)) {
|
if (!this.bPlayer.canUsePassive(this) || !this.bPlayer.canBendPassive(this) || CoreAbility.hasAbility(this.player, WaterSpout.class) || CoreAbility.hasAbility(this.player, EarthArmor.class)) {
|
||||||
|
this.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CoreAbility.hasAbility(this.player, WaterArms.class) && !this.allowWaterArms) {
|
||||||
this.remove();
|
this.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue