▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/Better Mending
Better Mending

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 if and the semicolon at the end of the line was terminating the if statement prematurely.
    • Solution: Added the missing parenthesis and removed the semicolon at the end of the line.

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 reload command to allow users with the bettermending.reload permission to reload the plugin's config.
  • /bm status command to allow users to check how many xp cost and durability repair.

Совместимость

Minecraft: Java Edition

1.19.x1.18.x1.17.x1.16.x

Платформы

Поддерживаемые окружения

Сервер

Детали

Лицензия:MIT
Опубликован:3 года назад
Обновлён:3 года назад
Главная