first commit
This commit is contained in:
29
Minecraft.World/DiggingEnchantment.cpp
Normal file
29
Minecraft.World/DiggingEnchantment.cpp
Normal file
@@ -0,0 +1,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);
|
||||
}
|
||||
Reference in New Issue
Block a user