Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void removeLava(Player player, Location location) {
- final int RADIUS = 2;
- Location top = location.clone().add(RADIUS, RADIUS, RADIUS);
- Location bottom = location.clone().subtract(RADIUS, RADIUS, RADIUS);
- for (int x = bottom.getBlockX(); x <= top.getBlockX(); x++) {
- for (int y = bottom.getBlockY(); y <= top.getBlockY(); y++) {
- for (int z = bottom.getBlockZ(); z <= top.getBlockZ(); z++) {
- Block block = location.getWorld().getBlockAt(x, y, z);
- if (block != null && (block.getType() == Material.LAVA || block.getType() == Material.STATIONARY_LAVA)) {
- if (canRemoveLava(player, block.getLocation())) {
- block.setType(Material.AIR);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement