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 TypeMethodDescriptionvoiddefaultConfig(boolean reset) Method to create a default config file.voidMethod to do a version check on the configuration file.Method to read a value from the Config file.booleanreadModStatus(org.bukkit.entity.Player player, String mod) Method to read a player's mod using status.booleanreadPlayerAttributeStatus(org.bukkit.entity.Player player, String attribute) Method to read a player's attribute using status.voidMethod to write a value to the Config file.voidwriteModStatus(org.bukkit.entity.Player player, String mod, boolean isUsing) Method to write a player's mod using status.voidwritePlayerAttributeStatus(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
Stringvalue that was read
-
writeModStatus
Method to write a player's mod using status.- Parameters:
player- the targetPlayermod- the mod in questionisUsing-Trueif thePlayeris 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 targetPlayermod- the mod in question- Returns:
Trueif thePlayeris 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 targetPlayerattribute- the attribute in questionisUsing-Trueif 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 targetPlayerattribute- the attribute in question- Returns:
Trueif the attribute is active for thePlayer
-