Fixes WaterSpout flood and remove issues (#528)

WaterSpouts are now removed correctly when hit by a move or when a
bubble move is used underneath them.
This commit is contained in:
OmniCypher 2016-08-05 14:48:27 -07:00 committed by GitHub
parent 9921181113
commit f3ca5503cd
4 changed files with 8 additions and 6 deletions

View file

@ -132,6 +132,8 @@ public class AirBubble extends AirAbility {
}
}
}
WaterAbility.removeWaterSpouts(location, radius, player);
}
@Override

View file

@ -260,14 +260,14 @@ public class WaterManipulation extends WaterAbility {
}
if (trail2 != null) {
if (trail2.getBlock().equals(block)) {
if (!TempBlock.isTempBlock(block) && (trail2.getBlock().equals(block))) {
trail2.revertBlock();
trail2 = null;
}
}
if (trail != null) {
if (trail.getBlock().equals(block)) {
if (!TempBlock.isTempBlock(block) && trail.getBlock().equals(block)) {
trail.revertBlock();
trail = null;
if (trail2 != null) {

View file

@ -99,7 +99,7 @@ public class WaterSpout extends WaterAbility {
loc.add(x, height, z);
Block block = loc.getBlock();
if (block.getType().equals(Material.AIR) || !GeneralMethods.isSolid(block)) {
if ((!TempBlock.isTempBlock(block)) && (block.getType().equals(Material.AIR) || !GeneralMethods.isSolid(block))) {
blocks.add(new TempBlock(block, Material.STATIONARY_WATER, (byte) 1));
AFFECTED_BLOCKS.put(block, block);
}
@ -279,11 +279,11 @@ public class WaterSpout extends WaterAbility {
public static boolean removeSpouts(Location loc0, double radius, Player sourcePlayer) {
boolean removed = false;
for (WaterSpout spout : getAbilities(sourcePlayer, WaterSpout.class)) {
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.25) {
for (double d = 0; d <= dist; d += 0.5) {
Location spoutl = base.clone().add(0, d, 0);
if (loc0.distance(spoutl) <= radius) {
removed = true;

View file

@ -1,6 +1,6 @@
name: ProjectKorra
author: ProjectKorra
version: 1.8.0 BETA 12
version: 1.8.0 Pre
main: com.projectkorra.projectkorra.ProjectKorra
softdepend: [PreciousStones, WorldGuard, WorldEdit, Factions, MassiveCore, GriefPrevention, Towny, NoCheatPlus, LWC, Residence]
commands: