Forgot to apply files to commit

My b
This commit is contained in:
MistPhizzle 2014-06-14 14:59:36 -04:00
parent 41109c5251
commit 65dd2c3c80
2 changed files with 27 additions and 12 deletions

View file

@ -32,8 +32,10 @@ import org.bukkit.util.Vector;
import com.projectkorra.ProjectKorra.Ability.AbilityModule;
import com.projectkorra.ProjectKorra.Ability.AbilityModuleManager;
import com.projectkorra.ProjectKorra.earthbending.EarthPassive;
import com.projectkorra.ProjectKorra.waterbending.FreezeMelt;
import com.projectkorra.ProjectKorra.waterbending.WaterCore;
import com.projectkorra.abilities.RaiseEarth.EarthColumn;
import com.projectkorra.abilities.Surge.Surge;
public class Methods {
@ -341,8 +343,18 @@ public class Methods {
BlockFace[] faces = {BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH };
for (BlockFace face: faces) {
Block blocki = block.getRelative(face);
if (isWater(block) && blocki.getData() == full) sources++;
if (blocki.getType() == Material.ICE || blocki.getType() == Material.PACKED_ICE) sources++;
/*
* TODO : Checks for WaterManip and other abilities.
*/
if (isWater(block) && blocki.getData() == full) {
sources++;
}
if (FreezeMelt.frozenblocks.containsKey(blocki)) {
if (FreezeMelt.frozenblocks.get(blocki) == full) sources++;
} else if (blocki.getType() == Material.ICE){
sources++;
}
}
if (sources >= 2) return true;
return false;

View file

@ -1,5 +1,8 @@
package com.projectkorra.ProjectKorra.waterbending;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -14,7 +17,7 @@ import com.projectkorra.ProjectKorra.Ability.AbilityModuleManager;
public class WaterPassive {
private static double swimFactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Water.Passive.SwimSpeedFactor");
public static boolean applyNoFall(Player player) {
Block block = player.getLocation().getBlock();
Block fallblock = block.getRelative(BlockFace.DOWN);
@ -33,15 +36,15 @@ public class WaterPassive {
player.setVelocity(player.getEyeLocation().getDirection().clone().normalize().multiply(swimFactor));
}
}
if (player.getLocation().getBlock().isLiquid()) {
for (Block block: Methods.getBlocksAroundPoint(player.getLocation(), 2)) {
if (Methods.isAdjacentToThreeOrMoreSources(block) && Methods.isWater(block)) {
byte full = 0x0;
block.setType(Material.WATER);
block.setData(full);
}
}
}
// if (player.getLocation().getBlock().isLiquid()) {
// for (Block block: Methods.getBlocksAroundPoint(player.getLocation(), 2)) {
// if (Methods.isAdjacentToThreeOrMoreSources(block) && Methods.isWater(block) && !tempHaltPassive.contains(player.getName())) {
// byte full = 0x0;
// block.setType(Material.WATER);
// block.setData(full);
// }
// }
// }
}
}
}