Beispiel #1
0
 public static Flag getSettingFlag(
     final PlotArea area, final PlotSettings settings, final String id) {
   Flag flag;
   if (settings.flags.isEmpty() || (flag = settings.flags.get(id)) == null) {
     if (area == null) {
       return null;
     }
     if (area.DEFAULT_FLAGS.isEmpty()) {
       return null;
     }
     return area.DEFAULT_FLAGS.get(id);
   }
   return flag;
 }
Beispiel #2
0
  public static HashMap<String, Flag> getPlotFlags(
      PlotArea area, final PlotSettings settings, final boolean ignorePluginflags) {
    final HashMap<String, Flag> flags = new HashMap<>();
    if (area != null && !area.DEFAULT_FLAGS.isEmpty()) {
      flags.putAll(area.DEFAULT_FLAGS);
    }
    if (ignorePluginflags) {
      for (final Map.Entry<String, Flag> flag : settings.flags.entrySet()) {
        if (isReserved(flag.getValue().getAbstractFlag().getKey())) {
          continue;
        }
        flags.put(flag.getKey(), flag.getValue());
      }
    } else {
      flags.putAll(settings.flags);
    }

    return flags;
  }