mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-12-23 00:15:05 +00:00
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:
parent
9921181113
commit
f3ca5503cd
4 changed files with 8 additions and 6 deletions
|
@ -132,6 +132,8 @@ public class AirBubble extends AirAbility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WaterAbility.removeWaterSpouts(location, radius, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -260,14 +260,14 @@ public class WaterManipulation extends WaterAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trail2 != null) {
|
if (trail2 != null) {
|
||||||
if (trail2.getBlock().equals(block)) {
|
if (!TempBlock.isTempBlock(block) && (trail2.getBlock().equals(block))) {
|
||||||
trail2.revertBlock();
|
trail2.revertBlock();
|
||||||
trail2 = null;
|
trail2 = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trail != null) {
|
if (trail != null) {
|
||||||
if (trail.getBlock().equals(block)) {
|
if (!TempBlock.isTempBlock(block) && trail.getBlock().equals(block)) {
|
||||||
trail.revertBlock();
|
trail.revertBlock();
|
||||||
trail = null;
|
trail = null;
|
||||||
if (trail2 != null) {
|
if (trail2 != null) {
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class WaterSpout extends WaterAbility {
|
||||||
loc.add(x, height, z);
|
loc.add(x, height, z);
|
||||||
|
|
||||||
Block block = loc.getBlock();
|
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));
|
blocks.add(new TempBlock(block, Material.STATIONARY_WATER, (byte) 1));
|
||||||
AFFECTED_BLOCKS.put(block, block);
|
AFFECTED_BLOCKS.put(block, block);
|
||||||
}
|
}
|
||||||
|
@ -279,11 +279,11 @@ public class WaterSpout extends WaterAbility {
|
||||||
|
|
||||||
public static boolean removeSpouts(Location loc0, double radius, Player sourcePlayer) {
|
public static boolean removeSpouts(Location loc0, double radius, Player sourcePlayer) {
|
||||||
boolean removed = false;
|
boolean removed = false;
|
||||||
for (WaterSpout spout : getAbilities(sourcePlayer, WaterSpout.class)) {
|
for (WaterSpout spout : getAbilities(WaterSpout.class)) {
|
||||||
Location top = spout.getLocation();
|
Location top = spout.getLocation();
|
||||||
Location base = spout.getBase().getLocation();
|
Location base = spout.getBase().getLocation();
|
||||||
double dist = top.getBlockY() - base.getBlockY();
|
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);
|
Location spoutl = base.clone().add(0, d, 0);
|
||||||
if (loc0.distance(spoutl) <= radius) {
|
if (loc0.distance(spoutl) <= radius) {
|
||||||
removed = true;
|
removed = true;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: ProjectKorra
|
name: ProjectKorra
|
||||||
author: ProjectKorra
|
author: ProjectKorra
|
||||||
version: 1.8.0 BETA 12
|
version: 1.8.0 Pre
|
||||||
main: com.projectkorra.projectkorra.ProjectKorra
|
main: com.projectkorra.projectkorra.ProjectKorra
|
||||||
softdepend: [PreciousStones, WorldGuard, WorldEdit, Factions, MassiveCore, GriefPrevention, Towny, NoCheatPlus, LWC, Residence]
|
softdepend: [PreciousStones, WorldGuard, WorldEdit, Factions, MassiveCore, GriefPrevention, Towny, NoCheatPlus, LWC, Residence]
|
||||||
commands:
|
commands:
|
||||||
|
|
Loading…
Reference in a new issue