package dk.thoerup.bukkit.hoeruputils; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class SuperminerCommand implements CommandExecutor { @Override public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { if (!(sender instanceof Player)) { return false; } Player p = (Player) sender; World world = p.getWorld(); Location l = p.getLocation(); for (int x=-5; x<=5; x++) { for (int y=0; y<=5; y++) { for (int z=-5; z<=5; z++) { Block b = world.getBlockAt( l.getBlockX()+x, l.getBlockY()+y, l.getBlockZ()+z); int id = b.getTypeId(); if (id == 1 || id == 2 || id == 3 || id == 4 || id == 8 || id == 9 || id == 10 || id == 11 || id == 13) { b.setTypeId( 0 ); } } } } return true; } }