aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ProtectionEnchantment.h
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/ProtectionEnchantment.h
parentdef8cb415354ac390b7e89052a50605285f1aca9 (diff)
Initial commit
Diffstat (limited to 'Minecraft.World/ProtectionEnchantment.h')
-rw-r--r--Minecraft.World/ProtectionEnchantment.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/Minecraft.World/ProtectionEnchantment.h b/Minecraft.World/ProtectionEnchantment.h
new file mode 100644
index 00000000..910e32df
--- /dev/null
+++ b/Minecraft.World/ProtectionEnchantment.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include "Enchantment.h"
+
+class ProtectionEnchantment : public Enchantment
+{
+public:
+ static const int ALL = 0;
+ static const int FIRE = 1;
+ static const int FALL = 2;
+ static const int EXPLOSION = 3;
+ static const int PROJECTILE = 4;
+
+private:
+ static const int names[];
+ static const int minCost[];
+ static const int levelCost[];
+ static const int levelCostSpan[];
+
+public:
+ const int type;
+
+ ProtectionEnchantment(int id, int frequency, int type);
+
+ virtual int getMinCost(int level);
+ virtual int getMaxCost(int level);
+ virtual int getMaxLevel();
+ virtual int getDamageProtection(int level, DamageSource *source);
+ virtual int getDescriptionId();
+ virtual bool isCompatibleWith(Enchantment *other) const;
+ static int getFireAfterDampener(shared_ptr<Entity> entity, int time);
+ static double getExplosionKnockbackAfterDampener(shared_ptr<Entity> entity, double power);
+}; \ No newline at end of file