Improves configuration migration, and fixes some issues
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good

Fixes incorrect dropItems instead of dropItem key in config.yml
Adds some missing dropper messages to config.yml
Adds proper migration keys for all known configuration options
Adds a modified version of Stargate's StargateYamlConfiguration to allow retaining comments during configuration migration.
Fixes the annoying "[]" is not a valid repairable item
Removes the use of data keys for the global configuration
This commit is contained in:
2024-05-04 17:40:21 +02:00
parent 8b8890c408
commit 757fcdf139
9 changed files with 587 additions and 152 deletions

View File

@ -1,9 +1,38 @@
defaults=blacksmith.defaults
global=blacksmith.global
scrapper.defaults.delaysInSeconds.minimum=scrapper.defaults.minSalvageWaitTimeSeconds
scrapper.defaults.delaysInSeconds.maximum=scrapper.defaults.maxSalvageWaitTimeSeconds
scrapper.defaults.delaysInSeconds.salvageCoolDown=scrapper.defaults.salvageCoolDownSeconds
blacksmith.defaults.delaysInSeconds.minimum=blacksmith.defaults.minReforgeWaitTimeSeconds
blacksmith.defaults.delaysInSeconds.maximum=blacksmith.defaults.maxReforgeWaitTimeSeconds
blacksmith.defaults.delaysInSeconds.reforgeCoolDown=blacksmith.defaults.reforgeCoolDownSeconds
blacksmith.defaults.enchantmentBlocklist=blacksmith.defaults.enchantmentBlockList
global.basePrice=blacksmith.global.basePrice
global.pricePerDurabilityPoint=blacksmith.global.pricePerDurabilityPoint
global.enchantmentCost=blacksmith.global.enchantmentCost
global.useNaturalCost=blacksmith.global.useNaturalCost
global.showExactTime=blacksmith.global.showExactTime
global.chippedAnvilRepairCost=blacksmith.global.chippedAnvilReforgingCost
global.damagedAnvilRepairCost=blacksmith.global.damagedAnvilReforgingCost
global.chippedAnvilReforgingCost=blacksmith.global.chippedAnvilReforgingCost
global.damagedAnvilReforgingCost=blacksmith.global.damagedAnvilReforgingCost
global.disableMaterialLimitation=
defaults.dropItem=blacksmith.defaults.dropItem
defaults.reforgeAbleItems=blacksmith.defaults.reforgeAbleItems
defaults.disableCoolDown=
defaults.disableDelay=
defaults.failReforgeChance=blacksmith.defaults.failReforgeChance
defaults.extraEnchantmentChance=blacksmith.defaults.extraEnchantmentChance
defaults.maxEnchantments=blacksmith.defaults.maxEnchantments
defaults.delaysInSeconds.maximum=blacksmith.defaults.maxReforgeWaitTimeSeconds
defaults.delaysInSeconds.minimum=blacksmith.defaults.minReforgeWaitTimeSeconds
defaults.delaysInSeconds.reforgeCoolDown=blacksmith.defaults.reforgeCoolDownSeconds
defaults.delaysInSeconds.blacksmithTitle=
defaults.messages.busyPlayerMessage=blacksmith.defaults.messages.busyPlayerMessage
defaults.messages.busyReforgeMessage=blacksmith.defaults.messages.busyReforgeMessage
defaults.messages.coolDownUnexpiredMessage=blacksmith.defaults.messages.coolDownUnexpiredMessage
defaults.messages.costMessage=blacksmith.defaults.messages.costMessage
defaults.messages.failReforgeMessage=blacksmith.defaults.messages.failReforgeMessage
defaults.messages.insufficientFundsMessage=blacksmith.defaults.messages.insufficientFundsMessage
defaults.messages.invalidItemMessage=blacksmith.defaults.messages.invalidItemMessage
defaults.messages.itemChangedMessage=blacksmith.defaults.messages.itemChangedMessage
defaults.messages.startReforgeMessage=blacksmith.defaults.messages.startReforgeMessage
defaults.messages.successMessage=blacksmith.defaults.messages.successMessage
defaults.messages.notDamagedMessage=blacksmith.defaults.messages.notDamagedMessage
defaults.blacksmithTitle=blacksmith.defaults.blacksmithTitle
defaults.enchantmentBlocklist=blacksmith.defaults.enchantmentBlockList
defaults.repairAnvils=blacksmith.defaults.reforgeAnvils
defaults.repairAnvils=
defaults.reforgeAnvils=blacksmith.defaults.reforgeAnvils
defaults.failReforgeRemovesEnchantments=blacksmith.defaults.failReforgeRemovesEnchantments

View File

@ -139,7 +139,7 @@ scrapper:
defaults:
# Whether the item will drop materials resulting from scrapping on the ground, instead of putting them into the user's inventory
dropItems: true
dropItem: true
# The chance to fail a salvage, thus destroying the item (0-100)
failSalvageChance: 0
@ -175,8 +175,8 @@ scrapper:
# The message to display when the scrapper is still on a cool-down from the previous salvaging
coolDownUnexpiredMessage: "&cYou've already had your chance! Give me a break! I'll be ready {time}!"
# The message to display if the player tries to salvage an item the scrapper cannot salvage
cannotSalvageMessage: "&cI'm unable to salvage that item"
# The message to display when holding an item the blacksmith is unable to reforge
invalidItemMessage: "&cI'm sorry, but I'm a/an {title}, I don't know how to salvage that!"
# The message to display if salvaging the player's item would result in no salvage
tooDamagedForSalvageMessage: "&cThat item is too damaged to be salvaged into anything useful"
@ -193,5 +193,8 @@ scrapper:
# The message to display once the scrapper starts salvaging
startSalvageMessage: "&eOk, let's see what I can do..."
# The message to display when holding an item the blacksmith is unable to reforge
invalidItemMessage: "&cI'm sorry, but I'm a/an {title}, I don't know how to salvage that!"
# The message to display if the player is unable to pay the scrapper's fee
insufficientFundsMessage: "&cYou don't have enough money to salvage an item!"
# The message to display when explaining the shown item's salvage cost
costMessage: "&eIt will cost &a{cost}&e to salvage that item! Click again to salvage!"