Examples of MemoryConfiguration


Examples of org.bukkit.configuration.MemoryConfiguration

  /**
   * Creates a new killstreak reward class with default options.
   */
  public KillstreakReward() {
    this(new MemoryConfiguration());
    section.set("3.privmsg", "You have been rewarded with some health for your kills.");
    section.set("3.reward.health", 8);
    section.set("4.reward.xp", 3);
    section.set("5.message", "{0} is on a &ckillstreak&f! 5 kills this life.");
    section.set("5.privmsg", "You have received some items for your kills.");
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

  /**
   * Create a new MySQL configuration section with default values.
   */
  public MySQLConfig() {
    this(new MemoryConfiguration());
    section.set("enabled", false);
    section.set("host", "localhost");
    section.set("port", 3306);
    section.set("database", "war");
    section.set("username", "root");
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

     * @param defaultConfig
     * @return
     */
    public static MemoryConfiguration getWorldsDefaultConfig(final ConfigFile defaultConfig){
      final char sep = defaultConfig.options().pathSeparator();
      final MemoryConfiguration config = new ConfigFile();
      config.options().pathSeparator(sep);
      final Map<String, Object> defaults = defaultConfig.getValues(false);
      for (final Entry<String, Object> entry : defaults.entrySet()){
        final String part = entry.getKey();
        if (!part.isEmpty() && !mayBeInWorldConfig(part)) continue;
        final Object value = entry.getValue();
        if (value instanceof ConfigurationSection) addWorldConfigSection(config, (ConfigurationSection) value, part, sep);
        else config.set(part, value);
      }
      return config;
    }
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

        }
//        globalConfig.setActionFactory();
        newWorldsMap.put(null, globalConfig);

       
        final MemoryConfiguration worldDefaults = PathUtils.getWorldsDefaultConfig(globalConfig);
       
        // Try to obtain and parse the world-specific configuration files.
        final HashMap<String, File> worldFiles = new HashMap<String, File>();
        if (plugin.getDataFolder().isDirectory()){
          for (final File file : plugin.getDataFolder().listFiles()){
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

   * @param location
   * @return
   */
  public static Map<String, Object> getXYZLocation(Location location) {
    // create configuration
    ConfigurationSection conf = new MemoryConfiguration();
    // define stuff
    conf.set("world", location.getWorld().getName());
    conf.set("x", location.getBlockX());
    conf.set("y", location.getBlockY());
    conf.set("z", location.getBlockZ());
   
    return conf.getValues(true);
  }
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

   * @param enabled
   * @return
   */
  public static Map<String, Object> getExactLocation(Location location, boolean enabled) {
    // create configuration
    ConfigurationSection conf = new MemoryConfiguration();
    // define stuff
    conf.set("enabled", enabled);
    conf.set("world", location.getWorld().getName());
    conf.set("x", location.getX());
    conf.set("y", location.getY());
    conf.set("z", location.getZ());
    conf.set("yaw", location.getYaw());
    conf.set("pitch", location.getPitch());
   
    return conf.getValues(true);
  }
View Full Code Here

Examples of org.bukkit.configuration.MemoryConfiguration

    private ConfigurationSection getSection(String name) {
        // make sure we don't NPE if users or groups is missing
        ConfigurationSection result = plugin.getNode(name);
        if (result == null) {
            result = new MemoryConfiguration();
        }
        return result;
    }
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.