package dk.thoerup.bukkit.hoeruputils; import org.bukkit.block.Block; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class StonerCommand 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=(l.getBlockX()-2); x<=(l.getBlockX()+2); x++) { for (int y=(l.getBlockY()-2); y<=(l.getBlockY()+2); y++) { for (int z=(l.getBlockZ()-2); z<=(l.getBlockZ()+2); z++) { Block block = world.getBlockAt(x,y,z); if (block.getTypeId() == 3 || block.getTypeId() == 4 || block.getTypeId() == 13) { block.setTypeId(1); } } } } return true; } }