Add documentation to custom Plex events + config

This commit is contained in:
Taahh
2022-02-07 09:07:48 -08:00
committed by GitHub
parent 917775e7e7
commit bd8c772228
9 changed files with 100 additions and 4 deletions

View File

@ -4,12 +4,30 @@ import dev.plex.Plex;
import java.io.File;
import org.bukkit.configuration.file.YamlConfiguration;
/**
* Creates a custom Config object
*/
public class Config extends YamlConfiguration
{
/**
* The plugin instance
*/
private Plex plugin;
/**
* The File instance
*/
private File file;
/**
* The file name
*/
private String name;
/**
* Creates a config object
* @param plugin The plugin instance
* @param name The file name
*/
public Config(Plex plugin, String name)
{
this.plugin = plugin;
@ -22,6 +40,9 @@ public class Config extends YamlConfiguration
}
}
/**
* Loads the configuration file
*/
public void load()
{
try
@ -34,6 +55,9 @@ public class Config extends YamlConfiguration
}
}
/**
* Saves the configuration file
*/
public void save()
{
try
@ -46,6 +70,9 @@ public class Config extends YamlConfiguration
}
}
/**
* Moves the configuration file from the plugin's resources folder to the data folder (plugins/Plex/)
*/
private void saveDefault()
{
plugin.saveResource(name, false);