blob: 1e5a41b75a7c2107466a9e824cc726f06714f25b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#include "stdafx.h"
#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);
}
|