mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
Various fixes (read desc.)
Removes Auto/Dynamic capabilities from various moves (shouldnt have had them) Fixes metalbending Fixes Dynamic Toggles not working correctly
This commit is contained in:
parent
4e23e4b7fd
commit
d89e177737
16 changed files with 59 additions and 81 deletions
|
@ -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", 2000);
|
|
||||||
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);
|
||||||
|
@ -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", false);
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
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;
|
||||||
|
@ -147,7 +148,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 +160,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 +189,12 @@ 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);
|
Bukkit.broadcastMessage("2");
|
||||||
} else {
|
return null;
|
||||||
return WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
|
||||||
}
|
}
|
||||||
|
Bukkit.broadcastMessage("1");
|
||||||
|
return WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -212,13 +213,20 @@ 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)) {
|
||||||
|
Bukkit.broadcastMessage("3");
|
||||||
|
sourceBlock = WaterMethods.getRandomWaterBlock(player, player.getLocation(), autoRange, water, ice, plant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourceBlock;
|
return sourceBlock;
|
||||||
|
@ -237,11 +245,15 @@ 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) {
|
if (blockInfo == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -252,8 +264,9 @@ public class BlockSource {
|
||||||
|
|
||||||
Location loc = tempBlock.getLocation();
|
Location loc = tempBlock.getLocation();
|
||||||
sourceBlock = EarthMethods.getNearbyEarthBlock(loc, autoRange, autoRange, earth, sand, metal);
|
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;
|
if (auto && (sourceBlock == null || !sourceBlock.getLocation().getWorld().equals(player.getWorld()) || Math.abs(sourceBlock.getLocation().distance(player.getEyeLocation())) > selectRange)) {
|
||||||
|
return EarthMethods.getRandomEarthBlock(player, player.getLocation(), autoRange, earth, sand, metal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sourceBlock;
|
return sourceBlock;
|
||||||
|
@ -269,13 +282,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;
|
||||||
|
|
|
@ -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", autocooldown);
|
|
||||||
} else {
|
|
||||||
bPlayer.addCooldown("IceSpike", GeneralMethods.getGlobalCooldown());
|
bPlayer.addCooldown("IceSpike", GeneralMethods.getGlobalCooldown());
|
||||||
}
|
|
||||||
instances.remove(id);
|
instances.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,6 @@ 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;
|
||||||
|
|
||||||
|
@ -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 = true;
|
|
||||||
} else {
|
|
||||||
IceBulletisAuto = false;
|
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", icebullet_autocooldown);
|
|
||||||
} else {
|
|
||||||
bplayer.addCooldown("IceBullet", cooldown);
|
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;
|
||||||
|
|
|
@ -49,7 +49,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 +111,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();
|
||||||
|
|
Loading…
Reference in a new issue