Fixed torrent not working under water, also fixed the ear bleeding that is icespike. (#512)

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

* Fixed torrent not working under water, added some bubbles to show it when it is under water.

also fixed the ear bleeding that is icespike.
This commit is contained in:
Jay Stannon 2016-07-05 17:19:32 +10:00 committed by OmniCypher
parent 6651be1032
commit f456ba5f0e
3 changed files with 27 additions and 9 deletions

View file

@ -113,6 +113,11 @@ public class AirSpout extends AirAbility {
remove();
return;
}
if(!bPlayer.canBind(this)) {
remove();
return;
}
Block eyeBlock = player.getEyeLocation().getBlock();
if (eyeBlock.isLiquid() || GeneralMethods.isSolid(eyeBlock)) {

View file

@ -55,7 +55,10 @@ public class IceSpikePillarField extends IceAbility {
&& testBlock.getZ() == player.getEyeLocation().getBlock().getZ())) {
iceBlocks.add(testBlock);
for (int i = 0; i < iceBlocks.size() / 2 + 1; i++) {
playIcebendingSound(iceBlocks.get(i).getLocation());
Random rand = new Random();
if(rand.nextInt(5)==0) {
playIcebendingSound(iceBlocks.get(i).getLocation());
}
}
}
}

View file

@ -198,14 +198,13 @@ public class Torrent extends WaterAbility {
source.revertBlock();
source = null;
Block block = location.getBlock();
if (!isTransparent(player, block) || block.isLiquid()) {
if (!isTransparent(player, block)) {
remove();
return;
}
source = new TempBlock(location.getBlock(), Material.STATIONARY_WATER, (byte) 8);
}
}
if (forming && !player.isSneaking()) {
location = player.getEyeLocation().add(radius, 0, 0);
remove();
@ -216,6 +215,18 @@ public class Torrent extends WaterAbility {
if ((new Random()).nextInt(4) == 0) {
playWaterbendingSound(location);
}
for (double theta = startAngle; theta < angle + startAngle; theta += 20) {
Location loc = player.getEyeLocation();
double phi = Math.toRadians(theta);
double dx = Math.cos(phi) * radius;
double dy = 0;
double dz = Math.sin(phi) * radius;
loc.add(dx, dy, dz);
if(GeneralMethods.isAdjacentToThreeOrMoreSources(loc.getBlock())) {
ParticleEffect.WATER_BUBBLE.display((float) Math.random(), (float) Math.random(), (float) Math.random(), 0f, 5, loc.getBlock().getLocation().clone().add(.5,.5,.5), 257D);
}
loc.subtract(dx, dy, dz);
}
if (angle < 220) {
angle += 20;
} else {
@ -228,6 +239,7 @@ public class Torrent extends WaterAbility {
remove();
return;
}
}
if (formed && !player.isSneaking() && !launch) {
@ -283,7 +295,7 @@ public class Torrent extends WaterAbility {
Block block = blockloc.getBlock();
if (!doneBlocks.contains(block) && !GeneralMethods.isRegionProtectedFromBuild(this, blockloc)) {
if (isTransparent(player, block) && !block.isLiquid()) {
if (isTransparent(player, block)) {
launchedBlocks.add(new TempBlock(block, Material.STATIONARY_WATER, (byte) 8));
doneBlocks.add(block);
} else if (!isTransparent(player, block)) {
@ -415,12 +427,10 @@ public class Torrent extends WaterAbility {
double dz = Math.sin(phi) * radius;
Location blockLoc = loc.clone().add(dx, dy, dz);
Block block = blockLoc.getBlock();
if (!doneBlocks.contains(block)) {
if (isTransparent(player, block) && !block.isLiquid()) {
blocks.add(new TempBlock(block, Material.STATIONARY_WATER, (byte) 8));
doneBlocks.add(block);
if (isTransparent(player, block)) {
blocks.add(new TempBlock(block, Material.STATIONARY_WATER, (byte) 8));
doneBlocks.add(block);
for (Entity entity : entities) {
if (entity.getWorld() != blockLoc.getWorld()) {
continue;