Пример #1
0
  public void save() {
    Multimap<String, Multimap<String, String>> sections = LinkedListMultimap.create();
    for (Entry<Location, TrackedSign> entry : trackedSigns.entrySet()) {
      final TrackedSign trackedSign = entry.getValue();

      sections.put("sign", trackedSign.save());
    }

    Ini.save(plugin.getConfigFileName("signs.txt"), sections);
  }
Пример #2
0
  public void load() {
    trackedSigns.clear();

    final Multimap<String, Multimap<String, String>> sections =
        Ini.load(plugin.getConfigFileName("signs.txt"));
    if (sections == null) return;

    for (Multimap<String, String> section : sections.get("sign")) {
      final TrackedSign trackedSign = new TrackedSign(section);

      trackedSigns.put(trackedSign.getLocation(), trackedSign);
    }
  }