mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
parent
b4b3186c46
commit
e5fe2415b7
2 changed files with 1 additions and 21 deletions
|
@ -509,25 +509,6 @@ 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
|
||||
|
|
|
@ -5,7 +5,6 @@ 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;
|
||||
|
@ -36,7 +35,7 @@ public class FreezeMelt {
|
|||
boolean cooldown = false;
|
||||
|
||||
Location location = Methods.getTargetedLocation(player, range);
|
||||
for (Block block : Methods.getBlocksAroundPointOnLevel(location, radius, player.getLocation().getBlock().getRelative(BlockFace.DOWN).getY())) {
|
||||
for (Block block : Methods.getBlocksAroundPoint(location, radius)) {
|
||||
if (isFreezable(player, block)) {
|
||||
freeze(player, block);
|
||||
cooldown = true;
|
||||
|
|
Loading…
Reference in a new issue