diff --git a/build.gradle b/build.gradle index e967182..4e8e699 100644 --- a/build.gradle +++ b/build.gradle @@ -45,7 +45,7 @@ allprojects { dependencies { compileOnly 'com.willfp:eco:6.43.0' - implementation 'com.willfp:libreforge:3.111.1' + implementation 'com.willfp:libreforge:3.112.0' implementation 'org.joml:joml:1.10.4' compileOnly 'org.jetbrains:annotations:23.0.0' diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/commands/CommandReforges.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/commands/CommandReforges.kt index 1c67d8d..9757e4b 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/commands/CommandReforges.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/reforges/commands/CommandReforges.kt @@ -1,10 +1,15 @@ package com.willfp.reforges.commands -import com.willfp.eco.core.EcoPlugin import com.willfp.eco.core.command.impl.PluginCommand +import com.willfp.libreforge.LibReforgePlugin +import com.willfp.libreforge.lrcdb.CommandExport +import com.willfp.libreforge.lrcdb.CommandImport +import com.willfp.libreforge.lrcdb.ExportableConfig +import com.willfp.reforges.reforges.Reforges import org.bukkit.command.CommandSender -class CommandReforges(plugin: EcoPlugin) : PluginCommand(plugin, "reforges", "reforges.command.reforges", false) { +class CommandReforges(plugin: LibReforgePlugin) : + PluginCommand(plugin, "reforges", "reforges.command.reforges", false) { override fun onExecute(sender: CommandSender, args: List) { sender.sendMessage( plugin.langYml.getMessage("invalid-command") @@ -16,5 +21,14 @@ class CommandReforges(plugin: EcoPlugin) : PluginCommand(plugin, "reforges", "re .addSubcommand(CommandGive(plugin)) .addSubcommand(CommandOpen(plugin)) .addSubcommand(CommandApply(plugin)) + .addSubcommand(CommandImport("reforges", plugin)) + .addSubcommand(CommandExport(plugin) { + Reforges.values().map { + ExportableConfig( + it.id, + it.config + ) + } + }) } -} \ No newline at end of file +} diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 994f900..0ba9ad8 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -194,6 +194,4 @@ potions: triggered: true particles: permanent: false - triggered: true - -share-configs: true # If your configs are allowed to be used to gather data and improve the plugin. Nothing identifying (IP, Name, etc) is shared. \ No newline at end of file + triggered: true \ No newline at end of file diff --git a/eco-core/core-plugin/src/main/resources/lang.yml b/eco-core/core-plugin/src/main/resources/lang.yml index 61c7d66..b44c96c 100644 --- a/eco-core/core-plugin/src/main/resources/lang.yml +++ b/eco-core/core-plugin/src/main/resources/lang.yml @@ -18,6 +18,13 @@ messages: invalid-reforge: "&cInvalid reforge!" needs-reforge: "&cYou must specify a reforge" cannot-transmit: "&cYou can't transmit here!" + must-specify-lrcdb-id: "&cYou must specify the ID of the config to download! Not sure what this means? Go to &alrcdb.auxilor.io" + lrcdb-import-error: "&cError importing config: &f%message%" + lrcdb-import-success: "&fImported &a%name%&f! Reload the plugin to install it" + must-specify-config-name: "&cYou must specify the config name!" + invalid-config-name: "&cInvalid config name!" + lrcdb-export-error: "&cError exporting config: &f%message%" + lrcdb-export-success: "&fExported &a%name%&f! View it on &alrcdb.auxilor.io&f, or share your config ID: &f%id%" menu: title: "Reforge Item" 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..92ca0a1 --- /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 /ecoenchants 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 a398d1e..cc04c4c 100644 --- a/eco-core/core-plugin/src/main/resources/plugin.yml +++ b/eco-core/core-plugin/src/main/resources/plugin.yml @@ -46,6 +46,8 @@ permissions: reforges.command.give: true reforges.command.apply: true reforges.command.open: true + reforges.command.import: true + reforges.command.export: true reforges.command.reload: description: Allows reloading the config @@ -65,3 +67,9 @@ permissions: reforges.command.apply: description: Allows the user of /reforges apply. default: op + reforges.command.import: + description: Allows the user of /reforges import. + default: op + reforges.command.export: + description: Allows the user of /reforges export. + default: op diff --git a/gradle.properties b/gradle.properties index 3651d9b..e5cd6b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ #libreforge-updater -#Mon Oct 10 21:04:09 BST 2022 -version=5.62.1 +#Thu Oct 13 20:12:38 BST 2022 +version=5.63.0 plugin-name=Reforges