▶️ ЗАБЕРИ СВОИ 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.6-1.19.3-paper

Better Mending 1.0.6-1.19.3-paper

Alpha3 г. назад

Список изменений

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.

Файлы

bettermending-1.0.6-1.19.3-paper.jar(34.25 KiB)
Основной
Скачать

Метаданные

Канал релиза

Alpha

Номер версии

1.0.6-1.19.3-paper

Загрузчики

Paper
Purpur

Версии игры

1.19–1.19.3

Загрузок

86

Дата публикации

3 г. назад

Загрузил

ID версии

Главная