ScriptSettings

public class ScriptSettings

Contains utility methods for saving/loading script settings. Note that any settings object that is saved/loaded must have the @DoNotRename annotation applied to all fields that should be saved/loaded. To skip a field, you can make it transient. Gson is used internally to serialize and deserialize the objects.

Types

ScriptSettingsBuilder
Link copied to clipboard
public class ScriptSettingsBuilder

Functions

builder
Link copied to clipboard
static ScriptSettings.ScriptSettingsBuilder builder()
delete
Link copied to clipboard
boolean delete(String name)
Attempts to delete the settings file at the specified path
getDefault
Link copied to clipboard
static ScriptSettings getDefault()
Creates a default script settings handler
getDirectory
Link copied to clipboard
File getDirectory()
Gets the base directory where script settings will save/load, based on the config.
getSaveNames
Link copied to clipboard
List<StringgetSaveNames()
Lists all the file names in the base directory where script settings will save/load.
load
Link copied to clipboard
Optional<Tload<T>(String name, Class<T> settingsType)
Attempts to load the specified settings type at the specified path.
save
Link copied to clipboard
boolean save<T>(String name, T scriptSettings)
Attempts to save the specified script settings object to the specified path