From 12f807060e0885075a5822b5fdc827e27250c0b3 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Thu, 13 Oct 2022 18:40:38 +0200 Subject: [PATCH] Implements a mix of #3 and #7 Adds a preset command which can be used to see available presets Adds preset filters which can be used to specify item sub-categories within a preset Removes SWORD_SMITH and RANGED_SMITH, as those are replaced by the RANGED and SWORD filters Adds a list of usable filters for each preset --- README.md | 44 +++++- .../blacksmith/BlacksmithPlugin.java | 12 +- .../command/BlackSmithConfigCommand.java | 4 +- .../command/BlackSmithEditCommand.java | 4 +- .../blacksmith/command/PresetCommand.java | 65 ++++++++ .../command/PresetTabCompleter.java | 60 +++++++ .../blacksmith/command/ReloadCommand.java | 3 +- .../blacksmith/config/NPCSetting.java | 87 ++++++++++- .../blacksmith/config/SmithPreset.java | 128 ++++++++++++--- .../blacksmith/config/SmithPresetFilter.java | 147 ++++++++++++++++++ .../formatting/StringFormatter.java | 16 +- .../formatting/TranslatableMessage.java | 5 +- .../blacksmith/listener/NPCClickListener.java | 4 +- .../blacksmith/util/TypeValidationHelper.java | 13 +- src/main/resources/plugin.yml | 10 +- src/main/resources/strings.yml | 5 +- 16 files changed, 552 insertions(+), 55 deletions(-) create mode 100644 src/main/java/net/knarcraft/blacksmith/command/PresetCommand.java create mode 100644 src/main/java/net/knarcraft/blacksmith/command/PresetTabCompleter.java create mode 100644 src/main/java/net/knarcraft/blacksmith/config/SmithPresetFilter.java diff --git a/README.md b/README.md index 5b45799..5acb1d3 100644 --- a/README.md +++ b/README.md @@ -40,20 +40,54 @@ In addition to just being able to repair items, blacksmiths have some random fea - There is a chance that blacksmiths fail to repair an item, leaving it at about the same durability as before. Use failReforgeChance to control the chance. Set it to 0 to remove the feature. -- There is a chance a blacksmith may add +- There is a chance a blacksmith may add an enchantment to a reforged item. You can control the probability using + extraEnchantmentChance, and set the maximum number of enchantments using maxEnchantments ## Commands -- /blacksmith