
Better Mending
A plugin that allows players to repair their items with experience points, with customizable repair amounts and costs.
935
14
Better Mending 1.0.7-1.19.3-paper dont use
alpha9 января 2023 г.- Fixed a syntax error in the code
- Problem: There was no opening parenthesis after
else ifand the semicolon at the end of the line was terminating theifstatement prematurely. - Solution: Added the missing parenthesis and removed the semicolon at the end of the line.
- Problem: There was no opening parenthesis after
Better Mending 1.0.6-1.19.3-paper
alpha8 января 2023 г.Changes
- Replace the following block of code:
List<String> allowedEnchantments = getConfig().getStringList("allowedEnchantments");
for (Enchantment enchant : enchantments.keySet()) {
if (!allowedEnchantments.contains(enchant.getName())) {
// Enchantment is not allowed, cancel the event
interactEvent.setCancelled(true);
return;
}
}
with the following code:
if (enchantments.isEmpty()) {
// Item has no enchantments, cancel the event
interactEvent.setCancelled(true);
return;
}
List<String> allowedEnchantments = getConfig().getStringList("allowedEnchantments");
boolean hasAllowedEnchantment = false;
for (Enchantment enchant : enchantments.keySet()) {
if (allowedEnchantments.contains(enchant.getName())) {
hasAllowedEnchantment = true;
break;
}
}
if (!hasAllowedEnchantment) {
// Item does not have any allowed enchantments, cancel the event
interactEvent.setCancelled(true);
return;
}
This change modifies the onPlayerInteract method to check if the item being repaired has at least one allowed enchantment, rather than checking if all of its enchantments are allowed. If the item has at least one allowed enchantment, the player is allowed to use experience points to repair the item. If the item does not have any allowed enchantments, the event is cancelled and the player is not allowed to use experience points to repair the item.
Better Mending 1.0.5-1.19.3-paper
alpha8 января 2023 г.- Fix issue with enchantment in config not working
1.0.4-1.19.3-paper
release7 января 2023 г.Changed
- Forgot to include permission in plugin.yml
- Optimize code
1.0.3-1.19.3-paper
alpha7 января 2023 г.Added
- Config options for messages:
noPermissionMessage, itemAlreadyRepaired, itemDoesNotHaveMending, mendingNotAllowed, insufficientXP, durabilityLeftMessage, repairsNeededMessage. /bm reloadcommand to allow users with thebettermending.reloadpermission to reload the plugin's config./bm statuscommand to allow users to check how many xp cost and durability repair.
Совместимость
Детали
Лицензия:MIT
Опубликован:3 года назад
Обновлён:3 года назад
