LeviLamina
Loading...
Searching...
No Matches
HumanoidArmorItem.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
7#include "mc/deps/shared_types/legacy/actor/ActorLocation.h"
8#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
9#include "mc/world/item/Item.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
14class BaseGameVersion;
15class BlockSource;
16class CompoundTag;
17class Container;
18class ItemDescriptor;
19class ItemInstance;
20class ItemStack;
21class ItemStackBase;
22class Level;
23class Mob;
24class Player;
25class Vec3;
27namespace Bedrock::Safety { class RedactableString; }
28namespace mce { class Color; }
29// clang-format on
30
31class HumanoidArmorItem : public ::Item {
32public:
33 // HumanoidArmorItem inner types declare
34 // clang-format off
35 class ArmorMaterial;
36 // clang-format on
37
38 // HumanoidArmorItem inner types define
39 enum class Tier : int {
40 Leather = 0,
41 Chain = 1,
42 Iron = 2,
43 Diamond = 3,
44 Gold = 4,
45 Elytra = 5,
46 Turtle = 6,
47 Netherite = 7,
48 Copper = 8,
49 };
50
52 public:
53 // member variables
54 // NOLINTBEGIN
55 ::ll::TypedStorage<4, 4, int> mDurabilityMultiplier;
56 ::ll::TypedStorage<4, 16, int[4]> mSlotProtections;
57 ::ll::TypedStorage<4, 4, int> mToughnessValue;
58 ::ll::TypedStorage<4, 4, int> mEnchantmentValue;
59 ::ll::TypedStorage<4, 4, float> mKnockbackResistance;
60 // NOLINTEND
61 };
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::ArmorSlot const> mSlot;
67 ::ll::TypedStorage<4, 4, int const> mDefense;
68 ::ll::TypedStorage<4, 4, int const> mModelIndex;
69 ::ll::TypedStorage<8, 8, ::HumanoidArmorItem::ArmorMaterial const&> mArmorType;
70 ::ll::TypedStorage<1, 1, bool> mCurrentVersionAllowsTrim;
71 // NOLINTEND
72
73public:
74 // prevent constructor by default
75 HumanoidArmorItem& operator=(HumanoidArmorItem const&);
76 HumanoidArmorItem(HumanoidArmorItem const&);
77 HumanoidArmorItem();
78
79public:
80 HumanoidArmorItem(
81 std::string const& nameId,
82 short id,
83 SharedTypes::Legacy::ArmorSlot const slot,
84 int const defense,
85 int const modelIndex,
86 ArmorMaterial const& armorType,
87 bool allowTrim
88 )
89 : Item(nameId, id),
90 mSlot(slot),
91 mDefense(defense),
92 mModelIndex(modelIndex),
93 mArmorType(armorType),
94 mCurrentVersionAllowsTrim(allowTrim) {}
95
96public:
97 // virtual functions
98 // NOLINTBEGIN
99 virtual bool isHumanoidArmor() const /*override*/;
100
101 virtual bool
102 isValidRepairItem(::ItemStackBase const& repairItem, ::ItemStackBase const&, ::BaseGameVersion const&) const
103 /*override*/;
104
105 virtual int getEnchantSlot() const /*override*/;
106
107 virtual int getEnchantValue() const /*override*/;
108
109 virtual int getArmorValue() const /*override*/;
110
111 virtual int getToughnessValue() const /*override*/;
112
113 virtual float getKnockbackResistanceValue() const /*override*/;
114
115 virtual bool hasCustomColor(::CompoundTag const* userData) const /*override*/;
116
117 virtual ::mce::Color getColor(::CompoundTag const* userData, ::ItemDescriptor const&) const /*override*/;
118
119 virtual void clearColor(::ItemStackBase& instance) const /*override*/;
120
121 virtual void setColor(::ItemStackBase& item, ::mce::Color const& color) const /*override*/;
122
123 virtual bool isDyeable() const /*override*/;
124
125 virtual bool isTrimAllowed() const /*override*/;
126
127 virtual ::SharedTypes::Legacy::ActorLocation getEquipLocation() const /*override*/;
128
129 virtual ::SharedTypes::Legacy::LevelSoundEvent getEquipSound() const /*override*/;
130
131 virtual int getDamageChance(int unbreaking) const /*override*/;
132
133 virtual bool dispense(::BlockSource& region, ::Container& container, int slot, ::Vec3 const& pos, uchar) const
134 /*override*/;
135
136 virtual void appendFormattedHovertext(
137 ::ItemStackBase const& stack,
138 ::Level& level,
139 ::Bedrock::Safety::RedactableString& hovertext,
140 bool const showCategory
141 ) const /*override*/;
142
143 virtual void hurtActor(::ItemStack& item, ::Actor& actor, ::Mob& attacker) const /*override*/;
144
145 virtual ::ResolvedItemIconInfo
146 getIconInfo(::ItemStackBase const& item, int newAnimationFrame, bool inInventoryPane) const /*override*/;
147
148 virtual ::ItemStack& use(::ItemStack& item, ::Player& player) const /*override*/;
149
150 virtual int buildIdAux(short auxValue, ::CompoundTag const* userData) const /*override*/;
151 // NOLINTEND
152
153public:
154 // member functions
155 // NOLINTBEGIN
156 MCAPI HumanoidArmorItem(
157 ::std::string const& name,
158 short id,
159 ::HumanoidArmorItem::ArmorMaterial const& armorType,
160 int icon,
161 ::SharedTypes::Legacy::ArmorSlot slot,
162 bool currentVersionAllowsTrim
163 );
164
165 MCAPI ::ItemInstance getTierItem() const;
166 // NOLINTEND
167
168public:
169 // static functions
170 // NOLINTBEGIN
171#ifdef LL_PLAT_C
172 MCAPI static void ResetDefaultLeatherColor();
173
174 MCAPI static void SetDefaultLeatherColor(int newDefaultLeatherColor);
175#endif
176
177 MCAPI static bool isDamageable(::ItemDescriptor const& item);
178 // NOLINTEND
179
180public:
181 // static variables
182 // NOLINTBEGIN
183 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& CHAIN();
184
185 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& COPPER();
186
187 MCAPI static ::mce::Color& DEFAULT_LEATHER_COLOR();
188
189 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& DIAMOND();
190
191 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& ELYTRA();
192
193 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& GOLD();
194
195 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& IRON();
196
197 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& LEATHER();
198
199 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& NETHERITE();
200
201 MCAPI static ::HumanoidArmorItem::ArmorMaterial const& TURTLE();
202 // NOLINTEND
203
204public:
205 // constructor thunks
206 // NOLINTBEGIN
207 MCAPI void* $ctor(
208 ::std::string const& name,
209 short id,
210 ::HumanoidArmorItem::ArmorMaterial const& armorType,
211 int icon,
212 ::SharedTypes::Legacy::ArmorSlot slot,
213 bool currentVersionAllowsTrim
214 );
215 // NOLINTEND
216
217public:
218 // virtual function thunks
219 // NOLINTBEGIN
220 MCFOLD bool $isHumanoidArmor() const;
221
222 MCAPI bool
223 $isValidRepairItem(::ItemStackBase const& repairItem, ::ItemStackBase const&, ::BaseGameVersion const&) const;
224
225 MCAPI int $getEnchantSlot() const;
226
227 MCAPI int $getEnchantValue() const;
228
229 MCFOLD int $getArmorValue() const;
230
231 MCAPI int $getToughnessValue() const;
232
233 MCAPI float $getKnockbackResistanceValue() const;
234
235 MCAPI bool $hasCustomColor(::CompoundTag const* userData) const;
236
237 MCAPI ::mce::Color $getColor(::CompoundTag const* userData, ::ItemDescriptor const&) const;
238
239 MCFOLD void $clearColor(::ItemStackBase& instance) const;
240
241 MCFOLD void $setColor(::ItemStackBase& item, ::mce::Color const& color) const;
242
243 MCAPI bool $isDyeable() const;
244
245 MCAPI bool $isTrimAllowed() const;
246
247 MCAPI ::SharedTypes::Legacy::ActorLocation $getEquipLocation() const;
248
249 MCAPI ::SharedTypes::Legacy::LevelSoundEvent $getEquipSound() const;
250
251 MCAPI int $getDamageChance(int unbreaking) const;
252
253 MCAPI bool $dispense(::BlockSource& region, ::Container& container, int slot, ::Vec3 const& pos, uchar) const;
254
255 MCFOLD void $appendFormattedHovertext(
256 ::ItemStackBase const& stack,
257 ::Level& level,
259 bool const showCategory
260 ) const;
261
262 MCFOLD void $hurtActor(::ItemStack& item, ::Actor& actor, ::Mob& attacker) const;
263
264 MCAPI ::ResolvedItemIconInfo
265 $getIconInfo(::ItemStackBase const& item, int newAnimationFrame, bool inInventoryPane) const;
266
267 MCAPI ::ItemStack& $use(::ItemStack& item, ::Player& player) const;
268
269 MCAPI int $buildIdAux(short auxValue, ::CompoundTag const* userData) const;
270
271
272 // NOLINTEND
273
274public:
275 // vftables
276 // NOLINTBEGIN
277 MCAPI static void** $vftable();
278 // NOLINTEND
279};
Definition Actor.h:125
Definition BaseGameVersion.h:13
Definition RedactableString.h:10
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition Container.h:34
Definition HumanoidArmorItem.h:51
Definition HumanoidArmorItem.h:31
Definition ItemDescriptor.h:25
Definition ItemInstance.h:15
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Level.h:255
Definition Mob.h:57
Definition Player.h:137
Definition Turtle.h:17
Definition Vec3.h:10
Definition Color.h:13
STL namespace.
Definition ResolvedItemIconInfo.h:8