diff --git a/defaultconfigs/1.18/config.yml b/defaultconfigs/1.18/config.yml index 872ea2e..9fbdb5c 100644 --- a/defaultconfigs/1.18/config.yml +++ b/defaultconfigs/1.18/config.yml @@ -99,6 +99,16 @@ permission_needed_for_color: true # Valid values include 0 to 1000. use_of_color_cost: 0 +# Dialogue rename menu make use of dialog menu to allow bigger rename +# You can change the maximum size +# +# At the moment only english is available for this menu... sorry ! +# +# CustomAnvil use "ca.rename.dialog" when permission +enable_dialog_rename: false +dialog_rename_max_size: 256 +permission_needed_for_dialog_rename: false + # Override limits for specific enchants # # Enchantments not listed here will use the value of default_limit diff --git a/defaultconfigs/1.21.11/config.yml b/defaultconfigs/1.21.11/config.yml index bbfcb88..a3bcd76 100644 --- a/defaultconfigs/1.21.11/config.yml +++ b/defaultconfigs/1.21.11/config.yml @@ -101,6 +101,16 @@ permission_needed_for_color: true # Valid values include 0 to 1000. use_of_color_cost: 0 +# Dialogue rename menu make use of dialog menu to allow bigger rename +# You can change the maximum size +# +# At the moment only english is available for this menu... sorry ! +# +# CustomAnvil use "ca.rename.dialog" when permission +enable_dialog_rename: false +dialog_rename_max_size: 256 +permission_needed_for_dialog_rename: false + # Override limits for specific enchants # # Enchantments not listed here will use the value of default_limit diff --git a/defaultconfigs/1.21.9/config.yml b/defaultconfigs/1.21.9/config.yml index 0d4f810..4d88d1b 100644 --- a/defaultconfigs/1.21.9/config.yml +++ b/defaultconfigs/1.21.9/config.yml @@ -99,6 +99,16 @@ permission_needed_for_color: true # Valid values include 0 to 1000. use_of_color_cost: 0 +# Dialogue rename menu make use of dialog menu to allow bigger rename +# You can change the maximum size +# +# At the moment only english is available for this menu... sorry ! +# +# CustomAnvil use "ca.rename.dialog" when permission +enable_dialog_rename: false +dialog_rename_max_size: 256 +permission_needed_for_dialog_rename: false + # Override limits for specific enchants # # Enchantments not listed here will use the value of default_limit diff --git a/defaultconfigs/1.21/config.yml b/defaultconfigs/1.21/config.yml index 24df643..8549ca2 100644 --- a/defaultconfigs/1.21/config.yml +++ b/defaultconfigs/1.21/config.yml @@ -99,6 +99,16 @@ permission_needed_for_color: true # Valid values include 0 to 1000. use_of_color_cost: 0 +# Dialogue rename menu make use of dialog menu to allow bigger rename +# You can change the maximum size +# +# At the moment only english is available for this menu... sorry ! +# +# CustomAnvil use "ca.rename.dialog" when permission +enable_dialog_rename: false +dialog_rename_max_size: 256 +permission_needed_for_dialog_rename: false + # Override limits for specific enchants # # Enchantments not listed here will use the value of default_limit diff --git a/src/main/kotlin/io/delilaheve/util/ConfigOptions.kt b/src/main/kotlin/io/delilaheve/util/ConfigOptions.kt index b6aa3d7..7b7a18e 100644 --- a/src/main/kotlin/io/delilaheve/util/ConfigOptions.kt +++ b/src/main/kotlin/io/delilaheve/util/ConfigOptions.kt @@ -61,6 +61,12 @@ object ConfigOptions { const val ENCHANT_LIMIT_ROOT = "enchant_limits" const val ENCHANT_VALUES_ROOT = "enchant_values" + // Dialog menu rename + const val DIALOG_RENAME_ENABLED = "enable_dialog_rename" + const val DIALOG_MAX_SIZE = "dialog_rename_max_size" + const val DIALOG_RENAME_USE_PERMISSION = "permission_needed_for_dialog_rename" + + // Others const val DISABLE_MERGE_OVER_ROOT = "disable-merge-over" const val IMMUTABLE_ENCHANTMENT_LIST = "immutable_enchantments" @@ -107,6 +113,11 @@ object ConfigOptions { private const val DEFAULT_DEBUG_LOG = false private const val DEFAULT_VERBOSE_DEBUG_LOG = false + // Dialog menu rename + const val DEFAULT_DIALOG_RENAME_ENABLED = false + const val DEFAULT_DIALOG_MAX_SIZE = 256 + const val DEFAULT_DIALOG_RENAME_USE_PERMISSION = false + // ------------- // Config Ranges // ------------- @@ -416,6 +427,36 @@ object ConfigOptions { .getBoolean(VERBOSE_DEBUG_LOGGING, DEFAULT_VERBOSE_DEBUG_LOG) } + /** + * Is the dialog menu for rename enabled + */ + val doRenameDialog: Boolean + get() { + return ConfigHolder.DEFAULT_CONFIG + .config + .getBoolean(DIALOG_RENAME_ENABLED, DEFAULT_DIALOG_RENAME_ENABLED) + } + + /** + * Do the dialog menu require permission + */ + val doRenameDialogUsePermission: Boolean + get() { + return ConfigHolder.DEFAULT_CONFIG + .config + .getBoolean(DIALOG_RENAME_USE_PERMISSION, DEFAULT_DIALOG_RENAME_USE_PERMISSION) + } + + /** + * Do the dialog menu require permission + */ + val renameDialogMaxSize: Int + get() { + return ConfigHolder.DEFAULT_CONFIG + .config + .getInt(DIALOG_MAX_SIZE, DEFAULT_DIALOG_MAX_SIZE) + } + /** * Get the given [enchantment]'s limit */ diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3fe75c2..d896fe6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -101,6 +101,16 @@ permission_needed_for_color: true # Valid values include 0 to 1000. use_of_color_cost: 0 +# Dialogue rename menu make use of dialog menu to allow bigger rename +# You can change the maximum size +# +# At the moment only english is available for this menu... sorry ! +# +# CustomAnvil use "ca.rename.dialog" when permission +enable_dialog_rename: false +dialog_rename_max_size: 256 +permission_needed_for_dialog_rename: false + # Override limits for specific enchants # # Enchantments not listed here will use the value of default_limit diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c0f548f..dab9997 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -63,6 +63,11 @@ permissions: ca.lore_edit.paper: default: op description: Allow player to edit lore via paper if enabled (toggleable) + # dialog menu permission + ca.rename.dialog: + default: op + description: Allow player to use the dialog rename menu (toggleable) + # soft depend on old name of this plugin (UnsafeEnchantsPlus), so I can disable it if it is on the same server # Also depend to other plugin for compatibility