Files
GabsPuNs-Project_Zenith_Main/Minecraft.World/UntouchingEnchantment.cpp
GabsPuNs 3b09eb95db New File System and Cleanup some code Part 3
* Remove stdafx.h and some <unordered_set> includes
* Update Minecraft Server Defines and remove more unused folders/files
* Unbloat stdafx.h from Minecraft.World
2026-06-07 00:10:47 -04:00

33 lines
800 B
C++

#include "net.minecraft.world.item.h"
#include "UntouchingEnchantment.h"
UntouchingEnchantment::UntouchingEnchantment(int id, int frequency) : Enchantment(id, frequency, EnchantmentCategory::digger)
{
setDescriptionId(IDS_ENCHANTMENT_UNTOUCHING);
}
int UntouchingEnchantment::getMinCost(int level)
{
return 15;
}
int UntouchingEnchantment::getMaxCost(int level)
{
return Enchantment::getMinCost(level) + 50;
}
int UntouchingEnchantment::getMaxLevel()
{
return 1;
}
bool UntouchingEnchantment::isCompatibleWith(Enchantment *other) const
{
return Enchantment::isCompatibleWith(other) && other->id != resourceBonus->id;
}
bool UntouchingEnchantment::canEnchant(shared_ptr<ItemInstance> item)
{
if (item->getItem()->id == Item::shears_Id) return true;
return Enchantment::canEnchant(item);
}