diff --git a/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java b/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java index 26090194..39b52cda 100644 --- a/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java +++ b/src/com/projectkorra/projectkorra/waterbending/SurgeWave.java @@ -44,7 +44,7 @@ public class SurgeWave extends WaterAbility { private Location frozenLocation; private Vector targetDirection; private ConcurrentHashMap waveBlocks; - private ConcurrentHashMap frozenBlocks; + private ConcurrentHashMap frozenBlocks; public SurgeWave(Player player) { super(player); @@ -137,17 +137,15 @@ public class SurgeWave extends WaterAbility { continue; } - if (block.getType() == Material.AIR || block.getType() == Material.SNOW) { + Block oldBlock = block; + if (block.getType() == Material.AIR || block.getType() == Material.SNOW || isWater(block)) { new TempBlock(block, Material.ICE, (byte) 0); - frozenBlocks.put(block, block); - } - if (isWater(block)) { - PhaseChangeFreeze.freeze(player, block); + frozenBlocks.put(block, oldBlock.getType()); } if (isPlant(block) && block.getType() != Material.LEAVES) { block.breakNaturally(); new TempBlock(block, Material.ICE, (byte) 0); - frozenBlocks.put(block, block); + frozenBlocks.put(block, oldBlock.getType()); } for (Block sound : frozenBlocks.keySet()) { if ((new Random()).nextInt(4) == 0) { @@ -364,7 +362,7 @@ public class SurgeWave extends WaterAbility { private void thaw() { for (Block block : frozenBlocks.keySet()) { - TempBlock.revertBlock(block, Material.AIR); + TempBlock.revertBlock(block, frozenBlocks.get(block)); frozenBlocks.remove(block); } } @@ -571,7 +569,7 @@ public class SurgeWave extends WaterAbility { return waveBlocks; } - public ConcurrentHashMap getFrozenBlocks() { + public ConcurrentHashMap getFrozenBlocks() { return frozenBlocks; } diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java b/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java index 5ad83947..3b3fa377 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java @@ -280,14 +280,16 @@ public class WaterSpout extends WaterAbility { public static boolean removeSpouts(Location loc0, double radius, Player sourcePlayer) { boolean removed = false; for (WaterSpout spout : getAbilities(WaterSpout.class)) { - Location top = spout.getLocation(); - Location base = spout.getBase().getLocation(); - double dist = top.getBlockY() - base.getBlockY(); - for (double d = 0; d <= dist; d += 0.5) { - Location spoutl = base.clone().add(0, d, 0); - if (loc0.distance(spoutl) <= radius) { - removed = true; - spout.remove(); + if (!spout.player.equals(sourcePlayer)) { + Location top = spout.getLocation(); + Location base = spout.getBase().getLocation(); + double dist = top.getBlockY() - base.getBlockY(); + for (double d = 0; d <= dist; d += 0.5) { + Location spoutl = base.clone().add(0, d, 0); + if (loc0.distance(spoutl) <= radius) { + removed = true; + spout.remove(); + } } } }