Class SemiHardcoreYmlFile

java.lang.Object
me.manossef.semihardcore.files.SemiHardcoreYmlFile

public class SemiHardcoreYmlFile extends Object
Holds the information for a single YML file of this plugin. This class can be used by add-ons to make YML files specific to them.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SemiHardcoreYmlFile(org.bukkit.plugin.java.JavaPlugin plugin, String filename)
    Constructs a new holder for a YML file.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.configuration.file.FileConfiguration
    Returns the YML configuration of the file.
    void
    Reloads the configuration from the YML file.
    void
    Saves the configuration to the YML file.
    void
    Creates the file in the plugin's data folder if it does not exist.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SemiHardcoreYmlFile

      public SemiHardcoreYmlFile(org.bukkit.plugin.java.JavaPlugin plugin, String filename)
      Constructs a new holder for a YML file. The YML file in question will be created in the provided plugin's data folder if it does not yet exist, and it will contain the data found in the file with the same name in the plugin's jar file, if that file is found.
      Parameters:
      plugin - the plugin to give the YML file to
      filename - the filename. This should end in .yml
  • Method Details

    • reloadConfig

      public void reloadConfig()
      Reloads the configuration from the YML file. SemiHardcore's YML files don't support this operation, but add-ons can make their own files that do.
    • getConfig

      public org.bukkit.configuration.file.FileConfiguration getConfig()
      Returns the YML configuration of the file.
      Returns:
      the file configuration
    • saveConfig

      public void saveConfig()
      Saves the configuration to the YML file.
    • saveDefaultConfig

      public void saveDefaultConfig()
      Creates the file in the plugin's data folder if it does not exist. The created file will contain the data found in the file with the same name in the plugin's jar file, if that file is found. If the file already exists, this will not overwrite its data.