migrationQueue = new LinkedList<>();
- private FileConfiguration configuration = null;
/**
* Logs a message to the console
@@ -198,32 +193,13 @@ public class BooksWithoutBorders extends JavaPlugin {
getInstance().playerLetterIndex = new HashMap<>();
}
- @Override
- public void reloadConfig() {
- this.configuration = StargateYamlConfiguration.loadConfiguration(this, true);
- }
-
- @Override
- public void saveConfig() {
- StargateYamlConfiguration.saveConfiguration(this, this.configuration);
- }
-
- @Override
- @NotNull
- public FileConfiguration getConfig() {
- if (this.configuration == null) {
- this.reloadConfig();
- }
- return this.configuration;
- }
-
@Override
public void onEnable() {
booksWithoutBorders = this;
ConfigHelper.saveDefaults(this);
//Migrate from an earlier configuration file syntax if necessary
- if (this.configuration.getString("Options.Save_Books_in_Yaml_Format") != null) {
+ if (getConfig().getString("Options.Save_Books_in_Yaml_Format") != null) {
ConfigHelper.migrateConfig(this);
}
@@ -320,22 +296,6 @@ public class BooksWithoutBorders extends JavaPlugin {
registerCommand(BwBCommand.CREATE_BWB_SIGN.toString(), new CommandCreateBwBSign());
}
- /**
- * Registers a command
- *
- * @param commandName The name of the command to register
- * @param executor The executor to register for the command
- */
- private void registerCommand(@NotNull String commandName, @NotNull CommandExecutor executor) {
- PluginCommand pluginCommand = this.getCommand(commandName);
- if (pluginCommand != null) {
- pluginCommand.setExecutor(executor);
- } else {
- getLogger().log(Level.SEVERE, new FormatBuilder(StaticMessage.EXCEPTION_COMMAND_REGISTRATION_FAILED.toString()).
- replace(Placeholder.COMMAND, commandName).toString());
- }
- }
-
/**
* Initializes the plugin, loading and fixing the config file
*