aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/UntouchingEnchantment.cpp
diff options
context:
space:
mode:
authordaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
committerdaoge_cmd <3523206925@qq.com>2026-03-01 12:16:08 +0800
commitb691c43c44ff180d10e7d4a9afc83b98551ff586 (patch)
tree3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/UntouchingEnchantment.cpp
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/UntouchingEnchantment.cpp')
-rw-r--r--Minecraft.World/UntouchingEnchantment.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Minecraft.World/UntouchingEnchantment.cpp b/Minecraft.World/UntouchingEnchantment.cpp
new file mode 100644
index 00000000..1e5a41b7
--- /dev/null
+++ b/Minecraft.World/UntouchingEnchantment.cpp
@@ -0,0 +1,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);
+} \ No newline at end of file