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.
This commit is contained in:
Matt 2016-08-13 16:19:31 -04:00 committed by OmniCypher
parent 2ef30d15d7
commit cb219ca067
2 changed files with 17 additions and 14 deletions

View file

@ -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);

View file

@ -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;
}