mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-27 19:03:37 +00:00
26 lines
876 B
C++
26 lines
876 B
C++
#include "../Platform/stdafx.h"
|
|
#include "../Headers/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(std::shared_ptr<ItemInstance> item) {
|
|
if (item->getItem()->id == Item::shears_Id) return true;
|
|
return Enchantment::canEnchant(item);
|
|
} |