Fixes plant source issues & chat colour for clearing a slot (#519)

* Fixes plant regrowth for WaterArms & WaterSpoutWave

* Fixed chat colour for clearing a slot

* Fixed moves not removing spouts
This commit is contained in:
Loony 2016-07-23 02:30:23 +01:00 committed by OmniCypher
parent 3d77824286
commit ba05e47118
11 changed files with 35 additions and 5 deletions

View file

@ -25,6 +25,7 @@ import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.EarthPassive;
import com.projectkorra.projectkorra.earthbending.LavaFlow;
import com.projectkorra.projectkorra.earthbending.RaiseEarth;
import com.projectkorra.projectkorra.earthbending.SandSpout;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.Information;
import com.projectkorra.projectkorra.util.ParticleEffect;
@ -610,7 +611,7 @@ public abstract class EarthAbility extends ElementalAbility {
MOVED_EARTH.remove(block);
}
return true;
}
}
public static void stopBending() {
EarthPassive.removeAll();
@ -619,4 +620,11 @@ public abstract class EarthAbility extends ElementalAbility {
removeAllEarthbendedBlocks();
}
}
public static void removeSandSpouts(Location loc, double radius, Player source) {
SandSpout.removeSpouts(loc, radius, source);
}
public static void removeSandSpouts(Location loc, Player source) {
removeSandSpouts(loc, 1.5, source);
}
}

View file

@ -4,7 +4,9 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
@ -347,7 +349,9 @@ public class AirCombo extends AirAbility implements ComboAbility {
if (GeneralMethods.blockAbilities(player, FireCombo.getBlockableAbilities(), loc, 1)) {
fstream.remove();
}
} else AirAbility.removeAirSpouts(loc, player);
WaterAbility.removeWaterSpouts(loc, player);
EarthAbility.removeSandSpouts(loc, player);
}
}
}

View file

@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
@ -126,6 +127,8 @@ public class AirSwipe extends AirAbility {
} else {
removeAirSpouts(location, player);
WaterAbility.removeWaterSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
if (EarthBlast.annihilateBlasts(location, radius, player)
|| WaterManipulation.annihilateBlasts(location, radius, player)
@ -178,6 +181,7 @@ public class AirSwipe extends AirAbility {
private void affectPeople(Location location, Vector direction) {
WaterAbility.removeWaterSpouts(location, player);
removeAirSpouts(location, player);
removeAirSpouts(location, player);
final List<Entity> entities = GeneralMethods.getEntitiesAroundPoint(location, radius);
final Vector fDirection = direction;

View file

@ -63,7 +63,7 @@ public class ClearCommand extends PKCommand {
if (bPlayer.getAbilities().get(slot) != null) {
bPlayer.getAbilities().remove(slot);
GeneralMethods.saveAbility(bPlayer, slot, null);
sender.sendMessage(clearedSlot.replace("{slot}", String.valueOf(slot)));
sender.sendMessage(ChatColor.YELLOW + clearedSlot.replace("{slot}", String.valueOf(slot)));
} else {
sender.sendMessage(ChatColor.YELLOW + alreadyEmpty);
}

View file

@ -218,6 +218,7 @@ public class EarthBlast extends EarthAbility {
WaterAbility.removeWaterSpouts(location, player);
AirAbility.removeAirSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
if (block.getLocation().equals(sourceBlock.getLocation())) {
location = location.clone().add(direction);
@ -236,6 +237,7 @@ public class EarthBlast extends EarthAbility {
WaterAbility.removeWaterSpouts(location, player);
AirAbility.removeAirSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
if (EarthBlast.annihilateBlasts(location, collisionRadius, player)
|| WaterManipulation.annihilateBlasts(location, collisionRadius, player)

View file

@ -210,6 +210,7 @@ public class EarthSmash extends EarthAbility {
WaterAbility.removeWaterSpouts(location, 2, player);
AirAbility.removeAirSpouts(location, 2, player);
EarthAbility.removeSandSpouts(location, player);
draw();
return;
} else {

View file

@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.firebending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -193,6 +194,7 @@ public class FireBlast extends FireAbility {
WaterAbility.removeWaterSpouts(location, player);
AirAbility.removeAirSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
Player source = player;
if (EarthBlast.annihilateBlasts(location, collisionRadius, source)

View file

@ -18,6 +18,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.ElementalAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
@ -264,12 +265,14 @@ public class FireCombo extends FireAbility implements ComboAbility {
for (FireComboStream stream : tasks) {
if (GeneralMethods.blockAbilities(player, BLOCKABLE_ABILITIES, stream.location, 2)) {
stream.remove();
}
}
}
} else if (tasks.size() == 0) {
remove();
return;
}
} AirAbility.removeAirSpouts(location, player);
WaterAbility.removeWaterSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
} else if (ability.equalsIgnoreCase("FireSpin")) {
if (destination == null) {
if (bPlayer.isOnCooldown("FireSpin") && !bPlayer.isAvatarState()) {

View file

@ -12,6 +12,7 @@ import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.WaterArmsWhip.Whip;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
@ -151,6 +152,8 @@ public class WaterArms extends WaterAbility {
fullSource = false;
}
ParticleEffect.LARGE_SMOKE.display(getWaterSourceBlock(player, sourceGrabRange, canUsePlantSource).getLocation().clone().add(0.5, 0.5, 0.5), 0, 0, 0, 0F, 4);
new PlantRegrowth(player, sourceBlock);
sourceBlock.setType(Material.AIR);
return true;
} else if (WaterReturn.hasWaterBottle(player)) {
WaterReturn.emptyWaterBottle(player);

View file

@ -18,6 +18,7 @@ import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.earthbending.EarthBlast;
@ -231,6 +232,7 @@ public class WaterManipulation extends WaterAbility {
} else {
WaterAbility.removeWaterSpouts(location, player);
AirAbility.removeAirSpouts(location, player);
EarthAbility.removeSandSpouts(location, player);
if ((new Random()).nextInt(4) == 0) {
playWaterbendingSound(location);

View file

@ -176,6 +176,7 @@ public class WaterSpoutWave extends WaterAbility {
if (isPlant(origin.getBlock())) {
new PlantRegrowth(player, origin.getBlock());
origin.getBlock().setType(Material.AIR);
}
}