Ejemplo n.º 1
0
 public void editResetPermAddCache(Region r) {
   YamlConfiguration c = r.getConfigFile();
   Map<String, Object> all = c.getValues(true);
   all.remove("Region.Permissions.PermanentCache.AddNodes");
   for (Entry<String, Object> entry : all.entrySet()) {
     c.set(entry.getKey(), entry.getValue());
   }
   c.set("Region.Permissions.PermanentCache.AddNodes", "");
   r.setPermanentNodesCacheAdd(("").split(","));
   try {
     c.save(r.getRawConfigFile());
   } catch (IOException e) {
   }
 }
Ejemplo n.º 2
0
 public void editAddToPermAddCache(Region r, String message) {
   YamlConfiguration c = r.getConfigFile();
   Map<String, Object> all = c.getValues(true);
   String current = (String) all.get("Region.Permissions.PermanentCache.AddNodes");
   all.remove("Region.Permissions.PermanentCache.AddNodes");
   for (Entry<String, Object> entry : all.entrySet()) {
     c.set(entry.getKey(), entry.getValue());
   }
   c.set("Region.Permissions.PermanentCache.AddNodes", current.trim() + message.trim() + ",");
   r.setPermanentNodesCacheAdd((current.trim() + "," + message.trim()).split(","));
   try {
     c.save(r.getRawConfigFile());
   } catch (IOException e) {
   }
 }