blob: b37756234e916cb977bfe8028a4f60f90cb36a55 (
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
|
#include "stdafx.h"
#include "net.minecraft.world.item.h"
#include "DiggingEnchantment.h"
DiggingEnchantment::DiggingEnchantment(int id, int frequency) : Enchantment(id, frequency, EnchantmentCategory::digger)
{
setDescriptionId(IDS_ENCHANTMENT_DIGGING);
}
int DiggingEnchantment::getMinCost(int level)
{
return 1 + 10 * (level - 1);
}
int DiggingEnchantment::getMaxCost(int level)
{
return Enchantment::getMinCost(level) + 50;
}
int DiggingEnchantment::getMaxLevel()
{
return 5;
}
bool DiggingEnchantment::canEnchant(shared_ptr<ItemInstance> item)
{
if (item->getItem()->id == Item::shears_Id) return true;
return Enchantment::canEnchant(item);
}
|