Package me.gigawartrex.smalladditions.io
Class Config
java.lang.Object
me.gigawartrex.smalladditions.io.FileHelper
me.gigawartrex.smalladditions.io.Config
Class to handle interactions with the plugin's config file.
- Author:
- Paul Ferlitz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
defaultConfig
(boolean reset) Method to create a default config file.void
Method to do a version check on the configuration file.Method to read a value from the Config file.boolean
readModStatus
(org.bukkit.entity.Player player, String mod) Method to read a player's mod using status.boolean
readPlayerAttributeStatus
(org.bukkit.entity.Player player, String attribute) Method to read a player's attribute using status.void
Method to write a value to the Config file.void
writeModStatus
(org.bukkit.entity.Player player, String mod, boolean isUsing) Method to write a player's mod using status.void
writePlayerAttributeStatus
(org.bukkit.entity.Player player, String attribute, boolean isUsing) Method to write a player's attribute using status.Methods inherited from class me.gigawartrex.smalladditions.io.FileHelper
checkForFile, createFile, deleteFile, getFileName, loadFile, saveFile
-
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
Method to write a value to the Config file.- Parameters:
path
- the YAML path to the values locationvalue
- the value to be written
-
read
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
Method to write a player's mod using status.- Parameters:
player
- the targetPlayer
mod
- the mod in questionisUsing
-True
if thePlayer
is using the mod
-
readModStatus
Method to read a player's mod using status. Defaults to false if the player has no entry.- Parameters:
player
- the targetPlayer
mod
- the mod in question- Returns:
True
if thePlayer
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 targetPlayer
attribute
- the attribute in questionisUsing
-True
if the attribute is active for thePlayer
-
readPlayerAttributeStatus
Method to read a player's attribute using status. Defaults to false if the player has no entry.- Parameters:
player
- the targetPlayer
attribute
- the attribute in question- Returns:
True
if the attribute is active for thePlayer
-