diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/ArmorItem.h | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/ArmorItem.h')
| -rw-r--r-- | Minecraft.World/ArmorItem.h | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Minecraft.World/ArmorItem.h b/Minecraft.World/ArmorItem.h new file mode 100644 index 00000000..c711e2f9 --- /dev/null +++ b/Minecraft.World/ArmorItem.h @@ -0,0 +1,90 @@ +#pragma once + +#include "Item.h" + +class ArmorItem : public Item +{ +public: + static const int SLOT_HEAD = 0; + static const int SLOT_TORSO = 1; + static const int SLOT_LEGS = 2; + static const int SLOT_FEET = 3; + static const eMinecraftColour DEFAULT_LEATHER_COLOR = eMinecraftColour_Armour_Default_Leather_Colour; + +private: + static const int healthPerSlot[]; + static const wstring LEATHER_OVERLAYS[] ; + +public: + static const wstring TEXTURE_EMPTY_SLOTS[]; + +public: + class ArmorMaterial + { + public: + static const int clothArray[]; + static const int chainArray[]; + static const int ironArray[]; + static const int goldArray[]; + static const int diamondArray[]; + public: + static const ArmorMaterial *CLOTH; + static const ArmorMaterial *CHAIN; + static const ArmorMaterial *IRON; + static const ArmorMaterial *GOLD; + static const ArmorMaterial *DIAMOND; + + private: + int durabilityMultiplier; + int *slotProtections; + int enchantmentValue; + + // 4J Stu - Had to make this public but was private + // We shouldn't be creating these except the static initialisation + public: + ArmorMaterial(int durabilityMultiplier, const int slotProtections[], int enchantmentValue); + ~ArmorMaterial(); + + public: + int getHealthForSlot(int slot) const; + int getDefenseForSlot(int slot) const; + int getEnchantmentValue() const; + int getTierItemId() const; + }; + + const int slot; + const int defense; + const int modelIndex; + +private: + const ArmorMaterial *armorType; + Icon *overlayIcon; + Icon *iconEmpty; + +public: + ArmorItem(int id, const ArmorMaterial *armorType, int icon, int slot); + + //@Override + int getColor(shared_ptr<ItemInstance> item, int spriteLayer); + + //@Override + bool hasMultipleSpriteLayers(); + + virtual int getEnchantmentValue(); + + const ArmorMaterial *getMaterial(); + bool hasCustomColor(shared_ptr<ItemInstance> item); + int getColor(shared_ptr<ItemInstance> item); + + //@Override + Icon *getLayerIcon(int auxValue, int spriteLayer); + void clearColor(shared_ptr<ItemInstance> item); + void setColor(shared_ptr<ItemInstance> item, int color); + + bool isValidRepairItem(shared_ptr<ItemInstance> source, shared_ptr<ItemInstance> repairItem); + + //@Override + void registerIcons(IconRegister *iconRegister); + + static Icon *getEmptyIcon(int slot); +};
\ No newline at end of file |
