From db61b0d9798a10ba4da2ed0bd58f9bbb0cb1e07d Mon Sep 17 00:00:00 2001 From: Jay Stannon Date: Sat, 23 Jul 2016 13:30:31 +1000 Subject: [PATCH] Fixed torrent temp flooding and IceWave cooldown. * Fixed torrent temp flooding. * Fixed IceWave cooldown. --- .../projectkorra/waterbending/Torrent.java | 6 +++-- .../projectkorra/waterbending/WaterCombo.java | 27 ++++++++++--------- .../waterbending/WaterSpoutWave.java | 22 +++++++-------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/src/com/projectkorra/projectkorra/waterbending/Torrent.java b/src/com/projectkorra/projectkorra/waterbending/Torrent.java index 9789b036..5fd634d1 100644 --- a/src/com/projectkorra/projectkorra/waterbending/Torrent.java +++ b/src/com/projectkorra/projectkorra/waterbending/Torrent.java @@ -483,8 +483,10 @@ public class Torrent extends WaterAbility { Location eyeLoc = player.getEyeLocation(); Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock(); if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) { - block.setType(Material.WATER); - block.setData((byte) 8); + if(block.getType() != Material.WATER) { + block.setType(Material.STATIONARY_WATER); + block.setData((byte) 8); + } Torrent tor = new Torrent(player); if (tor.sourceSelected || tor.settingUp) { diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java b/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java index 0b477213..cbea3d28 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterCombo.java @@ -1,5 +1,18 @@ package com.projectkorra.projectkorra.waterbending; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.concurrent.ConcurrentHashMap; + +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Player; +import org.bukkit.scheduler.BukkitRunnable; +import org.bukkit.util.Vector; + import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.ComboAbility; @@ -14,19 +27,6 @@ import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.TempBlock; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.Block; -import org.bukkit.entity.Entity; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.Player; -import org.bukkit.scheduler.BukkitRunnable; -import org.bukkit.util.Vector; - -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.concurrent.ConcurrentHashMap; - /* * TODO: Combo classes should eventually be rewritten so that each combo is treated * as an individual ability. In the mean time, we will just place "fake" @@ -305,6 +305,7 @@ public class WaterCombo extends IceAbility implements ComboAbility { if (waterGrabber != null) { waterGrabber.remove(); } + bPlayer.addCooldown(this); } public void revertBlocks() { diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterSpoutWave.java b/src/com/projectkorra/projectkorra/waterbending/WaterSpoutWave.java index ef161129..73330ee1 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterSpoutWave.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterSpoutWave.java @@ -1,12 +1,9 @@ package com.projectkorra.projectkorra.waterbending; -import com.projectkorra.projectkorra.Element; -import com.projectkorra.projectkorra.GeneralMethods; -import com.projectkorra.projectkorra.ProjectKorra; -import com.projectkorra.projectkorra.ability.CoreAbility; -import com.projectkorra.projectkorra.ability.WaterAbility; -import com.projectkorra.projectkorra.util.DamageHandler; -import com.projectkorra.projectkorra.util.TempBlock; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.concurrent.ConcurrentHashMap; import org.bukkit.Location; import org.bukkit.Material; @@ -18,10 +15,13 @@ import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.util.Vector; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.concurrent.ConcurrentHashMap; +import com.projectkorra.projectkorra.Element; +import com.projectkorra.projectkorra.GeneralMethods; +import com.projectkorra.projectkorra.ProjectKorra; +import com.projectkorra.projectkorra.ability.CoreAbility; +import com.projectkorra.projectkorra.ability.WaterAbility; +import com.projectkorra.projectkorra.util.DamageHandler; +import com.projectkorra.projectkorra.util.TempBlock; public class WaterSpoutWave extends WaterAbility {