Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String ID = "0";
- Configuration config = new Configuration(new File(plugin.getDataFolder()+"/meaShop/items.yml"));
- config.load();
- String parts[] = name.split("\\:");
- try{
- BufferedReader in = new BufferedReader(new FileReader(new File(plugin.getDataFolder()+"/meaShop/items.yml")));
- String line;
- while((line = in.readLine()) != null){
- if(!line.startsWith(" Name") && !line.startsWith(" Aliases")){
- if(config.getString(line.replaceAll("\\:", "")+".Name").contains(parts[0]) ||
- config.getString(line.replaceAll("\\:", "")+".Aliases").contains(parts[0])){
- ID = line.replaceAll("\\:", "");
- break;
- }
- }
- }
- in.close();
- }catch (Exception e){
- e.printStackTrace();
- }
- return ID;
Advertisement
Add Comment
Please, Sign In to add comment