diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index 558ca01a..63f570d4 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -359,9 +359,6 @@ public class ConfigManager { config.addDefault("Abilities.Water.IceSpike.Projectile.Range", 20); config.addDefault("Abilities.Water.IceSpike.Projectile.Damage", 1); 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.OctopusForm.Enabled", true); @@ -475,8 +472,6 @@ public class ConfigManager { config.addDefault("Abilities.Water.WaterArms.Spear.NightAugments.Sphere.FullMoon", 6); 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.AutoSourcing.Enabled", false); 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."); @@ -510,7 +505,6 @@ public class ConfigManager { 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.SelectRange", 5); - config.addDefault("Abilities.Water.WaterSpout.Wave.DynamicSourcing.Enabled", true); config.addDefault("Abilities.Water.WaterCombo.Enabled", true); 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.ShootTime", 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("Properties.Earth.Passive.SandRunPower", 1); diff --git a/src/com/projectkorra/projectkorra/earthbending/Collapse.java b/src/com/projectkorra/projectkorra/earthbending/Collapse.java index eca17900..f9e53b9e 100644 --- a/src/com/projectkorra/projectkorra/earthbending/Collapse.java +++ b/src/com/projectkorra/projectkorra/earthbending/Collapse.java @@ -34,7 +34,7 @@ public class Collapse { return; 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; if (sblock == null) { location = player.getTargetBlock(EarthMethods.getTransparentEarthbending(), selectRange).getLocation(); diff --git a/src/com/projectkorra/projectkorra/earthbending/CompactColumn.java b/src/com/projectkorra/projectkorra/earthbending/CompactColumn.java index e8e9a55d..c7a22cb6 100644 --- a/src/com/projectkorra/projectkorra/earthbending/CompactColumn.java +++ b/src/com/projectkorra/projectkorra/earthbending/CompactColumn.java @@ -41,7 +41,7 @@ public class CompactColumn { if (bPlayer.isOnCooldown("Collapse")) 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) return; origin = block.getLocation(); diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthArmor.java b/src/com/projectkorra/projectkorra/earthbending/EarthArmor.java index 6f0db17f..5c216166 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthArmor.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthArmor.java @@ -59,7 +59,7 @@ public class EarthArmor { return; 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)) { bPlayer.addCooldown("EarthArmor", autocooldown); } else { diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java b/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java index 2f8e0099..460cf6b2 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthBlast.java @@ -83,8 +83,8 @@ public class EarthBlast { public boolean prepare() { cancelPrevious(); - Block block = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, dynamic, auto, - dynamic, true, EarthMethods.canSandbend(player), false); + Block block = BlockSource.getEarthSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto, + dynamic, true, EarthMethods.canSandbend(player), EarthMethods.canMetalbend(player)); block(player); if (block != null) { if (block.getLocation().distance(player.getLocation()) > selectRange) { diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthColumn.java b/src/com/projectkorra/projectkorra/earthbending/EarthColumn.java index a81e1446..ba76e08d 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthColumn.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthColumn.java @@ -49,7 +49,7 @@ public class EarthColumn { if (AvatarState.isAvatarState(player)) { 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) return; origin = block.getLocation(); diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthWall.java b/src/com/projectkorra/projectkorra/earthbending/EarthWall.java index edd4ab19..132e0888 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthWall.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthWall.java @@ -45,7 +45,7 @@ public class EarthWall { Vector orth = new Vector(ox, oy, oz); 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) { Location origin = sblock.getLocation(); World world = origin.getWorld(); diff --git a/src/com/projectkorra/projectkorra/earthbending/LavaFlow.java b/src/com/projectkorra/projectkorra/earthbending/LavaFlow.java index f7da6d84..5099c21c 100644 --- a/src/com/projectkorra/projectkorra/earthbending/LavaFlow.java +++ b/src/com/projectkorra/projectkorra/earthbending/LavaFlow.java @@ -168,7 +168,7 @@ public class LavaFlow { } instances.add(this); } 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) { remove(); return; diff --git a/src/com/projectkorra/projectkorra/earthbending/LavaSurge.java b/src/com/projectkorra/projectkorra/earthbending/LavaSurge.java index 72ccc7bc..e2db54ba 100644 --- a/src/com/projectkorra/projectkorra/earthbending/LavaSurge.java +++ b/src/com/projectkorra/projectkorra/earthbending/LavaSurge.java @@ -102,7 +102,7 @@ public class LavaSurge { 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 || !(targetBlock.getRelative(BlockFace.UP).getType() == Material.AIR) && diff --git a/src/com/projectkorra/projectkorra/earthbending/LavaWall.java b/src/com/projectkorra/projectkorra/earthbending/LavaWall.java index 2692d288..246be03a 100644 --- a/src/com/projectkorra/projectkorra/earthbending/LavaWall.java +++ b/src/com/projectkorra/projectkorra/earthbending/LavaWall.java @@ -68,7 +68,7 @@ public class LavaWall { public boolean prepare() { 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) { sourceblock = block; focusBlock(); diff --git a/src/com/projectkorra/projectkorra/earthbending/LavaWave.java b/src/com/projectkorra/projectkorra/earthbending/LavaWave.java index 2d406d95..8bd96cac 100644 --- a/src/com/projectkorra/projectkorra/earthbending/LavaWave.java +++ b/src/com/projectkorra/projectkorra/earthbending/LavaWave.java @@ -67,7 +67,7 @@ public class LavaWave { public boolean prepare() { cancelPrevious(); // 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) { sourceblock = block; focusBlock(); diff --git a/src/com/projectkorra/projectkorra/util/BlockSource.java b/src/com/projectkorra/projectkorra/util/BlockSource.java index 3e185092..ae2dd96c 100644 --- a/src/com/projectkorra/projectkorra/util/BlockSource.java +++ b/src/com/projectkorra/projectkorra/util/BlockSource.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.block.Block; 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) { update(player, selectRange, clickType); BlockSourceInformation info = getValidBlockSourceInformation(player, selectRange, sourceType, clickType); - if (info != null && dynamic) { + if (info != null) { Block tempBlock = info.getBlock(); if (EarthMethods.isEarthbendable(tempBlock.getType()) && earth) { return tempBlock; @@ -159,11 +160,10 @@ public class BlockSource { return tempBlock; } } - if (auto) { - return EarthMethods.getRandomEarthBlock(player, player.getLocation(), autoRange, earth, sand, metal); - } else { - return EarthMethods.getEarthSourceBlock(player, selectRange, earth, sand, metal); + if (info == null && dynamic) { + return null; } + return EarthMethods.getEarthSourceBlock(player, selectRange, earth, sand, metal); } /** @@ -189,11 +189,12 @@ public class BlockSource { return info.getBlock(); } } - if (auto) { - return WaterMethods.getRandomWaterBlock(player, player.getLocation(), autoRange, water, ice, plant); - } else { - return WaterMethods.getWaterSourceBlock(player, selectRange, water, ice, plant); + if (info == null && dynamic) { + Bukkit.broadcastMessage("2"); + return null; } + 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. */ 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) { // Check the block in front of the player's eyes, it may have been created by a // WaterBottle. 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; @@ -237,23 +245,28 @@ public class BlockSource { * block. * @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) { - Block sourceBlock = getDynamicEarthSourceBlock(player, autoRange, selectRange, BlockSourceType.EARTH, clickType, auto, dynamic, earth, sand, metal); - if (!auto && nearby && sourceBlock == null) { + public static Block getEarthSourceBlock(Player player, int autoRange, int selectRange, ClickType clickType, boolean auto, boolean dynamic, boolean earth, boolean sand, boolean metal) { + Block 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); + if (dynamic) { + if (blockInfo == null) { + return null; + } + Block tempBlock = blockInfo.getBlock(); + if (tempBlock == null) { + return null; + } - if (blockInfo == null) { - return null; + Location loc = tempBlock.getLocation(); + sourceBlock = EarthMethods.getNearbyEarthBlock(loc, autoRange, autoRange, earth, sand, metal); } - Block tempBlock = blockInfo.getBlock(); - if (tempBlock == null) { - 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; + 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; @@ -269,13 +282,13 @@ public class BlockSource { * either {@link ClickType}.SHIFT_DOWN or ClickType.LEFT_CLICK. * @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 * previous Earth based source. Only one of these types can exist, so if * 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); if (earthBlock != null) { return earthBlock; diff --git a/src/com/projectkorra/projectkorra/waterbending/IceSpike2.java b/src/com/projectkorra/projectkorra/waterbending/IceSpike2.java index 353622ab..bde822cb 100644 --- a/src/com/projectkorra/projectkorra/waterbending/IceSpike2.java +++ b/src/com/projectkorra/projectkorra/waterbending/IceSpike2.java @@ -34,9 +34,6 @@ public class IceSpike2 { static long slowCooldown = 5000; 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 final long interval = 20; @@ -58,8 +55,6 @@ public class IceSpike2 { private TempBlock source; private double defaultrange = RANGE; private double defaultdamage = DAMAGE; - - private boolean isAuto; public IceSpike2(Player player) { if (!WaterMethods.canIcebend(player)) @@ -67,12 +62,7 @@ public class IceSpike2 { block(player); this.player = player; - Block sourceblock = BlockSource.getWaterSourceBlock(player, autoSelectRange, selectRange, ClickType.SHIFT_DOWN, auto, dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player)); - if (BlockSource.isAuto(sourceblock)) { - isAuto = true; - } else { - isAuto = false; - } + Block sourceblock = BlockSource.getWaterSourceBlock(player, selectRange, selectRange, ClickType.SHIFT_DOWN, false, dynamic, true, true, WaterMethods.canIcebend(player), WaterMethods.canPlantbend(player)); if (sourceblock == null) { new SpikeField(player); } else { @@ -410,11 +400,7 @@ public class IceSpike2 { progressing = false; } 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); } diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java b/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java index 6bb89933..768c34e2 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java @@ -57,10 +57,6 @@ public class WaterCombo { public static long ICE_BULLET_SHOOT_TIME = ProjectKorra.plugin.getConfig().getLong( "Abilities.Water.WaterCombo.IceBullet.ShootTime"); 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; @@ -273,25 +269,17 @@ public class WaterCombo { remove(); 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) { remove(); return; } - if (BlockSource.isAuto(waterBlock)) { - IceBulletisAuto = true; - } else { - IceBulletisAuto = false; - } + IceBulletisAuto = false; this.time = 0; origin = waterBlock.getLocation(); currentLoc = origin.clone(); 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); waterGrabber = new WaterSourceGrabber(player, origin.clone()); } else if (waterGrabber.getState() == WaterSourceGrabber.AnimationState.FAILED) { diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterMethods.java b/src/com/projectkorra/projectkorra/waterbending/WaterMethods.java index 5a8be3be..875f2bc0 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterMethods.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterMethods.java @@ -301,7 +301,7 @@ public class WaterMethods { } public static boolean isIcebendable(Block block) { - if (block.getType() == Material.ICE) + if (block.getType() == Material.ICE || block.getType() == Material.SNOW) return true; if (block.getType() == Material.PACKED_ICE && plugin.getConfig().getBoolean("Properties.Water.CanBendPackedIce")) return true; diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterWave.java b/src/com/projectkorra/projectkorra/waterbending/WaterWave.java index 73526adc..f420530d 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterWave.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterWave.java @@ -49,7 +49,6 @@ public class WaterWave { 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 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; @@ -112,7 +111,7 @@ public class WaterWave { if (origin == null) { 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(instances.contains(this)) { remove();