Class Config

java.lang.Object
me.gigawartrex.smalladditions.io.FileHelper
me.gigawartrex.smalladditions.io.Config

public class Config extends FileHelper
Class to handle interactions with the plugin's config file.
Author:
Paul Ferlitz
  • Constructor Details

    • Config

      public Config()
      Class constructor.
  • Method Details

    • doVersionCheck

      public void doVersionCheck()
      Method to do a version check on the configuration file.
    • defaultConfig

      public void defaultConfig(boolean reset)
      Method to create a default config file.
      Parameters:
      reset - if the file should be reset to it's default
    • write

      public void write(String path, String value)
      Method to write a value to the Config file.
      Parameters:
      path - the YAML path to the values location
      value - the value to be written
    • read

      public String read(String path)
      Method to read a value from the Config file. Defaults to an empty String if the player has no entry.
      Parameters:
      path - the YAML path to the value
      Returns:
      the String value that was read
    • writeModStatus

      public void writeModStatus(org.bukkit.entity.Player player, String mod, boolean isUsing)
      Method to write a player's mod using status.
      Parameters:
      player - the target Player
      mod - the mod in question
      isUsing - True if the Player is using the mod
    • readModStatus

      public boolean readModStatus(org.bukkit.entity.Player player, String mod)
      Method to read a player's mod using status. Defaults to false if the player has no entry.
      Parameters:
      player - the target Player
      mod - the mod in question
      Returns:
      True if the Player is using the mod
    • writePlayerAttributeStatus

      public void writePlayerAttributeStatus(org.bukkit.entity.Player player, String attribute, boolean isUsing)
      Method to write a player's attribute using status.
      Parameters:
      player - the target Player
      attribute - the attribute in question
      isUsing - True if the attribute is active for the Player
    • readPlayerAttributeStatus

      public boolean readPlayerAttributeStatus(org.bukkit.entity.Player player, String attribute)
      Method to read a player's attribute using status. Defaults to false if the player has no entry.
      Parameters:
      player - the target Player
      attribute - the attribute in question
      Returns:
      True if the attribute is active for the Player