From 2e0503f4d00c5c54730bf852714e7d3e89b591b1 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 28 Oct 2022 13:16:09 +0100 Subject: [PATCH] Added lrcdb --- .../boosters/commands/CommandBoosters.kt | 16 ++++++++++++++-- .../core-plugin/src/main/resources/lrcdb.yml | 19 +++++++++++++++++++ .../core-plugin/src/main/resources/plugin.yml | 8 ++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 eco-core/core-plugin/src/main/resources/lrcdb.yml diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandBoosters.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandBoosters.kt index 1c9e49c..d72e3a1 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandBoosters.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/boosters/commands/CommandBoosters.kt @@ -1,12 +1,15 @@ package com.willfp.boosters.commands +import com.willfp.boosters.boosters.Boosters import com.willfp.boosters.gui.BoosterGUI -import com.willfp.eco.core.EcoPlugin import com.willfp.libreforge.LibReforgePlugin +import com.willfp.libreforge.lrcdb.CommandExport +import com.willfp.libreforge.lrcdb.CommandImport +import com.willfp.libreforge.lrcdb.ExportableConfig import org.bukkit.command.CommandSender import org.bukkit.entity.Player -class CommandBoosters(plugin: com.willfp.eco.core.EcoPlugin) : +class CommandBoosters(plugin: LibReforgePlugin) : com.willfp.eco.core.command.impl.PluginCommand( plugin, "boosters", @@ -19,6 +22,15 @@ class CommandBoosters(plugin: com.willfp.eco.core.EcoPlugin) : .addSubcommand(CommandReload(plugin)) .addSubcommand(CommandCancel(plugin)) .addSubcommand(CommandActivate(plugin)) + .addSubcommand(CommandImport("boosters", plugin)) + .addSubcommand(CommandExport(plugin) { + Boosters.values().map { + ExportableConfig( + it.id, + it.config + ) + } + }) } override fun onExecute(sender: CommandSender, args: List) { diff --git a/eco-core/core-plugin/src/main/resources/lrcdb.yml b/eco-core/core-plugin/src/main/resources/lrcdb.yml new file mode 100644 index 0000000..a6272cd --- /dev/null +++ b/eco-core/core-plugin/src/main/resources/lrcdb.yml @@ -0,0 +1,19 @@ +# Options for lrcdb (https://lrcdb.auxilor.io), a website to share configs +# with other server owners, so you can get more configs without making them +# yourself! + +author: "Unknown Author" # The name attached to configs you export + +# Options about automatically sharing configs you create +share-configs: + # If you want all your configs to automatically be publicly available, + # set this to true. This really helps out other users! + publicly: false + + # If you don't want your configs to be usable to gather information about + # plugin usage or to improve the plugins in the future, disable this. + # Nothing identifying is shared. + enabled: true + +# If you disable share-configs, you can still share select configs publicly +# with /boosters export . \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/plugin.yml b/eco-core/core-plugin/src/main/resources/plugin.yml index ba2b1c1..66c70ef 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -43,6 +43,8 @@ permissions: boosters.command.boosters: true boosters.command.cancel: true boosters.command.activate: true + boosters.command.import: true + boosters.command.export: true boosters.command.reload: description: Allows reloading the config @@ -58,4 +60,10 @@ permissions: default: op boosters.command.cancel: description: Allows the use of /boosters cancel. + default: op + boosters.command.import: + description: Allows the use of /boosters import + default: op + boosters.command.export: + description: Allows the use of /boosters export default: op \ No newline at end of file