turt2live

Untitled

Dec 1st, 2011
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. String ID = "0";
  2. Configuration config = new Configuration(new File(plugin.getDataFolder()+"/meaShop/items.yml"));
  3. config.load();
  4. String parts[] = name.split("\\:");
  5. try{
  6.     BufferedReader in = new BufferedReader(new FileReader(new File(plugin.getDataFolder()+"/meaShop/items.yml")));
  7.     String line;
  8.     while((line = in.readLine()) != null){
  9.         if(!line.startsWith("    Name") && !line.startsWith("    Aliases")){
  10.             if(config.getString(line.replaceAll("\\:", "")+".Name").contains(parts[0]) ||
  11.                     config.getString(line.replaceAll("\\:", "")+".Aliases").contains(parts[0])){
  12.                 ID = line.replaceAll("\\:", "");
  13.                 break;
  14.             }
  15.         }
  16.     }
  17.     in.close();
  18. }catch (Exception e){
  19.     e.printStackTrace();
  20. }
  21. return ID;
  22.  
Advertisement
Add Comment
Please, Sign In to add comment