Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. //pode me ajudar a pegar um id que esta em string da config?? Já tentei com split, sem split, e não da.
  2. //Obs: O id, é tipo: 95:15 sabe?? Com date.
  3. //Vlw ae!
  4.         int bloc = cnf.getInt("Config.BlocoParedeID");
  5.         String blocoo = cnf.getString("Config.BlocoParedeID").split(":")[0];
  6.         boolean ehInt = false;
  7.         try{
  8.             Integer.parseInt(blocoo);
  9.             ehInt = true;
  10.         }catch (NumberFormatException e){
  11.             Bukkit.getConsoleSender().sendMessage("§cOps... Erro ao setar a parede!");
  12.             Bukkit.getConsoleSender().sendMessage("§cDelete a config, para ver se arruma.");
  13.         }
  14.         if(!ehInt){
  15.             Material bloco = Material.getMaterial(blocoo);
  16.             for(Block bl : c.getBlocks()){
  17.                 if(bl == null) continue;
  18.                 bl.setType(bloco);
  19.             }
  20.             for(Block bl2 : b.getBlocks()){
  21.                 if(bl2 == null) continue;
  22.                 bl2.setType(bloco);
  23.             }
  24.             return;
  25.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement