From cb219ca0676bb18b822188d28bd23b035ec32d68 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 13 Aug 2016 16:19:31 -0400 Subject: [PATCH] Various fixes (#540) * Various fixes -AirSwipe no longer goes through blocks -WaterSpout dosen't disappear when at max height * Revert "Various fixes" This reverts commit 4633e8381a230129a4ce3e72d309d1656f43ef30. * Revert "Revert "Various fixes"" This reverts commit 8f85f877378f71e2977ab28cd19dc955d9853dd4. --- .../projectkorra/airbending/AirSwipe.java | 5 ++++ .../projectkorra/waterbending/WaterSpout.java | 26 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/com/projectkorra/projectkorra/airbending/AirSwipe.java b/src/com/projectkorra/projectkorra/airbending/AirSwipe.java index 6369beca..d6ce7349 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirSwipe.java +++ b/src/com/projectkorra/projectkorra/airbending/AirSwipe.java @@ -141,6 +141,11 @@ public class AirSwipe extends AirAbility { } Block block = location.getBlock(); + if (!EarthAbility.isTransparent(player, block)) { + remove(); + return; + } + for (Block testblock : GeneralMethods.getBlocksAroundPoint(location, radius)) { if (testblock.getType() == Material.FIRE) { testblock.setType(Material.AIR); diff --git a/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java b/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java index 3b3fa377..0684f858 100644 --- a/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java +++ b/src/com/projectkorra/projectkorra/waterbending/WaterSpout.java @@ -1,11 +1,10 @@ package com.projectkorra.projectkorra.waterbending; -import com.projectkorra.projectkorra.GeneralMethods; -import com.projectkorra.projectkorra.ProjectKorra; -import com.projectkorra.projectkorra.ability.WaterAbility; -import com.projectkorra.projectkorra.util.Flight; -import com.projectkorra.projectkorra.util.ParticleEffect; -import com.projectkorra.projectkorra.util.TempBlock; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.concurrent.ConcurrentHashMap; import org.bukkit.Location; import org.bukkit.Material; @@ -13,11 +12,11 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffectType; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; +import com.projectkorra.projectkorra.GeneralMethods; +import com.projectkorra.projectkorra.ability.WaterAbility; +import com.projectkorra.projectkorra.util.Flight; +import com.projectkorra.projectkorra.util.ParticleEffect; +import com.projectkorra.projectkorra.util.TempBlock; public class WaterSpout extends WaterAbility { @@ -32,6 +31,7 @@ public class WaterSpout extends WaterAbility { private long interval; private double rotation; private double height; + private double maxHeight; private Block base; private TempBlock baseBlock; private boolean canFly; @@ -185,7 +185,6 @@ public class WaterSpout extends WaterAbility { return false; } double playerHeight = player.getLocation().getY(); - double maxHeight = isNight(player.getWorld()) ? getNightFactor(height) : height; if (playerHeight > baseBlockLocation.getY() + maxHeight + threshold) { return false; } @@ -233,7 +232,7 @@ public class WaterSpout extends WaterAbility { newHeight = getNightFactor(newHeight); } - double maxHeight = (height * ProjectKorra.plugin.getConfig().getDouble("Properties.Water.NightFactor")) + 5; + this.maxHeight = newHeight + 5; Block blocki; for (int i = 0; i < maxHeight; i++) { @@ -273,7 +272,6 @@ public class WaterSpout extends WaterAbility { } } } - revertBaseBlock(); return -1; }