HashMap<String, Boolean> hm = new HashMap<String, Boolean>();
Random r = new Random();
public void onEnable() {
this.saveDefaultConfig();
if (this.getConfig().isConfigurationSection("hm")) {
for (String a : this.getConfig().getConfigurationSection("hm").getKeys(false)) {
hm.put(a, this.getConfig().getBoolean("hm." + a));
this.getConfig().set("hm." + a, null);
}
this.saveConfig();
}
System.out.print(hm);
putMap();
this.getServer().getPluginManager().registerEvents(this, this);
}
public void onDisable() {
for (String pn : hm.keySet()) {
this.getConfig().set("hm."+ pn, hm.get(pn));
}
this.saveConfig();
}
public void putMap() {
if (hm.isEmpty()) {
for (int i=0; i < 30; i ++) {
hm.put("player"+ r.nextInt(999999), r.nextBoolean());
}
}
System.out.print(hm);
}