Fixed Airspout being able to be used after switching elements, also fixed being able to select multiple sources when using octopusform. (#506)

This commit is contained in:
Jay Stannon 2016-06-27 04:05:58 +10:00 committed by OmniCypher
parent dd6bc984ba
commit 2907952ca2
2 changed files with 12 additions and 5 deletions

View file

@ -1,15 +1,15 @@
package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.util.Flight;
import java.util.Random;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import java.util.Random;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.util.Flight;
public class AirSpout extends AirAbility {
@ -88,6 +88,11 @@ public class AirSpout extends AirAbility {
return;
}
if(!bPlayer.canBind(this)) {
remove();
return;
}
Block eyeBlock = player.getEyeLocation().getBlock();
if (eyeBlock.isLiquid() || GeneralMethods.isSolid(eyeBlock)) {
remove();

View file

@ -88,7 +88,9 @@ public class OctopusForm extends WaterAbility {
this.blocks = new ArrayList<TempBlock>();
this.newBlocks = new ArrayList<TempBlock>();
this.time = System.currentTimeMillis();
this.sourceBlock = BlockSource.getWaterSourceBlock(player, range, ClickType.LEFT_CLICK, true, true, bPlayer.canPlantbend());
if(!player.isSneaking()) {
this.sourceBlock = BlockSource.getWaterSourceBlock(player, range, ClickType.LEFT_CLICK, true, true, bPlayer.canPlantbend());
}
if (sourceBlock != null) {
sourceLocation = sourceBlock.getLocation();