Files
LegacyRenouveau/Minecraft.World/MendingEnchantment.cpp
T
Fireblade 525b89484c fix: enchantment table + frost walker (kinda)
fixes:
- treasure enchants being selectable within the enchantment table menu
- frost walker resemblance to decompiled legacy console edition
- enchantment table featuring hot-swappable abilities where the player could replace one tool with another whilst keeping the exact same potential enchantments in the enchant menu
2026-07-18 22:03:54 -04:00

29 lines
595 B
C++

#include "stdafx.h"
#include "net.minecraft.world.item.h"
#include "ItemInstance.h"
#include "MendingEnchantment.h"
MendingEnchantment::MendingEnchantment(int id, int frequency) : Enchantment(id, frequency, EnchantmentCategory::all)
{
setDescriptionId(IDS_ENCHANTMENT_MENDING);
}
int MendingEnchantment::getMinCost(int level)
{
return level * 25;
}
int MendingEnchantment::getMaxCost(int level)
{
return getMinCost(level) + 50;
}
int MendingEnchantment::getMaxLevel()
{
return 1;
}
bool MendingEnchantment::canEnchant(shared_ptr<ItemInstance> item)
{
return item->isDamageableItem();
}