config.yml: Messages als liste auslesen

This commit is contained in:
Frank Baumann 2012-12-10 18:27:06 +01:00
parent db762d102a
commit 5adac9a10d

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import org.bukkit.Material; import org.bukkit.Material;
@ -91,14 +92,13 @@ public class ConfigReader {
}while(configFile.contains(preString)); }while(configFile.contains(preString));
//Read Messages //Read Messages
id=0; Set<String> list=configFile.getKeys(true);
do{ for(String messagePath:list){
id++; if(messagePath.contains("message.")){
preString="message."+id; int messageId=Integer.parseInt(messagePath.replace("message.",""));
if(configFile.contains(preString)){ this.msgs.put(messageId,configFile.getString(messagePath));
this.msgs.put(id,configFile.getString(preString));
} }
}while(configFile.contains(preString)); }
//Read Secure Objects //Read Secure Objects
if(configFile.contains("secureobjects")){ if(configFile.contains("secureobjects")){