Fixes some minor issues

Fixes some repositories using http instead of https
Fixes formatting for tables
This commit is contained in:
Kristian Knarvik 2022-11-14 02:44:18 +01:00
parent a036c39dc3
commit 5089a721a0
4 changed files with 50 additions and 50 deletions

View File

@ -48,11 +48,11 @@ In addition to just being able to repair items, blacksmiths have some random fea
## Commands
| Command | Arguments | Description |
| --- | --- | --- |
| /blacksmith | \<option> \[new-value] | Changes a configuration option for the selected blacksmith (use Citizens' /npc select first) |
| /blacksmithconfig | \<reload/option> \[new-value] | Changes a default/global configuration value |
| /preset | \<preset>\[:filter] | Displays all materials included in the given preset, after applying the filter if set |
| Command | Arguments | Description |
|-------------------|-------------------------------|----------------------------------------------------------------------------------------------|
| /blacksmith | \<option> \[new-value] | Changes a configuration option for the selected blacksmith (use Citizens' /npc select first) |
| /blacksmithconfig | \<reload/option> \[new-value] | Changes a default/global configuration value |
| /preset | \<preset>\[:filter] | Displays all materials included in the given preset, after applying the filter if set |
For /blacksmith and /blacksmithconfig, if a new value isn't specified, the current value is displayed instead.
@ -110,64 +110,64 @@ All currently supported presets, and available filters for each preset:
## Permissions
| Permission node | Description |
| --- | --- |
| blacksmith.admin | Allows overall blacksmith configuration |
| blacksmith.edit | Allows changing settings for the selected blacksmith NPC |
| blacksmith.use | Allows the player to repair items using blacksmiths |
| Permission node | Description |
|------------------|----------------------------------------------------------|
| blacksmith.admin | Allows overall blacksmith configuration |
| blacksmith.edit | Allows changing settings for the selected blacksmith NPC |
| blacksmith.use | Allows the player to repair items using blacksmiths |
## Configuration options
### Plugin Options
| Key | Value type | Description |
| --- | --- | --- |
| language | string | The language used for this plugin. Only "en" is supported, unless you add a custom language. |
| Key | Value type | Description |
|----------|------------|----------------------------------------------------------------------------------------------|
| language | string | The language used for this plugin. Only "en" is supported, unless you add a custom language. |
### Global-only options
| Key | Value type | Description |
| --- | --- | --- |
| basePrice | positive decimal number | The base price which has to be paid regardless of the durability remaining for an item. Setting this without specifying a material sets the basePrice for any item the basePrice has not been set for. |
| pricePerDurabilityPoint | positive decimal number | The price added for each durability point present/missing (depends on whether natural cost is set to true or false). Setting this without specifying a material sets the pricePerDurabilityPoint for any item the pricePerDurabilityPoint has not been set for. |
| enchantmentCost | positive decimal number | The added cost for each level of an enchantment present on the item. The cost can be set for specific enchantments. Not specifying an enchantment sets the value for all enchantments without a set value.
| useNaturalCost | true/false | If true, each missing durability will add to the cost (price = basePrice + missingDurability * pricePerDurabilityPoint + enchantmentCost). If false, durability will be used to calculate the cost instead of missingDurability (this was the behavior before natural cost was added). |
| showExactTime | true/false | If true, blacksmiths will display exact time remaining in minutes and seconds, instead of vague expressions |
| Key | Value type | Description |
|-------------------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| basePrice | positive decimal number | The base price which has to be paid regardless of the durability remaining for an item. Setting this without specifying a material sets the basePrice for any item the basePrice has not been set for. |
| pricePerDurabilityPoint | positive decimal number | The price added for each durability point present/missing (depends on whether natural cost is set to true or false). Setting this without specifying a material sets the pricePerDurabilityPoint for any item the pricePerDurabilityPoint has not been set for. |
| enchantmentCost | positive decimal number | The added cost for each level of an enchantment present on the item. The cost can be set for specific enchantments. Not specifying an enchantment sets the value for all enchantments without a set value. |
| useNaturalCost | true/false | If true, each missing durability will add to the cost (price = basePrice + missingDurability * pricePerDurabilityPoint + enchantmentCost). If false, durability will be used to calculate the cost instead of missingDurability (this was the behavior before natural cost was added). |
| showExactTime | true/false | If true, blacksmiths will display exact time remaining in minutes and seconds, instead of vague expressions |
### Per-npc (with default values set in config.yml)
#### Configuration values
| Key | Value type | Description |
| --- | --- | --- |
| dropItem | true/false | Whether the blacksmith should drop the repaired item on the ground (instead of putting it into the player's inventory). |
| disableCoolDown | true/false | Whether to completely disable the cool-down between repairs. |
| disableDelay | true/false | Whether to completely disable the delay required to reforge an item. |
| failReforgeChance | 0-100 | The chance of the blacksmith failing to repair an item. |
| extraEnchantmentChance | 0-100 | The chance of the blacksmith adding an enchantment to an item. |
| maxEnchantments | 0-10 | The maximum number of different enchantments a blacksmith can add. |
| maxReforgeDelay | 0-3600 | The maximum number of seconds a player needs to wait for an item to be repaired. |
| minReforgeDelay | 0-3600 | The minimum number of seconds a player needs to wait for an item to be repaired. |
| reforgeCoolDown | 0-3600 | The cool-down, in seconds, a player has to wait between each time they use one specific blacksmith. |
| reforgeAbleItems | DIAMOND_LEGGINGS,GOLD-pickaxe,bow, etc. | Specifies which items this blacksmith is able to reforge. If set to "" or null, all normally repairable items can be repaired. If set to a list of items, only the items specified can be repaired. Some presets have been included for ease of use. Use a preset by specifying "preset:sword-smith" instead of a material such as "gold-pickaxe". |
| blacksmithTitle | text string | The title displayed as part of the message explaining that a blacksmith doesn't recognize a player's held item |
| enchantmentBlocklist | string list | A string list of all enchantments a blacksmith should not be allowed to add to items. |
| Key | Value type | Description |
|------------------------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| dropItem | true/false | Whether the blacksmith should drop the repaired item on the ground (instead of putting it into the player's inventory). |
| disableCoolDown | true/false | Whether to completely disable the cool-down between repairs. |
| disableDelay | true/false | Whether to completely disable the delay required to reforge an item. |
| failReforgeChance | 0-100 | The chance of the blacksmith failing to repair an item. |
| extraEnchantmentChance | 0-100 | The chance of the blacksmith adding an enchantment to an item. |
| maxEnchantments | 0-10 | The maximum number of different enchantments a blacksmith can add. |
| maxReforgeDelay | 0-3600 | The maximum number of seconds a player needs to wait for an item to be repaired. |
| minReforgeDelay | 0-3600 | The minimum number of seconds a player needs to wait for an item to be repaired. |
| reforgeCoolDown | 0-3600 | The cool-down, in seconds, a player has to wait between each time they use one specific blacksmith. |
| reforgeAbleItems | DIAMOND_LEGGINGS,GOLD-pickaxe,bow, etc. | Specifies which items this blacksmith is able to reforge. If set to "" or null, all normally repairable items can be repaired. If set to a list of items, only the items specified can be repaired. Some presets have been included for ease of use. Use a preset by specifying "preset:sword-smith" instead of a material such as "gold-pickaxe". |
| blacksmithTitle | text string | The title displayed as part of the message explaining that a blacksmith doesn't recognize a player's held item |
| enchantmentBlocklist | string list | A string list of all enchantments a blacksmith should not be allowed to add to items. |
#### Messages
| Message Key | Explanation |
| --- | --- |
| busyPlayerMessage | The message displayed when the blacksmith is serving another player |
| busyReforgeMessage | The message displayed when the blacksmith is busy reforging an item |
| Message Key | Explanation |
|--------------------------|-----------------------------------------------------------------------------------------------------------------|
| busyPlayerMessage | The message displayed when the blacksmith is serving another player |
| busyReforgeMessage | The message displayed when the blacksmith is busy reforging an item |
| coolDownUnexpiredMessage | The message displayed when the player has to wait for the cool-down to expire before using the blacksmith again |
| costMessage | The message displayed when telling a player about the cost of repairing an item |
| failReforgeMessage | The message displayed when a blacksmith fails to reforge an item |
| insufficientFundsMessage | The message displayed when a player is unable to pay for reforging an item |
| invalidItemMessage | The message displayed when a blacksmith is presented an item which it cannot repair |
| itemChangedMessage | The message displayed when a player changes their item after being shown the repair cost |
| startReforgeMessage | The message displayed when a blacksmith starts reforging an item |
| successMessage | The message displayed when a blacksmith successfully repairs an item |
| notDamagedMessage | The message displayed if a player tries to reforge an item with full durability |
| costMessage | The message displayed when telling a player about the cost of repairing an item |
| failReforgeMessage | The message displayed when a blacksmith fails to reforge an item |
| insufficientFundsMessage | The message displayed when a player is unable to pay for reforging an item |
| invalidItemMessage | The message displayed when a blacksmith is presented an item which it cannot repair |
| itemChangedMessage | The message displayed when a player changes their item after being shown the repair cost |
| startReforgeMessage | The message displayed when a blacksmith starts reforging an item |
| successMessage | The message displayed when a blacksmith successfully repairs an item |
| notDamagedMessage | The message displayed if a player tries to reforge an item with full durability |
## Language customization

View File

@ -25,11 +25,11 @@
</repository>
<repository>
<id>citizens-repo</id>
<url>http://repo.citizensnpcs.co/</url>
<url>https://repo.citizensnpcs.co/</url>
</repository>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
<url>https://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
</repositories>

View File

@ -33,7 +33,7 @@ public class BlackSmithEditTabCompleter implements TabCompleter {
if (args.length == 1) {
return TabCompletionHelper.filterMatchingContains(npcSettings, args[0]);
} else {
if (npcSettings.contains(args[0]) && args.length <= 2) {
if (npcSettings.contains(args[0]) && args.length == 2) {
return tabCompleteCommandValues(args[0], args[1]);
} else {
return new ArrayList<>();

View File

@ -85,7 +85,7 @@ public final class TypeValidationHelper {
* @return <p>True if the value is a non-empty string</p>
*/
private static boolean isNonEmptyString(Object value, CommandSender sender) {
boolean isString = value instanceof String string && !string.strip().isEmpty();
boolean isString = value instanceof String string && !string.isBlank();
if (!isString && sender != null) {
BlacksmithPlugin.getStringFormatter().displayErrorMessage(sender,
BlacksmithTranslatableMessage.INPUT_STRING_REQUIRED);