Interface YAMLSection

All Known Subinterfaces:
AdditionsPlayerManager, YAMLConfig

public interface YAMLSection
Custom YAML section to handle all data retrieval from YAML files.
  • Method Details

    • save

      void save()
      Save the cached YAML file to the file system. This will get rid of the comments!
    • getString

      String getString(String property)
      Get a string.
      Parameters:
      property - Property to get the value of.
      Returns:
      String value.
    • getString

      String getString(String property, String defaultValue)
      Get a string.
      Parameters:
      property - Property to get the value of.
      defaultValue - String default value.
      Returns:
      String value.
    • getInt

      int getInt(String property)
      Get an integer.
      Parameters:
      property - Property to get the value of.
      Returns:
      Integer value.
    • getInt

      int getInt(String property, int defaultValue)
      Get an integer.
      Parameters:
      property - Property to get the value of.
      defaultValue - Integer default value.
      Returns:
      Integer value.
    • getLong

      long getLong(String property)
      Get a long.
      Parameters:
      property - Property to get the value of.
      Returns:
      Long value.
    • getLong

      long getLong(String property, long defaultValue)
      Get a long.
      Parameters:
      property - Property to get the value of.
      defaultValue - Long default value.
      Returns:
      Long value.
    • getStringList

      List<String> getStringList(String property)
      Get a List of strings.
      Parameters:
      property - Property to get the value of.
      Returns:
      List of strings.
    • getStringMap

      Map<String,String> getStringMap(String property)
      Get a string map.
      Parameters:
      property - Property to get the value of.
      Returns:
      Map of the keys and their values.
    • getDouble

      double getDouble(String property)
      Get a double.
      Parameters:
      property - Property to get the value of.
      Returns:
      Double value.
    • getDouble

      double getDouble(String property, double defaultValue)
      Get a double.
      Parameters:
      property - Property to get the value of.
      defaultValue - Double default value.
      Returns:
      Double value.
    • getBoolean

      boolean getBoolean(String property)
      Get a boolean.
      Parameters:
      property - Property to get the value of.
      Returns:
      Boolean value.
    • getBoolean

      boolean getBoolean(String property, boolean defaultValue)
      Get a boolean.
      Parameters:
      property - Property to get the value of.
      defaultValue - Boolean default value.
      Returns:
      Boolean value.
    • get

      Object get(String property)
      Get an object.
      Parameters:
      property - Property to get the value of.
      Returns:
      Object value.
    • get

      Object get(String property, Object defaultValue)
      Get an object.
      Parameters:
      property - Property to get the value of.
      defaultValue - Default Object
      Returns:
      Object value.
    • isSet

      boolean isSet(String property)
      Check whether a property has been set.
      Parameters:
      property - Property to check.
      Returns:
      True when set, false otherwise.
    • contains

      boolean contains(String property)
      Check whether the config contains the property.
      Parameters:
      property - Property to check.
      Returns:
      True on existence, false otherwise.
    • getKeys

      Set<String> getKeys(String property)
      Get a Set of keys.
      Parameters:
      property - Property to get the value of.
      Returns:
      Set of keys.
    • getMessage

      Message getMessage(String property)
      Get a message to send as chat/title.
      Parameters:
      property - Property to get the value of.
      Returns:
      Message object with the message.
    • getMessage

      Message getMessage(String property, String def)
      Get a message to send as chat/title.
      Parameters:
      property - Property to get the value of.
      def - Default value.
      Returns:
      Message object with the message.
    • getMessage

      Message getMessage(String property, List<String> def)
      Get a message to send as chat/title.
      Parameters:
      property - Property to get the value of.
      def - List Default value.
      Returns:
      Message object with the message.
    • getSection

      YAMLSection getSection(String property)
      Get a YAML section by key.
      Parameters:
      property - Property to get the section of.
      Returns:
      YAML section when found, null otherwise.
    • getItem

      AdditionsItem getItem(String identifier)
      Get the AdditionsItem from the current section. This searches the entire section for usable options.
      Parameters:
      identifier - The identifier of the item.
      Returns:
      AdditionsItem when found, null otherwise.
    • getEnchantments

      HashMap<org.bukkit.enchantments.Enchantment,Integer> getEnchantments(String property)
      Get a HashMap of Enchantment and their strengths.
      Parameters:
      property - Property to get the value of.
      Returns:
      HashMap of Enchantment and their strengths.
    • getItemFlags

      List<org.bukkit.inventory.ItemFlag> getItemFlags(String property)
      Get a List of ItemFlag.
      Parameters:
      property - Property to get the value of.
      Returns:
      List of ItemFlag.
    • getItemOptions

      List<ItemOption> getItemOptions(String property)
      Get a List of ItemOption.
      Parameters:
      property - Property to get the value of.
      Returns:
      List of ItemOption.
    • set

      void set(String property, Object value)
      Set a value to a key in the yaml config
      Parameters:
      property - The key to save the data to.
      value - The value to save.