Example #1
0
 public void editResetTempAddCache(Region r) {
   YamlConfiguration c = r.getConfigFile();
   Map<String, Object> all = c.getValues(true);
   all.remove("Region.Permissions.TemporaryCache.AddNodes");
   for (Entry<String, Object> entry : all.entrySet()) {
     c.set(entry.getKey(), entry.getValue());
   }
   c.set("Region.Permissions.TemporaryCache.AddNodes", "");
   r.setTemporaryNodesCacheAdd(("").split(","));
   try {
     c.save(r.getRawConfigFile());
   } catch (IOException e) {
   }
 }
Example #2
0
 public void editRemoveFromPermRemoveCache(Region r, String message) {
   YamlConfiguration c = r.getConfigFile();
   Map<String, Object> all = c.getValues(true);
   String current = (String) all.get("Region.Permissions.PermanentCache.RemoveNodes");
   current = current.replaceAll(" ", "");
   current = current.replaceAll(message + ",", "");
   current = current.replaceAll(",,", ",");
   all.remove("Region.Permissions.PermanentCache.RemoveNodes");
   for (Entry<String, Object> entry : all.entrySet()) {
     c.set(entry.getKey(), entry.getValue());
   }
   c.set("Region.Permissions.PermanentCache.RemoveNodes", current.trim());
   r.setPermanentNodesCacheRemove((current.trim()).split(","));
 }
Example #3
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) {
   }
 }
Example #4
0
 public void editRemoveFromTempAddCache(Region r, String message) {
   YamlConfiguration c = r.getConfigFile();
   Map<String, Object> all = c.getValues(true);
   String current = (String) all.get("Region.Permissions.TemporaryCache.AddNodes");
   current = current.replaceAll(" ", "");
   current = current.replaceAll(message + ",", "");
   current = current.replaceAll(",,", ",");
   all.remove("Region.Permissions.TemporaryCache.AddNodes");
   for (Entry<String, Object> entry : all.entrySet()) {
     c.set(entry.getKey(), entry.getValue());
   }
   c.set("Region.Permissions.TemporaryCache.AddNodes", current.trim());
   r.setTemporaryNodesCacheAdd((current.trim()).split(","));
   try {
     c.save(r.getRawConfigFile());
   } catch (IOException e) {
   }
 }
Example #5
0
 public String listPermRemCache(Region r) {
   YamlConfiguration c = r.getConfigFile();
   String s = c.getString("Region.Permissions.PermanentCache.RemoveNodes", "");
   return s;
 }
Example #6
0
 public String listTempAddCache(Region r) {
   YamlConfiguration c = r.getConfigFile();
   String s = c.getString("Region.Permissions.TemporaryCache.AddNodes", "");
   return s;
 }