Stupid Commit, will revert

This commit is contained in:
MistPhizzle 2014-08-08 10:21:41 -04:00
parent 962ae8ed13
commit b4b3186c46
2 changed files with 21 additions and 1 deletions

View file

@ -509,6 +509,25 @@ public class Methods {
return blocks;
}
public static List<Block> getBlocksAroundPointOnLevel(Location location, double radius, int level) {
List<Block> blocks = new ArrayList<Block>();
int xorg = location.getBlockX();
int zorg = location.getBlockZ();
int r = (int) radius * 4;
for (int x = xorg - r; x <= xorg + r; x++) {
for (int z = zorg - r; z <= zorg + r; z++) {
Block block = location.getWorld().getBlockAt(x, level, z);
if (block.getLocation().distance(location) <= radius) {
blocks.add(block);
}
}
}
return blocks;
}
/**
* Gets the Ability bound to the slot that the player is in.
* @param player The player to check

View file

@ -5,6 +5,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import com.projectkorra.ProjectKorra.Methods;
@ -35,7 +36,7 @@ public class FreezeMelt {
boolean cooldown = false;
Location location = Methods.getTargetedLocation(player, range);
for (Block block : Methods.getBlocksAroundPoint(location, radius)) {
for (Block block : Methods.getBlocksAroundPointOnLevel(location, radius, player.getLocation().getBlock().getRelative(BlockFace.DOWN).getY())) {
if (isFreezable(player, block)) {
freeze(player, block);
cooldown = true;