mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-19 06:34:56 +00:00
Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'
This commit is contained in:
commit
1a9087e672
30 changed files with 218 additions and 128 deletions
|
@ -81,7 +81,7 @@ public class BendingPlayer {
|
||||||
* @param cooldown The cooldown time
|
* @param cooldown The cooldown time
|
||||||
*/
|
*/
|
||||||
public void addCooldown(String ability, long cooldown) {
|
public void addCooldown(String ability, long cooldown) {
|
||||||
PlayerCooldownChangeEvent event = new PlayerCooldownChangeEvent(Bukkit.getPlayer(uuid), ability, Result.ADDED);
|
PlayerCooldownChangeEvent event = new PlayerCooldownChangeEvent(Bukkit.getPlayer(uuid), ability, cooldown, Result.ADDED);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
this.cooldowns.put(ability, cooldown + System.currentTimeMillis());
|
this.cooldowns.put(ability, cooldown + System.currentTimeMillis());
|
||||||
|
@ -251,7 +251,7 @@ public class BendingPlayer {
|
||||||
* @param ability The ability's cooldown to remove
|
* @param ability The ability's cooldown to remove
|
||||||
*/
|
*/
|
||||||
public void removeCooldown(String ability) {
|
public void removeCooldown(String ability) {
|
||||||
PlayerCooldownChangeEvent event = new PlayerCooldownChangeEvent(Bukkit.getPlayer(uuid), ability, Result.REMOVED);
|
PlayerCooldownChangeEvent event = new PlayerCooldownChangeEvent(Bukkit.getPlayer(uuid), ability, 0, Result.REMOVED);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled()) {
|
||||||
this.cooldowns.remove(ability);
|
this.cooldowns.remove(ability);
|
||||||
|
|
|
@ -103,6 +103,10 @@ public class AirScooter implements ConfigLoadable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean progress() {
|
public boolean progress() {
|
||||||
|
if (player.isDead() || !player.isOnline()) {
|
||||||
|
remove();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
getFloor();
|
getFloor();
|
||||||
// Methods.verbose(player);
|
// Methods.verbose(player);
|
||||||
if (floorblock == null) {
|
if (floorblock == null) {
|
||||||
|
|
|
@ -90,13 +90,17 @@ public class ChiCombo {
|
||||||
for (Entity e : paralyzedEntities.keySet()) {
|
for (Entity e : paralyzedEntities.keySet()) {
|
||||||
if (paralyzedEntities.get(e) <= System.currentTimeMillis()) {
|
if (paralyzedEntities.get(e) <= System.currentTimeMillis()) {
|
||||||
paralyzedEntities.remove(e);
|
paralyzedEntities.remove(e);
|
||||||
|
List<Integer> remove = new ArrayList<Integer>();
|
||||||
for (ChiCombo c : instances) {
|
for (ChiCombo c : instances) {
|
||||||
if (e == null || c.target == null) {
|
if (e == null || c.target == null) {
|
||||||
instances.remove(c);
|
remove.add(instances.indexOf(c));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (c.target.equals(e))
|
if (c.target.equals(e))
|
||||||
instances.remove(c);
|
remove.add(instances.indexOf(c));
|
||||||
|
}
|
||||||
|
for (int i : remove) {
|
||||||
|
instances.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ import com.projectkorra.projectkorra.Element;
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ability.AbilityModuleManager;
|
import com.projectkorra.projectkorra.ability.AbilityModuleManager;
|
||||||
import com.projectkorra.projectkorra.ability.combo.ComboAbilityModule;
|
import com.projectkorra.projectkorra.ability.combo.ComboAbilityModule;
|
||||||
|
import com.projectkorra.projectkorra.ability.combo.ComboManager;
|
||||||
|
import com.projectkorra.projectkorra.ability.combo.ComboManager.ComboAbility;
|
||||||
import com.projectkorra.projectkorra.ability.combo.ComboModuleManager;
|
import com.projectkorra.projectkorra.ability.combo.ComboModuleManager;
|
||||||
import com.projectkorra.projectkorra.object.Preset;
|
import com.projectkorra.projectkorra.object.Preset;
|
||||||
|
|
||||||
|
@ -113,6 +115,11 @@ public class BendingTabComplete implements TabCompleter {
|
||||||
abils.add(abil);
|
abils.add(abil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (ComboAbility abil : ComboManager.comboAbilityList.values()) {
|
||||||
|
if (GeneralMethods.canBind(sender.getName(), abil.getName()) && (abil.getName() != "IceBulletRightClick" && abil.getName() != "IceBulletLeftClick")) {
|
||||||
|
abils.add(abil.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
for (ComboAbilityModule abil : ComboModuleManager.combo) {
|
for (ComboAbilityModule abil : ComboModuleManager.combo) {
|
||||||
if (GeneralMethods.canBind(sender.getName(), abil.getName())) {
|
if (GeneralMethods.canBind(sender.getName(), abil.getName())) {
|
||||||
abils.add(abil.getName());
|
abils.add(abil.getName());
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class WhoCommand extends PKCommand {
|
||||||
List<String> players = new ArrayList<String>();
|
List<String> players = new ArrayList<String>();
|
||||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||||
String playerName = player.getName();
|
String playerName = player.getName();
|
||||||
String result = "";
|
String result = ChatColor.WHITE + playerName;
|
||||||
BendingPlayer bp = GeneralMethods.getBendingPlayer(playerName);
|
BendingPlayer bp = GeneralMethods.getBendingPlayer(playerName);
|
||||||
if (bp == null) {
|
if (bp == null) {
|
||||||
GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName());
|
GeneralMethods.createBendingPlayer(player.getUniqueId(), player.getName());
|
||||||
|
@ -144,6 +144,7 @@ public class WhoCommand extends PKCommand {
|
||||||
//Player player = Bukkit.getPlayer(playerName);
|
//Player player = Bukkit.getPlayer(playerName);
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
final OfflinePlayer player = Bukkit.getOfflinePlayer(playerName);
|
final OfflinePlayer player = Bukkit.getOfflinePlayer(playerName);
|
||||||
|
BendingPlayer bplayer = GeneralMethods.getBendingPlayer(player.getName());
|
||||||
if (player == null || !player.hasPlayedBefore()) {
|
if (player == null || !player.hasPlayedBefore()) {
|
||||||
sender.sendMessage(ChatColor.RED + "Player not found!");
|
sender.sendMessage(ChatColor.RED + "Player not found!");
|
||||||
return;
|
return;
|
||||||
|
@ -185,7 +186,11 @@ public class WhoCommand extends PKCommand {
|
||||||
if (BendingPlayer.getPlayers().containsKey(player.getUniqueId())) {
|
if (BendingPlayer.getPlayers().containsKey(player.getUniqueId())) {
|
||||||
sender.sendMessage(player.getName() + (!player.isOnline() ? ChatColor.RESET + " (Offline)" : "") + " - ");
|
sender.sendMessage(player.getName() + (!player.isOnline() ? ChatColor.RESET + " (Offline)" : "") + " - ");
|
||||||
if (GeneralMethods.isBender(playerName, Element.Air)) {
|
if (GeneralMethods.isBender(playerName, Element.Air)) {
|
||||||
sender.sendMessage(AirMethods.getAirColor() + "- Airbender");
|
if(bplayer.isElementToggled(Element.Air)) {
|
||||||
|
sender.sendMessage(AirMethods.getAirColor() + "- Airbender");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(AirMethods.getAirColor() + "" + ChatColor.STRIKETHROUGH + "- Airbender");
|
||||||
|
}
|
||||||
if (player_ != null && AirMethods.canAirFlight((Player) player)) {
|
if (player_ != null && AirMethods.canAirFlight((Player) player)) {
|
||||||
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Air) + " Can Fly");
|
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Air) + " Can Fly");
|
||||||
}
|
}
|
||||||
|
@ -194,7 +199,11 @@ public class WhoCommand extends PKCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GeneralMethods.isBender(playerName, Element.Water)) {
|
if (GeneralMethods.isBender(playerName, Element.Water)) {
|
||||||
sender.sendMessage(WaterMethods.getWaterColor() + "- Waterbender");
|
if(bplayer.isElementToggled(Element.Water)) {
|
||||||
|
sender.sendMessage(WaterMethods.getWaterColor() + "- Waterbender");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(WaterMethods.getWaterColor() + "" + ChatColor.STRIKETHROUGH + "- Waterbender");
|
||||||
|
}
|
||||||
if (player_ != null && WaterMethods.canPlantbend((Player) player)) {
|
if (player_ != null && WaterMethods.canPlantbend((Player) player)) {
|
||||||
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Water) + " Can Plantbend");
|
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Water) + " Can Plantbend");
|
||||||
}
|
}
|
||||||
|
@ -213,7 +222,11 @@ public class WhoCommand extends PKCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GeneralMethods.isBender(playerName, Element.Earth)) {
|
if (GeneralMethods.isBender(playerName, Element.Earth)) {
|
||||||
sender.sendMessage(EarthMethods.getEarthColor() + "- Earthbender");
|
if(bplayer.isElementToggled(Element.Earth)) {
|
||||||
|
sender.sendMessage(EarthMethods.getEarthColor() + "- Earthbender");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(EarthMethods.getEarthColor() + "" + ChatColor.STRIKETHROUGH + "- Earthbender");
|
||||||
|
}
|
||||||
if (player_ != null && EarthMethods.canMetalbend((Player) player)) {
|
if (player_ != null && EarthMethods.canMetalbend((Player) player)) {
|
||||||
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Earth) + " Can Metalbend");
|
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Earth) + " Can Metalbend");
|
||||||
}
|
}
|
||||||
|
@ -225,7 +238,11 @@ public class WhoCommand extends PKCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GeneralMethods.isBender(playerName, Element.Fire)) {
|
if (GeneralMethods.isBender(playerName, Element.Fire)) {
|
||||||
sender.sendMessage(FireMethods.getFireColor() + "- Firebender");
|
if(bplayer.isElementToggled(Element.Fire)) {
|
||||||
|
sender.sendMessage(FireMethods.getFireColor() + "- Firebender");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(FireMethods.getFireColor() + "" + ChatColor.STRIKETHROUGH + "- Firebender");
|
||||||
|
}
|
||||||
if (player_ != null && FireMethods.canCombustionbend((Player) player)) {
|
if (player_ != null && FireMethods.canCombustionbend((Player) player)) {
|
||||||
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Fire) + " Can Combustionbend");
|
sender.sendMessage(GeneralMethods.getSubBendingColor(Element.Fire) + " Can Combustionbend");
|
||||||
}
|
}
|
||||||
|
@ -234,7 +251,11 @@ public class WhoCommand extends PKCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GeneralMethods.isBender(playerName, Element.Chi)) {
|
if (GeneralMethods.isBender(playerName, Element.Chi)) {
|
||||||
sender.sendMessage(ChiMethods.getChiColor() + "- ChiBlocker");
|
if(bplayer.isElementToggled(Element.Chi)) {
|
||||||
|
sender.sendMessage(ChiMethods.getChiColor() + "- Chiblocker");
|
||||||
|
} else {
|
||||||
|
sender.sendMessage(ChiMethods.getChiColor() + "" + ChatColor.STRIKETHROUGH + "- Chiblocker");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(playerName);
|
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(playerName);
|
||||||
UUID uuid = player.getUniqueId();
|
UUID uuid = player.getUniqueId();
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Air.AirBubble.Radius", 7);
|
config.addDefault("Abilities.Air.AirBubble.Radius", 7);
|
||||||
|
|
||||||
config.addDefault("Abilities.Air.AirBurst.Enabled", true);
|
config.addDefault("Abilities.Air.AirBurst.Enabled", true);
|
||||||
config.addDefault("Abilities.Air.AirBurst.Description", "AirBurst is one of the most powerful abilities in the airbender's arsenal. " + "To use, press and hold sneak to charge your burst. " + "Once charged, you can either release sneak to launch a cone-shaped burst " + "of air in front of you, or click to release the burst in a sphere around you. " + "Additionally, having this ability selected when you land on the ground from a " + "large enough fall will create a burst of air around you.");
|
config.addDefault("Abilities.Air.AirBurst.Description", "AirBurst is one of the most powerful abilities in the airbender's arsenal. " + "To use, press and hold sneak to charge your burst. " + "Once charged, you can either release sneak to release the burst in a sphere around you " + "or click to launch a cone-shaped burst of air in front of you. " + "Additionally, having this ability selected when you land on the ground from a " + "large enough fall will create a burst of air around you.");
|
||||||
config.addDefault("Abilities.Air.AirBurst.FallThreshold", 10);
|
config.addDefault("Abilities.Air.AirBurst.FallThreshold", 10);
|
||||||
config.addDefault("Abilities.Air.AirBurst.PushFactor", 1.5);
|
config.addDefault("Abilities.Air.AirBurst.PushFactor", 1.5);
|
||||||
config.addDefault("Abilities.Air.AirBurst.ChargeTime", 1750);
|
config.addDefault("Abilities.Air.AirBurst.ChargeTime", 1750);
|
||||||
|
@ -359,9 +359,6 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.IceSpike.Projectile.Range", 20);
|
config.addDefault("Abilities.Water.IceSpike.Projectile.Range", 20);
|
||||||
config.addDefault("Abilities.Water.IceSpike.Projectile.Damage", 1);
|
config.addDefault("Abilities.Water.IceSpike.Projectile.Damage", 1);
|
||||||
config.addDefault("Abilities.Water.IceSpike.SelectRange", 12);
|
config.addDefault("Abilities.Water.IceSpike.SelectRange", 12);
|
||||||
config.addDefault("Abilities.Water.IceSpike.AutoSourcing.Enabled", true);
|
|
||||||
config.addDefault("Abilities.Water.IceSpike.AutoSourcing.Cooldown", 1500);
|
|
||||||
config.addDefault("Abilities.Water.IceSpike.AutoSourcing.SelectRange", 5);
|
|
||||||
config.addDefault("Abilities.Water.IceSpike.DynamicSourcing.Enabled", true);
|
config.addDefault("Abilities.Water.IceSpike.DynamicSourcing.Enabled", true);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.OctopusForm.Enabled", true);
|
config.addDefault("Abilities.Water.OctopusForm.Enabled", true);
|
||||||
|
@ -392,7 +389,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.PlantArmor.Cooldown", 10000);
|
config.addDefault("Abilities.Water.PlantArmor.Cooldown", 10000);
|
||||||
config.addDefault("Abilities.Water.PlantArmor.SelectRange", 12);
|
config.addDefault("Abilities.Water.PlantArmor.SelectRange", 12);
|
||||||
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.Enabled", true);
|
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.Cooldown", 1500);
|
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.Cooldown", 10000);
|
||||||
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.SelectRange", 5);
|
config.addDefault("Abilities.Water.PlantArmor.AutoSourcing.SelectRange", 5);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.Surge.Enabled", true);
|
config.addDefault("Abilities.Water.Surge.Enabled", true);
|
||||||
|
@ -476,8 +473,6 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Duration.Normal", 7000);
|
config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Duration.Normal", 7000);
|
||||||
config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Duration.FullMoon", 12000);
|
config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Duration.FullMoon", 12000);
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.WaterArms.AutoSourcing.Enabled", true);
|
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.WaterBubble.Enabled", true);
|
config.addDefault("Abilities.Water.WaterBubble.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.WaterBubble.Description", "To use, the bender must hold down sneak. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
|
config.addDefault("Abilities.Water.WaterBubble.Description", "To use, the bender must hold down sneak. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
|
||||||
config.addDefault("Abilities.Water.WaterBubble.Radius", 7);
|
config.addDefault("Abilities.Water.WaterBubble.Radius", 7);
|
||||||
|
@ -510,7 +505,6 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.Enabled", true);
|
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.Cooldown", 1500);
|
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.Cooldown", 1500);
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.SelectRange", 5);
|
config.addDefault("Abilities.Water.WaterSpout.Wave.AutoSourcing.SelectRange", 5);
|
||||||
config.addDefault("Abilities.Water.WaterSpout.Wave.DynamicSourcing.Enabled", true);
|
|
||||||
|
|
||||||
config.addDefault("Abilities.Water.WaterCombo.Enabled", true);
|
config.addDefault("Abilities.Water.WaterCombo.Enabled", true);
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceWave.Damage", 4);
|
config.addDefault("Abilities.Water.WaterCombo.IceWave.Damage", 4);
|
||||||
|
@ -522,8 +516,6 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceBullet.AnimationSpeed", 1);
|
config.addDefault("Abilities.Water.WaterCombo.IceBullet.AnimationSpeed", 1);
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceBullet.ShootTime", 10000);
|
config.addDefault("Abilities.Water.WaterCombo.IceBullet.ShootTime", 10000);
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceBullet.Cooldown", 10000);
|
config.addDefault("Abilities.Water.WaterCombo.IceBullet.Cooldown", 10000);
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceBullet.AutoSourcing.Enabled", true);
|
|
||||||
config.addDefault("Abilities.Water.WaterCombo.IceBullet.DynamicSourcing.Enabled", true);
|
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
|
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
|
||||||
config.addDefault("Properties.Earth.Passive.SandRunPower", 1);
|
config.addDefault("Properties.Earth.Passive.SandRunPower", 1);
|
||||||
|
@ -533,6 +525,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Earth.Catapult.Length", 6);
|
config.addDefault("Abilities.Earth.Catapult.Length", 6);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Speed", 10);
|
config.addDefault("Abilities.Earth.Catapult.Speed", 10);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Push", 4);
|
config.addDefault("Abilities.Earth.Catapult.Push", 4);
|
||||||
|
config.addDefault("Abilities.Earth.Catapult.ShiftModifier", 2);
|
||||||
config.addDefault("Abilities.Earth.Catapult.Cooldown", 0);
|
config.addDefault("Abilities.Earth.Catapult.Cooldown", 0);
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
|
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
|
||||||
|
@ -627,16 +620,6 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Earth.EarthSmash.FlightTimer", 3000);
|
config.addDefault("Abilities.Earth.EarthSmash.FlightTimer", 3000);
|
||||||
config.addDefault("Abilities.Earth.EarthSmash.RemoveTimer", 30000);
|
config.addDefault("Abilities.Earth.EarthSmash.RemoveTimer", 30000);
|
||||||
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.Enabled", true);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.Description", "LavaSurge is a fundamental move for any Lavabender out there. To use, simply sneak (Default: Shift) while looking at a source of Earth or Lava, then click in a direction. A surge of lava will swiftly travel towards the target you were pointing at, dealing moderate damage, a large knockback, and setting them on fire.");
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.Damage", 4);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.Cooldown", 1000);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.FractureRadius", 1);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.PrepareRange", 7);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.TravelRange", 15);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.MaxLavaWaves", 10);
|
|
||||||
// config.addDefault("Abilities.Earth.LavaSurge.SourceCanBeEarth", true);
|
|
||||||
|
|
||||||
config.addDefault("Abilities.Earth.MetalClips.Enabled", true);
|
config.addDefault("Abilities.Earth.MetalClips.Enabled", true);
|
||||||
config.addDefault("Abilities.Earth.MetalClips.Description", "MetalClips has the potential to be both an offensive and a utility ability. To start, you must carry smelted Iron Ingots in your inventory. To apply the clips onto an entity, simply click at them. If the entity is a Zombie, a Skeleton, or a Player, the clips will form armor around the entity, giving you some control over them. Each additional clip will give you more control. If you have permission to do so, you may crush the entity against a wall with a 4th clip, hurting them. Without explicit permissions, you will only be able to strap three clips on your target. If the entity is not one of the above, the clip will simply do damage and fall to the ground, to be collected. Another permission requiring action is throwing entities. To do so, click while controlling a metalclipped entity");
|
config.addDefault("Abilities.Earth.MetalClips.Description", "MetalClips has the potential to be both an offensive and a utility ability. To start, you must carry smelted Iron Ingots in your inventory. To apply the clips onto an entity, simply click at them. If the entity is a Zombie, a Skeleton, or a Player, the clips will form armor around the entity, giving you some control over them. Each additional clip will give you more control. If you have permission to do so, you may crush the entity against a wall with a 4th clip, hurting them. Without explicit permissions, you will only be able to strap three clips on your target. If the entity is not one of the above, the clip will simply do damage and fall to the ground, to be collected. Another permission requiring action is throwing entities. To do so, click while controlling a metalclipped entity");
|
||||||
config.addDefault("Abilities.Earth.MetalClips.Damage", 2);
|
config.addDefault("Abilities.Earth.MetalClips.Damage", 2);
|
||||||
|
@ -718,7 +701,7 @@ public class ConfigManager {
|
||||||
config.addDefault("Abilities.Fire.FireBlast.Charged.FireTicks", 4);
|
config.addDefault("Abilities.Fire.FireBlast.Charged.FireTicks", 4);
|
||||||
|
|
||||||
config.addDefault("Abilities.Fire.FireBurst.Enabled", true);
|
config.addDefault("Abilities.Fire.FireBurst.Enabled", true);
|
||||||
config.addDefault("Abilities.Fire.FireBurst.Description", "FireBurst is a very powerful firebending ability. " + "To use, press and hold sneak to charge your burst. " + "Once charged, you can either release sneak to launch a cone-shaped burst " + "of flames in front of you, or click to release the burst in a sphere around you. ");
|
config.addDefault("Abilities.Fire.FireBurst.Description", "FireBurst is a very powerful firebending ability. " + "To use, press and hold sneak to charge your burst. " + "Once charged, you can either release sneak to release the burst in a sphere around you or " + "click to launch a cone-shaped burst of flames in front of you.");
|
||||||
config.addDefault("Abilities.Fire.FireBurst.Damage", 2);
|
config.addDefault("Abilities.Fire.FireBurst.Damage", 2);
|
||||||
config.addDefault("Abilities.Fire.FireBurst.ChargeTime", 3500);
|
config.addDefault("Abilities.Fire.FireBurst.ChargeTime", 3500);
|
||||||
config.addDefault("Abilities.Fire.FireBurst.Range", 15);
|
config.addDefault("Abilities.Fire.FireBurst.Range", 15);
|
||||||
|
|
|
@ -21,12 +21,14 @@ public class Catapult implements ConfigLoadable {
|
||||||
private static int LENGTH = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.Catapult.Length");
|
private static int LENGTH = ProjectKorra.plugin.getConfig().getInt("Abilities.Earth.Catapult.Length");
|
||||||
private static double SPEED = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Speed");
|
private static double SPEED = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Speed");
|
||||||
private static double PUSH = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Push");
|
private static double PUSH = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.Push");
|
||||||
|
private static double SHIFT = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.Catapult.ShiftModifier");
|
||||||
private static long cooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.Catapult.Cooldown");
|
private static long COOLDOWN = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.Catapult.Cooldown");
|
||||||
|
|
||||||
private int length = LENGTH;
|
private int length = LENGTH;
|
||||||
private double speed = SPEED;
|
private double speed = SPEED;
|
||||||
private double push = PUSH;
|
private double push = PUSH;
|
||||||
|
private double shift = SHIFT;
|
||||||
|
private long cooldown = COOLDOWN;
|
||||||
private Player player;
|
private Player player;
|
||||||
private Location origin;
|
private Location origin;
|
||||||
private Location location;
|
private Location location;
|
||||||
|
@ -67,7 +69,7 @@ public class Catapult implements ConfigLoadable {
|
||||||
catapult = true;
|
catapult = true;
|
||||||
}
|
}
|
||||||
if (player.isSneaking())
|
if (player.isSneaking())
|
||||||
distance = distance / 2;
|
distance = (int) (distance / shift);
|
||||||
|
|
||||||
moving = true;
|
moving = true;
|
||||||
instances.put(player, this);
|
instances.put(player, this);
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Collapse {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, false, dynamic, true, EarthMethods.canSandbend(player), false);
|
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
Location location;
|
Location location;
|
||||||
if (sblock == null) {
|
if (sblock == null) {
|
||||||
location = player.getTargetBlock(EarthMethods.getTransparentEarthbending(), selectRange).getLocation();
|
location = player.getTargetBlock(EarthMethods.getTransparentEarthbending(), selectRange).getLocation();
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class CompactColumn {
|
||||||
if (bPlayer.isOnCooldown("Collapse"))
|
if (bPlayer.isOnCooldown("Collapse"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
block = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, false, dynamic, true, EarthMethods.canSandbend(player), false);
|
block = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
if (block == null)
|
if (block == null)
|
||||||
return;
|
return;
|
||||||
origin = block.getLocation();
|
origin = block.getLocation();
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class EarthArmor {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.player = player;
|
this.player = player;
|
||||||
headblock = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.LEFT_CLICK, false, auto, false, true, EarthMethods.canSandbend(player), false);
|
headblock = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.LEFT_CLICK, auto, false, true, EarthMethods.canSandbend(player), false);
|
||||||
if (BlockSource.isAuto(headblock)) {
|
if (BlockSource.isAuto(headblock)) {
|
||||||
bPlayer.addCooldown("EarthArmor", autocooldown);
|
bPlayer.addCooldown("EarthArmor", autocooldown);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -83,8 +83,8 @@ public class EarthBlast {
|
||||||
|
|
||||||
public boolean prepare() {
|
public boolean prepare() {
|
||||||
cancelPrevious();
|
cancelPrevious();
|
||||||
Block block = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, dynamic, auto,
|
Block block = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto,
|
||||||
dynamic, true, EarthMethods.canSandbend(player), false);
|
dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
block(player);
|
block(player);
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
if (block.getLocation().distance(player.getLocation()) > selectRange) {
|
if (block.getLocation().distance(player.getLocation()) > selectRange) {
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class EarthColumn {
|
||||||
if (AvatarState.isAvatarState(player)) {
|
if (AvatarState.isAvatarState(player)) {
|
||||||
height = (int) (2. / 5. * (double) AvatarState.getValue(height));
|
height = (int) (2. / 5. * (double) AvatarState.getValue(height));
|
||||||
}
|
}
|
||||||
block = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, false, dynamic, true, EarthMethods.canSandbend(player), false);
|
block = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
if (block == null)
|
if (block == null)
|
||||||
return;
|
return;
|
||||||
origin = block.getLocation();
|
origin = block.getLocation();
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class EarthSmash {
|
||||||
public static boolean ALLOW_GRAB = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowGrab");
|
public static boolean ALLOW_GRAB = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowGrab");
|
||||||
public static boolean ALLOW_SHOOTING = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowShooting");
|
public static boolean ALLOW_SHOOTING = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowShooting");
|
||||||
public static boolean ALLOW_FLIGHT = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowFlight");
|
public static boolean ALLOW_FLIGHT = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowFlight");
|
||||||
public static int GRAB_RANGE = ProjectKorra.plugin.getConfig().getInt("Properties.Earth.Range");
|
public static int GRAB_RANGE = ProjectKorra.plugin.getConfig().getInt("Properties.Earth.SelectRange");
|
||||||
public static double TRAVEL_RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.ShotRange");
|
public static double TRAVEL_RANGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.ShotRange");
|
||||||
public static double SHOOTING_DAMAGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.Damage");
|
public static double SHOOTING_DAMAGE = ProjectKorra.plugin.getConfig().getDouble("Abilities.Earth.EarthSmash.Damage");
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class EarthWall {
|
||||||
|
|
||||||
Vector orth = new Vector(ox, oy, oz);
|
Vector orth = new Vector(ox, oy, oz);
|
||||||
orth = orth.normalize();
|
orth = orth.normalize();
|
||||||
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, false, dynamic, true, EarthMethods.canSandbend(player), false);
|
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
if (sblock != null) {
|
if (sblock != null) {
|
||||||
Location origin = sblock.getLocation();
|
Location origin = sblock.getLocation();
|
||||||
World world = origin.getWorld();
|
World world = origin.getWorld();
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class LavaFlow {
|
||||||
}
|
}
|
||||||
instances.add(this);
|
instances.add(this);
|
||||||
} else if (type == AbilityType.CLICK) {
|
} else if (type == AbilityType.CLICK) {
|
||||||
Block sourceBlock = BlockSource.getEarthOrLavaSourceBlock(player, clickRange, clickRange, ClickType.SHIFT_DOWN, false, false, dynamic, true, EarthMethods.canSandbend(player));
|
Block sourceBlock = BlockSource.getEarthOrLavaSourceBlock(player, clickRange, clickRange, ClickType.SHIFT_DOWN, false, dynamic, true, EarthMethods.canSandbend(player));
|
||||||
if (sourceBlock == null) {
|
if (sourceBlock == null) {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class LavaSurge {
|
||||||
|
|
||||||
public boolean prepare()
|
public boolean prepare()
|
||||||
{
|
{
|
||||||
Block targetBlock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, false, dynamic, true, EarthMethods.canSandbend(player), false);
|
Block targetBlock = BlockSource.getEarthSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player));
|
||||||
|
|
||||||
if(targetBlock == null ||
|
if(targetBlock == null ||
|
||||||
!(targetBlock.getRelative(BlockFace.UP).getType() == Material.AIR) &&
|
!(targetBlock.getRelative(BlockFace.UP).getType() == Material.AIR) &&
|
||||||
|
|
|
@ -68,7 +68,7 @@ public class LavaWall {
|
||||||
|
|
||||||
public boolean prepare() {
|
public boolean prepare() {
|
||||||
cancelPrevious();
|
cancelPrevious();
|
||||||
Block block = BlockSource.getEarthOrLavaSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, false, dynamic, true, EarthMethods.canSandbend(player));
|
Block block = BlockSource.getEarthOrLavaSourceBlock(player, selectRange, selectRange, ClickType.LEFT_CLICK, false, dynamic, true, EarthMethods.canSandbend(player));
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
sourceblock = block;
|
sourceblock = block;
|
||||||
focusBlock();
|
focusBlock();
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class LavaWave {
|
||||||
public boolean prepare() {
|
public boolean prepare() {
|
||||||
cancelPrevious();
|
cancelPrevious();
|
||||||
// Block block = player.getTargetBlock(null, (int) range);
|
// Block block = player.getTargetBlock(null, (int) range);
|
||||||
Block block = BlockSource.getEarthOrLavaSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, false, dynamic, true, EarthMethods.canSandbend(player));
|
Block block = BlockSource.getEarthOrLavaSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, EarthMethods.canSandbend(player));
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
sourceblock = block;
|
sourceblock = block;
|
||||||
focusBlock();
|
focusBlock();
|
||||||
|
|
|
@ -94,9 +94,9 @@ public class Shockwave {
|
||||||
for (double theta = 0; theta < 360; theta += dtheta) {
|
for (double theta = 0; theta < 360; theta += dtheta) {
|
||||||
double rtheta = Math.toRadians(theta);
|
double rtheta = Math.toRadians(theta);
|
||||||
Vector vector = new Vector(Math.cos(rtheta), 0, Math.sin(rtheta));
|
Vector vector = new Vector(Math.cos(rtheta), 0, Math.sin(rtheta));
|
||||||
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Shockwave", cooldown);
|
|
||||||
new Ripple(player, vector.normalize());
|
new Ripple(player, vector.normalize());
|
||||||
}
|
}
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Shockwave", cooldown);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void coneShockwave(Player player) {
|
public static void coneShockwave(Player player) {
|
||||||
|
@ -107,9 +107,9 @@ public class Shockwave {
|
||||||
double rtheta = Math.toRadians(theta);
|
double rtheta = Math.toRadians(theta);
|
||||||
Vector vector = new Vector(Math.cos(rtheta), 0, Math.sin(rtheta));
|
Vector vector = new Vector(Math.cos(rtheta), 0, Math.sin(rtheta));
|
||||||
if (vector.angle(player.getEyeLocation().getDirection()) < angle)
|
if (vector.angle(player.getEyeLocation().getDirection()) < angle)
|
||||||
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Shockwave", cooldown);
|
|
||||||
new Ripple(player, vector.normalize());
|
new Ripple(player, vector.normalize());
|
||||||
}
|
}
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("Shockwave", cooldown);
|
||||||
instances.remove(player);
|
instances.remove(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,12 +11,14 @@ public final class PlayerCooldownChangeEvent extends Event implements Cancellabl
|
||||||
private String ability;
|
private String ability;
|
||||||
private Result eventresult;
|
private Result eventresult;
|
||||||
private boolean cancelled;
|
private boolean cancelled;
|
||||||
|
private long cooldown;
|
||||||
|
|
||||||
public PlayerCooldownChangeEvent(Player player, String abilityname, Result result) {
|
public PlayerCooldownChangeEvent(Player player, String abilityname, long cooldown, Result result) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
this.ability = abilityname;
|
this.ability = abilityname;
|
||||||
this.eventresult = result;
|
this.eventresult = result;
|
||||||
this.cancelled = false;
|
this.cancelled = false;
|
||||||
|
this.cooldown = cooldown;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
|
@ -31,6 +33,10 @@ public final class PlayerCooldownChangeEvent extends Event implements Cancellabl
|
||||||
return eventresult;
|
return eventresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getCooldown() {
|
||||||
|
return cooldown;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isCancelled() {
|
public boolean isCancelled() {
|
||||||
return cancelled;
|
return cancelled;
|
||||||
}
|
}
|
||||||
|
@ -39,6 +45,10 @@ public final class PlayerCooldownChangeEvent extends Event implements Cancellabl
|
||||||
this.cancelled = cancel;
|
this.cancelled = cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setCooldown(long cooldown) {
|
||||||
|
this.cooldown = cooldown;
|
||||||
|
}
|
||||||
|
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
return handlers;
|
return handlers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class FireBurst implements ConfigLoadable {
|
||||||
private int damage = config.get().getInt("Abilities.Fire.FireBurst.Damage");
|
private int damage = config.get().getInt("Abilities.Fire.FireBurst.Damage");
|
||||||
private long chargetime = config.get().getLong("Abilities.Fire.FireBurst.ChargeTime");
|
private long chargetime = config.get().getLong("Abilities.Fire.FireBurst.ChargeTime");
|
||||||
private long range = config.get().getLong("Abilities.Fire.FireBurst.Range");
|
private long range = config.get().getLong("Abilities.Fire.FireBurst.Range");
|
||||||
private static long cooldown = config.get().getLong("Abilities.Air.Flight.Cooldown");
|
private static long cooldown = config.get().getLong("Abilities.Fire.FireBurst.Cooldown");
|
||||||
private double deltheta = 10;
|
private double deltheta = 10;
|
||||||
private double delphi = 10;
|
private double delphi = 10;
|
||||||
private boolean charged = false;
|
private boolean charged = false;
|
||||||
|
@ -91,12 +91,12 @@ public class FireBurst implements ConfigLoadable {
|
||||||
if (direction.angle(vector) <= angle) {
|
if (direction.angle(vector) <= angle) {
|
||||||
// Methods.verbose(direction.angle(vector));
|
// Methods.verbose(direction.angle(vector));
|
||||||
// Methods.verbose(direction);
|
// Methods.verbose(direction);
|
||||||
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("FireBurst", cooldown);
|
|
||||||
FireBlast fblast = new FireBlast(location, direction.normalize(), player, damage, safeblocks);
|
FireBlast fblast = new FireBlast(location, direction.normalize(), player, damage, safeblocks);
|
||||||
fblast.setRange(this.range);
|
fblast.setRange(this.range);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("FireBurst", cooldown);
|
||||||
}
|
}
|
||||||
// Methods.verbose("--" + AirBlast.instances.size() + "--");
|
// Methods.verbose("--" + AirBlast.instances.size() + "--");
|
||||||
remove();
|
remove();
|
||||||
|
@ -221,13 +221,13 @@ public class FireBurst implements ConfigLoadable {
|
||||||
y = r * Math.sin(rphi) * Math.sin(rtheta);
|
y = r * Math.sin(rphi) * Math.sin(rtheta);
|
||||||
z = r * Math.cos(rtheta);
|
z = r * Math.cos(rtheta);
|
||||||
Vector direction = new Vector(x, z, y);
|
Vector direction = new Vector(x, z, y);
|
||||||
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("FireBurst", cooldown);
|
|
||||||
FireBlast fblast = new FireBlast(location, direction.normalize(), player, damage, safeblocks);
|
FireBlast fblast = new FireBlast(location, direction.normalize(), player, damage, safeblocks);
|
||||||
fblast.setRange(this.range);
|
fblast.setRange(this.range);
|
||||||
fblast.setShowParticles(false);
|
fblast.setShowParticles(false);
|
||||||
blasts.add(fblast);
|
blasts.add(fblast);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
GeneralMethods.getBendingPlayer(player.getName()).addCooldown("FireBurst", cooldown);
|
||||||
}
|
}
|
||||||
// Methods.verbose("--" + AirBlast.instances.size() + "--");
|
// Methods.verbose("--" + AirBlast.instances.size() + "--");
|
||||||
remove();
|
remove();
|
||||||
|
|
61
src/com/projectkorra/projectkorra/util/ActionBar.java
Normal file
61
src/com/projectkorra/projectkorra/util/ActionBar.java
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
package com.projectkorra.projectkorra.util;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import com.projectkorra.projectkorra.util.ReflectionHandler.PackageType;
|
||||||
|
|
||||||
|
public class ActionBar {
|
||||||
|
|
||||||
|
private static boolean initialised = false;
|
||||||
|
private static Constructor<?> chatSer;
|
||||||
|
private static Constructor<?> packetChat;
|
||||||
|
private static Method getHandle;
|
||||||
|
private static Field playerConnection;
|
||||||
|
private static Method sendPacket;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
chatSer = ReflectionHandler.getConstructor(PackageType.MINECRAFT_SERVER.getClass("ChatComponentText"), String.class);
|
||||||
|
packetChat = PackageType.MINECRAFT_SERVER.getClass("PacketPlayOutChat").getConstructor(PackageType.MINECRAFT_SERVER.getClass("IChatBaseComponent"), byte.class);
|
||||||
|
getHandle = ReflectionHandler.getMethod("CraftPlayer", PackageType.CRAFTBUKKIT_ENTITY, "getHandle");
|
||||||
|
playerConnection = ReflectionHandler.getField("EntityPlayer", PackageType.MINECRAFT_SERVER, false, "playerConnection");
|
||||||
|
sendPacket = ReflectionHandler.getMethod(playerConnection.getType(), "sendPacket", PackageType.MINECRAFT_SERVER.getClass("Packet"));
|
||||||
|
initialised = true;
|
||||||
|
}
|
||||||
|
catch (ReflectiveOperationException e) {
|
||||||
|
initialised = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isInitialised() {
|
||||||
|
return initialised;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean sendActionBar(String message, Player... p) {
|
||||||
|
if (!initialised) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Object o = chatSer.newInstance(message);
|
||||||
|
Object packet = packetChat.newInstance(o, (byte) 2);
|
||||||
|
sendTo(packet, p);
|
||||||
|
}
|
||||||
|
catch (ReflectiveOperationException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
initialised = false;
|
||||||
|
}
|
||||||
|
return initialised;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void sendTo(Object packet, Player... pl) throws ReflectiveOperationException {
|
||||||
|
for (Player p : pl) {
|
||||||
|
Object entityplayer = getHandle.invoke(p);
|
||||||
|
Object PlayerConnection = playerConnection.get(entityplayer);
|
||||||
|
sendPacket.invoke(PlayerConnection, packet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,16 @@
|
||||||
package com.projectkorra.projectkorra.util;
|
package com.projectkorra.projectkorra.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import java.util.HashMap;
|
import com.projectkorra.projectkorra.earthbending.EarthMethods;
|
||||||
import java.util.List;
|
import com.projectkorra.projectkorra.waterbending.WaterMethods;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import java.util.ArrayList;
|
||||||
import com.projectkorra.projectkorra.earthbending.EarthMethods;
|
import java.util.HashMap;
|
||||||
import com.projectkorra.projectkorra.waterbending.WaterMethods;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BlockSource is a class that handles water and earth bending sources. When a
|
* BlockSource is a class that handles water and earth bending sources. When a
|
||||||
|
@ -147,7 +147,7 @@ public class BlockSource {
|
||||||
public static Block getDynamicEarthSourceBlock(Player player, int autoRange, int selectRange, BlockSourceType sourceType, ClickType clickType, boolean auto, boolean dynamic, boolean earth, boolean sand, boolean metal) {
|
public static Block getDynamicEarthSourceBlock(Player player, int autoRange, int selectRange, BlockSourceType sourceType, ClickType clickType, boolean auto, boolean dynamic, boolean earth, boolean sand, boolean metal) {
|
||||||
update(player, selectRange, clickType);
|
update(player, selectRange, clickType);
|
||||||
BlockSourceInformation info = getValidBlockSourceInformation(player, selectRange, sourceType, clickType);
|
BlockSourceInformation info = getValidBlockSourceInformation(player, selectRange, sourceType, clickType);
|
||||||
if (info != null && dynamic) {
|
if (info != null) {
|
||||||
Block tempBlock = info.getBlock();
|
Block tempBlock = info.getBlock();
|
||||||
if (EarthMethods.isEarthbendable(tempBlock.getType()) && earth) {
|
if (EarthMethods.isEarthbendable(tempBlock.getType()) && earth) {
|
||||||
return tempBlock;
|
return tempBlock;
|
||||||
|
@ -159,11 +159,10 @@ public class BlockSource {
|
||||||
return tempBlock;
|
return tempBlock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (auto) {
|
if (info == null && dynamic) {
|
||||||
return EarthMethods.getRandomEarthBlock(player, player.getLocation(), autoRange, earth, sand, metal);
|
return null;
|
||||||
} else {
|
|
||||||
return EarthMethods.getEarthSourceBlock(player, selectRange, earth, sand, metal);
|
|
||||||
}
|
}
|
||||||
|
return EarthMethods.getEarthSourceBlock(player, selectRange, earth, sand, metal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -189,11 +188,10 @@ public class BlockSource {
|
||||||
return info.getBlock();
|
return info.getBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (auto) {
|
if (info == null && dynamic) {
|
||||||
return WaterMethods.getRandomWaterBlock(player, player.getLocation(), autoRange, water, ice, plant);
|
return null;
|
||||||
} else {
|
|
||||||
return WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
|
||||||
}
|
}
|
||||||
|
return WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -212,13 +210,19 @@ public class BlockSource {
|
||||||
* @return a valid Water bendable block, or null if none was found.
|
* @return a valid Water bendable block, or null if none was found.
|
||||||
*/
|
*/
|
||||||
public static Block getWaterSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean auto, boolean dynamic, boolean bottles, boolean water, boolean ice, boolean plant) {
|
public static Block getWaterSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean auto, boolean dynamic, boolean bottles, boolean water, boolean ice, boolean plant) {
|
||||||
Block sourceBlock = BlockSource.getDynamicWaterSourceBlock(player, autoRange, selectRange, BlockSourceType.WATER, clickType, auto, dynamic, water, ice, plant);
|
Block sourceBlock = null;
|
||||||
|
if(dynamic)
|
||||||
|
sourceBlock = BlockSource.getDynamicWaterSourceBlock(player, autoRange, selectRange, BlockSourceType.WATER, clickType, auto, dynamic, water, ice, plant);
|
||||||
|
else
|
||||||
|
sourceBlock = WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
||||||
if (bottles && sourceBlock == null) {
|
if (bottles && sourceBlock == null) {
|
||||||
|
if(bottles) {
|
||||||
// Check the block in front of the player's eyes, it may have been created by a
|
// Check the block in front of the player's eyes, it may have been created by a
|
||||||
// WaterBottle.
|
// WaterBottle.
|
||||||
sourceBlock = WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
sourceBlock = WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
||||||
if (sourceBlock == null || sourceBlock.getLocation().distance(player.getEyeLocation()) > 3) {
|
}
|
||||||
sourceBlock = null;
|
if (auto && (sourceBlock == null || sourceBlock.getLocation().distance(player.getEyeLocation()) > 3)) {
|
||||||
|
sourceBlock = WaterMethods.getRandomWaterBlock(player, player.getLocation(), autoRange, water, ice, plant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourceBlock;
|
return sourceBlock;
|
||||||
|
@ -237,23 +241,28 @@ public class BlockSource {
|
||||||
* block.
|
* block.
|
||||||
* @return a valid Earth bendable block, or null if none was found.
|
* @return a valid Earth bendable block, or null if none was found.
|
||||||
*/
|
*/
|
||||||
public static Block getEarthSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean nearby, boolean auto, boolean dynamic, boolean earth, boolean sand, boolean metal) {
|
public static Block getEarthSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean auto, boolean dynamic, boolean earth, boolean sand, boolean metal) {
|
||||||
Block sourceBlock = getDynamicEarthSourceBlock(player, autoRange, selectRange, BlockSourceType.EARTH, clickType, auto, dynamic, earth, sand, metal);
|
Block sourceBlock = null;
|
||||||
if (!auto && nearby && sourceBlock == null) {
|
if(dynamic)
|
||||||
|
sourceBlock = getDynamicEarthSourceBlock(player, autoRange, selectRange, BlockSourceType.EARTH, clickType, auto, dynamic, earth, sand, metal);
|
||||||
|
else
|
||||||
|
sourceBlock = EarthMethods.getEarthSourceBlock(player, selectRange, earth, sand, metal);
|
||||||
|
if (sourceBlock == null) {
|
||||||
BlockSourceInformation blockInfo = getBlockSourceInformation(player, BlockSourceType.EARTH, clickType);
|
BlockSourceInformation blockInfo = getBlockSourceInformation(player, BlockSourceType.EARTH, clickType);
|
||||||
|
if (dynamic) {
|
||||||
|
if (blockInfo == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Block tempBlock = blockInfo.getBlock();
|
||||||
|
if (tempBlock == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (blockInfo == null) {
|
Location loc = tempBlock.getLocation();
|
||||||
return null;
|
sourceBlock = EarthMethods.getNearbyEarthBlock(loc, autoRange, autoRange, earth, sand, metal);
|
||||||
}
|
}
|
||||||
Block tempBlock = blockInfo.getBlock();
|
if (auto && (sourceBlock == null || !sourceBlock.getLocation().getWorld().equals(player.getWorld()) || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > selectRange)) {
|
||||||
if (tempBlock == null) {
|
return EarthMethods.getRandomEarthBlock(player, player.getLocation(), autoRange, earth, sand, metal);
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Location loc = tempBlock.getLocation();
|
|
||||||
sourceBlock = EarthMethods.getNearbyEarthBlock(loc, autoRange, autoRange, earth, sand, metal);
|
|
||||||
if (sourceBlock == null || !sourceBlock.getLocation().getWorld().equals(player.getWorld()) || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > autoRange) {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourceBlock;
|
return sourceBlock;
|
||||||
|
@ -269,13 +278,13 @@ public class BlockSource {
|
||||||
* either {@link ClickType}.SHIFT_DOWN or ClickType.LEFT_CLICK.
|
* either {@link ClickType}.SHIFT_DOWN or ClickType.LEFT_CLICK.
|
||||||
* @return a valid Earth or Lava bendable block, or null if none was found.
|
* @return a valid Earth or Lava bendable block, or null if none was found.
|
||||||
*/
|
*/
|
||||||
public static Block getEarthOrLavaSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean nearby, boolean auto, boolean dynamic, boolean earth, boolean sand) {
|
public static Block getEarthOrLavaSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean auto, boolean dynamic, boolean earth, boolean sand) {
|
||||||
/*
|
/*
|
||||||
* When Lava is selected as a source it automatically overrides the
|
* When Lava is selected as a source it automatically overrides the
|
||||||
* previous Earth based source. Only one of these types can exist, so if
|
* previous Earth based source. Only one of these types can exist, so if
|
||||||
* Lava exists then we know Earth is null.
|
* Lava exists then we know Earth is null.
|
||||||
*/
|
*/
|
||||||
Block earthBlock = getEarthSourceBlock(player, autoRange, selectRange, clickType, nearby, auto, dynamic, earth, sand, false);
|
Block earthBlock = getEarthSourceBlock(player, autoRange, selectRange, clickType, auto, dynamic, earth, sand, false);
|
||||||
BlockSourceInformation lavaBlockInfo = getValidBlockSourceInformation(player, selectRange, BlockSourceType.LAVA, clickType);
|
BlockSourceInformation lavaBlockInfo = getValidBlockSourceInformation(player, selectRange, BlockSourceType.LAVA, clickType);
|
||||||
if (earthBlock != null) {
|
if (earthBlock != null) {
|
||||||
return earthBlock;
|
return earthBlock;
|
||||||
|
|
|
@ -22,6 +22,7 @@ import org.bukkit.potion.PotionEffectType;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class Bloodbending {
|
public class Bloodbending {
|
||||||
|
@ -47,6 +48,14 @@ public class Bloodbending {
|
||||||
private long holdTime = HOLD_TIME;
|
private long holdTime = HOLD_TIME;
|
||||||
private long cooldown = COOLDOWN;
|
private long cooldown = COOLDOWN;
|
||||||
|
|
||||||
|
private Integer[] transparent = {0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32,
|
||||||
|
37, 38, 39, 40, 50, 51, 55, 59, 63, 64,
|
||||||
|
65, 66, 68, 69, 70, 71, 72, 75, 76, 77,
|
||||||
|
78, 83, 93, 94, 104, 105, 111, 115, 117,
|
||||||
|
132, 141, 142, 143, 147, 148, 149, 150,
|
||||||
|
157, 175, 176, 177, 183, 184, 185, 187,
|
||||||
|
193, 194, 195, 196, 197};
|
||||||
|
|
||||||
public Bloodbending(Player player) {
|
public Bloodbending(Player player) {
|
||||||
if (instances.containsKey(player)) {
|
if (instances.containsKey(player)) {
|
||||||
remove(player);
|
remove(player);
|
||||||
|
@ -81,7 +90,13 @@ public class Bloodbending {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Entity target = GeneralMethods.getTargetedEntity(player, range, new ArrayList<Entity>());
|
Location location = GeneralMethods.getTargetedLocation(player, 6, transparent);
|
||||||
|
List<Entity> entities = GeneralMethods.getEntitiesAroundPoint(location, 1.5);
|
||||||
|
if (entities == null || entities.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Entity target = entities.get(0);
|
||||||
|
//Entity target = GeneralMethods.getTargetedEntity(player, range, new ArrayList<Entity>());
|
||||||
if (target == null)
|
if (target == null)
|
||||||
return;
|
return;
|
||||||
if (!(target instanceof LivingEntity) || GeneralMethods.isRegionProtectedFromBuild(player, "Bloodbending", target.getLocation()))
|
if (!(target instanceof LivingEntity) || GeneralMethods.isRegionProtectedFromBuild(player, "Bloodbending", target.getLocation()))
|
||||||
|
@ -225,7 +240,7 @@ public class Bloodbending {
|
||||||
targetentities.remove(entity);
|
targetentities.remove(entity);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Location location = GeneralMethods.getTargetedLocation(player, 6, 0, 6, 8, 9, 10, 11, 27, 28, 30, 31, 32, 37, 38, 39, 40, 50, 51, 55, 59, 63, 64, 65, 66, 68, 69, 70, 71, 72, 75, 76, 77, 78, 83, 93, 94, 104, 105, 111, 115, 117, 132, 141, 142, 143, 147, 148, 149, 150, 157, 175, 176, 177, 183, 184, 185, 187, 193, 194, 195, 196, 197);
|
Location location = GeneralMethods.getTargetedLocation(player, 6, transparent);
|
||||||
double distance = location.distance(newlocation);
|
double distance = location.distance(newlocation);
|
||||||
double dx, dy, dz;
|
double dx, dy, dz;
|
||||||
dx = location.getX() - newlocation.getX();
|
dx = location.getX() - newlocation.getX();
|
||||||
|
|
|
@ -34,9 +34,6 @@ public class IceSpike2 {
|
||||||
static long slowCooldown = 5000;
|
static long slowCooldown = 5000;
|
||||||
|
|
||||||
private static int selectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.IceSpike.Projectile.SelectRange");
|
private static int selectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.IceSpike.Projectile.SelectRange");
|
||||||
private static int autoSelectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.IceSpike.Projectile.AutoSourcing.SelectRange");
|
|
||||||
private static boolean auto = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.IceSpike.Projectile.AutoSourcing.Enabled");
|
|
||||||
private static long autocooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Water.IceSpike.Projectile.AutoSourcing.Cooldown");
|
|
||||||
private static boolean dynamic = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.IceSpike.Projectile.DynamicSourcing.Enabled");
|
private static boolean dynamic = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.IceSpike.Projectile.DynamicSourcing.Enabled");
|
||||||
|
|
||||||
private static final long interval = 20;
|
private static final long interval = 20;
|
||||||
|
@ -59,20 +56,13 @@ public class IceSpike2 {
|
||||||
private double defaultrange = RANGE;
|
private double defaultrange = RANGE;
|
||||||
private double defaultdamage = DAMAGE;
|
private double defaultdamage = DAMAGE;
|
||||||
|
|
||||||
private boolean isAuto;
|
|
||||||
|
|
||||||
public IceSpike2(Player player) {
|
public IceSpike2(Player player) {
|
||||||
if (!WaterMethods.canIcebend(player))
|
if (!WaterMethods.canIcebend(player))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
block(player);
|
block(player);
|
||||||
this.player = player;
|
this.player = player;
|
||||||
Block sourceblock = BlockSource.getWaterSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto, dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
Block sourceblock = BlockSource.getWaterSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
||||||
if (BlockSource.isAuto(sourceblock)) {
|
|
||||||
isAuto = true;
|
|
||||||
} else {
|
|
||||||
isAuto = false;
|
|
||||||
}
|
|
||||||
if (sourceblock == null) {
|
if (sourceblock == null) {
|
||||||
new SpikeField(player);
|
new SpikeField(player);
|
||||||
} else {
|
} else {
|
||||||
|
@ -410,11 +400,7 @@ public class IceSpike2 {
|
||||||
progressing = false;
|
progressing = false;
|
||||||
}
|
}
|
||||||
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
|
BendingPlayer bPlayer = GeneralMethods.getBendingPlayer(player.getName());
|
||||||
if (isAuto) {
|
bPlayer.addCooldown("IceSpike", GeneralMethods.getGlobalCooldown());
|
||||||
bPlayer.addCooldown("IceSpike", autocooldown);
|
|
||||||
} else {
|
|
||||||
bPlayer.addCooldown("IceSpike", GeneralMethods.getGlobalCooldown());
|
|
||||||
}
|
|
||||||
instances.remove(id);
|
instances.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class WaterArmsFreeze {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canPlaceBlock(Block block) {
|
private boolean canPlaceBlock(Block block) {
|
||||||
if (!EarthMethods.isTransparentToEarthbending(player, block) && !((WaterMethods.isWater(block) || WaterMethods.isIcebendable(block)) && TempBlock.isTempBlock(block))) {
|
if (!EarthMethods.isTransparentToEarthbending(player, block) && !((WaterMethods.isWater(block)) && TempBlock.isTempBlock(block))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (GeneralMethods.isRegionProtectedFromBuild(player, "WaterArms", block.getLocation())) {
|
if (GeneralMethods.isRegionProtectedFromBuild(player, "WaterArms", block.getLocation())) {
|
||||||
|
|
|
@ -57,12 +57,8 @@ public class WaterCombo {
|
||||||
public static long ICE_BULLET_SHOOT_TIME = ProjectKorra.plugin.getConfig().getLong(
|
public static long ICE_BULLET_SHOOT_TIME = ProjectKorra.plugin.getConfig().getLong(
|
||||||
"Abilities.Water.WaterCombo.IceBullet.ShootTime");
|
"Abilities.Water.WaterCombo.IceBullet.ShootTime");
|
||||||
private static int icebullet_selectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterCombo.IceBullet.SelectRange");
|
private static int icebullet_selectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterCombo.IceBullet.SelectRange");
|
||||||
private static int icebullet_autoSelectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterCombo.IceBullet.AutoSourcing.SelectRange");
|
|
||||||
private static boolean icebullet_auto = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.WaterCombo.IceBullet.AutoSourcing.Enabled");
|
|
||||||
private static long icebullet_autocooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Water.WaterCombo.IceBullet.AutoSourcing.Cooldown");
|
|
||||||
private static boolean icebullet_dynamic = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.IceBlast.DynamicSourcing.Enabled");
|
|
||||||
|
|
||||||
private boolean IceBulletisAuto;
|
//private boolean IceBulletisAuto;
|
||||||
|
|
||||||
public static ArrayList<WaterCombo> instances = new ArrayList<WaterCombo>();
|
public static ArrayList<WaterCombo> instances = new ArrayList<WaterCombo>();
|
||||||
public static ConcurrentHashMap<Block, TempBlock> frozenBlocks = new ConcurrentHashMap<Block, TempBlock>();
|
public static ConcurrentHashMap<Block, TempBlock> frozenBlocks = new ConcurrentHashMap<Block, TempBlock>();
|
||||||
|
@ -273,25 +269,17 @@ public class WaterCombo {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Block waterBlock = BlockSource.getWaterSourceBlock(player, icebullet_autoSelectRange, icebullet_selectRange, ClickType.SHIFT_DOWN, icebullet_auto, icebullet_dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
Block waterBlock = BlockSource.getWaterSourceBlock(player, icebullet_selectRange, icebullet_selectRange, ClickType.SHIFT_DOWN, false, false, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
||||||
if (waterBlock == null) {
|
if (waterBlock == null) {
|
||||||
remove();
|
remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (BlockSource.isAuto(waterBlock)) {
|
//IceBulletisAuto = false;
|
||||||
IceBulletisAuto = true;
|
|
||||||
} else {
|
|
||||||
IceBulletisAuto = false;
|
|
||||||
}
|
|
||||||
this.time = 0;
|
this.time = 0;
|
||||||
origin = waterBlock.getLocation();
|
origin = waterBlock.getLocation();
|
||||||
currentLoc = origin.clone();
|
currentLoc = origin.clone();
|
||||||
state = AbilityState.ICE_BULLET_FORMING;
|
state = AbilityState.ICE_BULLET_FORMING;
|
||||||
if (IceBulletisAuto) {
|
bplayer.addCooldown("IceBullet", cooldown);
|
||||||
bplayer.addCooldown("IceBullet", icebullet_autocooldown);
|
|
||||||
} else {
|
|
||||||
bplayer.addCooldown("IceBullet", cooldown);
|
|
||||||
}
|
|
||||||
direction = new Vector(1, 0, 1);
|
direction = new Vector(1, 0, 1);
|
||||||
waterGrabber = new WaterSourceGrabber(player, origin.clone());
|
waterGrabber = new WaterSourceGrabber(player, origin.clone());
|
||||||
} else if (waterGrabber.getState() == WaterSourceGrabber.AnimationState.FAILED) {
|
} else if (waterGrabber.getState() == WaterSourceGrabber.AnimationState.FAILED) {
|
||||||
|
|
|
@ -301,7 +301,7 @@ public class WaterMethods {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isIcebendable(Block block) {
|
public static boolean isIcebendable(Block block) {
|
||||||
if (block.getType() == Material.ICE)
|
if (block.getType() == Material.ICE || block.getType() == Material.SNOW)
|
||||||
return true;
|
return true;
|
||||||
if (block.getType() == Material.PACKED_ICE && plugin.getConfig().getBoolean("Properties.Water.CanBendPackedIce"))
|
if (block.getType() == Material.PACKED_ICE && plugin.getConfig().getBoolean("Properties.Water.CanBendPackedIce"))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
|
||||||
import com.projectkorra.projectkorra.Element;
|
import com.projectkorra.projectkorra.Element;
|
||||||
import com.projectkorra.projectkorra.GeneralMethods;
|
import com.projectkorra.projectkorra.GeneralMethods;
|
||||||
import com.projectkorra.projectkorra.ProjectKorra;
|
import com.projectkorra.projectkorra.ProjectKorra;
|
||||||
|
import com.projectkorra.projectkorra.SubElement;
|
||||||
import com.projectkorra.projectkorra.ability.AvatarState;
|
import com.projectkorra.projectkorra.ability.AvatarState;
|
||||||
import com.projectkorra.projectkorra.util.BlockSource;
|
import com.projectkorra.projectkorra.util.BlockSource;
|
||||||
import com.projectkorra.projectkorra.util.ClickType;
|
import com.projectkorra.projectkorra.util.ClickType;
|
||||||
|
@ -49,7 +50,6 @@ public class WaterWave {
|
||||||
private static int autoSelectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterSpout.Wave.AutoSourcing.SelectRange");
|
private static int autoSelectRange = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterSpout.Wave.AutoSourcing.SelectRange");
|
||||||
private static boolean auto = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.AutoSourcing.Enabled");
|
private static boolean auto = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.AutoSourcing.Enabled");
|
||||||
private static long autocooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Water.WaterSpout.Wave.AutoSourcing.Cooldown");
|
private static long autocooldown = ProjectKorra.plugin.getConfig().getLong("Abilities.Water.WaterSpout.Wave.AutoSourcing.Cooldown");
|
||||||
private static boolean dynamic = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.DynamicSourcing.Enabled");
|
|
||||||
|
|
||||||
private boolean isAuto;
|
private boolean isAuto;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public class WaterWave {
|
||||||
if (origin == null) {
|
if (origin == null) {
|
||||||
removeType(player, AbilityType.CLICK);
|
removeType(player, AbilityType.CLICK);
|
||||||
|
|
||||||
Block block = BlockSource.getWaterSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto, dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
Block block = BlockSource.getWaterSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto, false, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player));
|
||||||
if (block == null) {
|
if (block == null) {
|
||||||
if(instances.contains(this)) {
|
if(instances.contains(this)) {
|
||||||
remove();
|
remove();
|
||||||
|
@ -256,7 +256,7 @@ public class WaterWave {
|
||||||
if (entity != this.player && entity instanceof LivingEntity && !affectedEntities.contains(entity)) {
|
if (entity != this.player && entity instanceof LivingEntity && !affectedEntities.contains(entity)) {
|
||||||
affectedEntities.add(entity);
|
affectedEntities.add(entity);
|
||||||
final double aug = WaterMethods.getWaterbendingNightAugment(player.getWorld());
|
final double aug = WaterMethods.getWaterbendingNightAugment(player.getWorld());
|
||||||
GeneralMethods.damageEntity(player, entity, aug * damage, Element.Water, "WaterWave");
|
GeneralMethods.damageEntity(player, entity, aug * damage, Element.Water, SubElement.Icebending, "IceWave");
|
||||||
final Player fplayer = this.player;
|
final Player fplayer = this.player;
|
||||||
final Entity fent = entity;
|
final Entity fent = entity;
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: ProjectKorra
|
name: ProjectKorra
|
||||||
author: ProjectKorra
|
author: ProjectKorra
|
||||||
version: 1.8.0 BETA 6
|
version: 1.8.0 BETA 7
|
||||||
main: com.projectkorra.projectkorra.ProjectKorra
|
main: com.projectkorra.projectkorra.ProjectKorra
|
||||||
softdepend: [PreciousStones, WorldGuard, WorldEdit, Factions, MassiveCore, GriefPrevention, Towny, NoCheatPlus, LWC]
|
softdepend: [PreciousStones, WorldGuard, WorldEdit, Factions, MassiveCore, GriefPrevention, Towny, NoCheatPlus, LWC]
|
||||||
commands:
|
commands:
|
||||||
|
|
Loading…
Reference in a new issue