Examples of MemorySection


Examples of org.bukkit.configuration.MemorySection

  private void loadWaypoints(FileConfiguration config) {
    try {
      Object o = config.get("waypoints");
      if (o != null) {
        MemorySection mem = (MemorySection)o;
        Map<String, Object> worlds = getMemorySectionMap(mem);
        Iterator<Entry<String, Object>> i = worlds.entrySet().iterator();
        while (i.hasNext()) {
          Entry<String, Object> e = i.next();
          final String world = e.getKey().toLowerCase();
          if (e.getValue() instanceof MemorySection) {
            Map<String, Object> waypoints = getMemorySectionMap((MemorySection) e.getValue());
            Iterator<Entry<String, Object>> j = waypoints.entrySet().iterator();
            while (j.hasNext()) {
              Entry<String, Object> waypoint = j.next();
              MemorySection values = (MemorySection) waypoint.getValue();
              double x = values.getDouble("x");
              double y = values.getDouble("y");
              double z = values.getDouble("z");

              List<Waypoint> existing = ConfigReader.waypoints.get(world);
              if (existing == null) {
                existing = new LinkedList<Waypoint>();
                ConfigReader.waypoints.put(world, existing);
View Full Code Here

Examples of org.bukkit.configuration.MemorySection

  }

  private ConfigurationNode(ConfigurationNode source, String root) {
    this.readkeys = source.readkeys;
    this.headers = source.headers;
    MemorySection sect = (MemorySection) source.source.getConfigurationSection(root);
    if (sect == null) {
      this.source = (MemorySection) source.source.createSection(root);
    } else {
      this.source = sect;
    }
View Full Code Here

Examples of org.bukkit.configuration.MemorySection

   * Gets the parent configuration node of this Node
   *
   * @return parent node
   */
  public ConfigurationNode getParent() {
    MemorySection sec = (MemorySection) this.source.getParent();
    if (sec == null) {
      return null;
    }
    return new ConfigurationNode(this.readkeys, this.headers, sec);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.