LeviLamina
Loading...
Searching...
No Matches
Enchant.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7
8// auto generated forward declare list
9// clang-format off
10class Actor;
12class ItemInstance;
14// clang-format on
15
16class Enchant {
17public:
18 // Enchant inner types define
19 enum class Type : uchar {
20 Protection = 0,
21 FireProtection = 1,
22 FeatherFalling = 2,
23 BlastProtection = 3,
24 ProjectileProtection = 4,
25 Thorns = 5,
26 Respiration = 6,
27 DepthStrider = 7,
28 AquaAffinity = 8,
29 Sharpness = 9,
30 Smite = 10,
31 BaneOfArthropods = 11,
32 Knockback = 12,
33 FireAspect = 13,
34 Looting = 14,
35 Efficiency = 15,
36 SilkTouch = 16,
37 Unbreaking = 17,
38 Fortune = 18,
39 Power = 19,
40 Punch = 20,
41 Flame = 21,
42 Infinity = 22,
43 LuckOfTheSea = 23,
44 Lure = 24,
45 FrostWalker = 25,
46 Mending = 26,
47 CurseOfBinding = 27,
48 CurseOfVanishing = 28,
49 Impaling = 29,
50 Riptide = 30,
51 Loyalty = 31,
52 Channeling = 32,
53 Multishot = 33,
54 Piercing = 34,
55 QuickCharge = 35,
56 SoulSpeed = 36,
57 SwiftSneak = 37,
58 WindBurst = 38,
59 Density = 39,
60 Breach = 40,
61 NumEnchantments = 41,
62 InvalidEnchantment = 42,
63 };
64
65 enum class Frequency : int {
66 Common = 30,
67 Uncommon = 10,
68 Rare = 3,
69 VeryRare = 1,
70 };
71
72 enum class Slot : uint {
73 // bitfield representation
74 None = 0,
75 ArmorHead = 1u << 0,
76 ArmorTorso = 1u << 1,
77 ArmorFeet = 1u << 2,
78 ArmorLegs = 1u << 3,
79 Sword = 1u << 4,
80 Bow = 1u << 5,
81 Hoe = 1u << 6,
82 Shears = 1u << 7,
83 Flintsteel = 1u << 8,
84 Axe = 1u << 9,
85 Pickaxe = 1u << 10,
86 Shovel = 1u << 11,
87 FishingRod = 1u << 12,
88 CarrotStick = 1u << 13,
89 Elytra = 1u << 14,
90 Spear = 1u << 15,
91 Crossbow = 1u << 16,
92 Shield = 1u << 17,
93 CosmeticHead = 1u << 18,
94 Compass = 1u << 19,
95 MushroomStick = 1u << 20,
96 Brush = 1u << 21,
97 HeavyWeapon = 1u << 22,
98 GArmor = ArmorHead | ArmorTorso | ArmorFeet | ArmorLegs,
99 GDigging = Hoe | Axe | Pickaxe | Shovel,
100 GTool = Hoe | Shears | Flintsteel | Shield,
101 All = 4294967295,
102 };
103
104 enum class Activation : int {
105 Equipped = 0,
106 Held = 1,
107 Self = 2,
108 NumActivations = 3,
109 Invalid = 4,
110 };
111
112 enum class CompatibilityID : int {
113 NonConflict = 0,
114 Damage = 1,
115 Gathering = 2,
116 Protection = 3,
117 Froststrider = 4,
118 Mendfinity = 5,
119 Loyalriptide = 6,
120 };
121
122 enum class VillagerTrading : int {
123 NotAvailable = 0,
124 Available = 1,
125 };
126
127public:
128 // member variables
129 // NOLINTBEGIN
130 ::ll::TypedStorage<1, 1, ::Enchant::Type const> mEnchantType;
131 ::ll::TypedStorage<4, 4, ::Enchant::Frequency const> mFrequency;
132 ::ll::TypedStorage<1, 1, bool const> mIsAvailableInVillagerTrading;
133 ::ll::TypedStorage<4, 4, int const> mPrimarySlots;
134 ::ll::TypedStorage<4, 4, int const> mSecondarySlots;
135 ::ll::TypedStorage<4, 4, int const> mCompatibility;
136 ::ll::TypedStorage<8, 32, ::std::string const> mDescription;
137 ::ll::TypedStorage<8, 48, ::HashedString const> mStringId;
138 ::ll::TypedStorage<8, 48, ::HashedString const> mScriptStringId;
139 ::ll::TypedStorage<1, 1, bool> mIsDisabled;
140 // NOLINTEND
141
142public:
143 // prevent constructor by default
144 Enchant();
145
146public:
147 // virtual functions
148 // NOLINTBEGIN
149 // vIndex: 0
150 virtual ~Enchant();
151
152 // vIndex: 1
153 virtual bool isCompatibleWith(::Enchant::Type type) const;
154
155 // vIndex: 2
156 virtual int getMinCost(int level) const;
157
158 // vIndex: 3
159 virtual int getMaxCost(int level) const;
160
161 // vIndex: 4
162 virtual int getMinLevel() const;
163
164 // vIndex: 5
165 virtual int getMaxLevel() const;
166
167 // vIndex: 6
168 virtual int getDamageProtection(int level, ::ActorDamageSource const& source) const;
169
170 // vIndex: 7
171 virtual float getAfterBreachArmorFraction(int, float) const;
172
173 // vIndex: 8
174 virtual float getDamageBonus(int, ::Actor const&, ::Actor const&) const;
175
176 // vIndex: 9
177 virtual void doPostAttack(::Actor& attacker, ::Actor& victim, int level) const;
178
179 // vIndex: 10
180 virtual void doPostItemHurtActor(::Actor&, ::Actor&, int) const;
181
182 // vIndex: 11
183 virtual void doPostHurt(::ItemInstance& item, ::Actor& victim, ::Actor& attacker, int level) const;
184
185 // vIndex: 12
186 virtual bool isMeleeDamageEnchant() const;
187
188 // vIndex: 13
189 virtual bool isProtectionEnchant() const;
190
191 // vIndex: 14
192 virtual bool isTreasureOnly() const;
193
194 // vIndex: 15
195 virtual bool isDiscoverable() const;
196
197 // vIndex: 16
198 virtual bool _isValidEnchantmentTypeForCategory(::Enchant::Type type) const;
199 // NOLINTEND
200
201public:
202 // member functions
203 // NOLINTBEGIN
204 MCAPI Enchant(
205 ::Enchant::Type type,
206 ::Enchant::Frequency frequency,
207 ::std::string_view stringId,
208 ::std::string_view description,
209 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
210 int primarySlots,
211 int secondarySlots
212 );
213
214 MCAPI Enchant(
215 ::Enchant::Type type,
216 ::Enchant::Frequency frequency,
217 ::std::string_view stringId,
218 ::std::string_view scriptStringId,
219 ::std::string_view description,
220 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
221 int primarySlots,
222 int secondarySlots
223 );
224 // NOLINTEND
225
226public:
227 // static functions
228 // NOLINTBEGIN
229 MCAPI static ::Enchant::Slot enchantSlotFromString(::std::string_view str);
230
231 MCAPI static void initEnchants();
232
233 MCAPI static ::std::string stringFromEnchantSlot(::Enchant::Slot const& enchantSlot);
234 // NOLINTEND
235
236public:
237 // static variables
238 // NOLINTBEGIN
239 MCAPI static ::std::unordered_map<::HashedString, ::Enchant::Type>& mEnchantNameToType();
240
241 MCAPI static ::std::
242 unordered_map<::Enchant::Slot, ::std::string, ::EnchantSlotEnumHasher, ::std::equal_to<::Enchant::Slot>>&
243 mEnchantSlotTypeEnumToStringMap();
244
245 MCAPI static ::std::unordered_map<::std::string, ::Enchant::Slot>& mEnchantSlotTypeNameToEnumMap();
246
247 MCAPI static ::std::vector<::std::unique_ptr<::Enchant>>& mEnchants();
248 // NOLINTEND
249
250public:
251 // constructor thunks
252 // NOLINTBEGIN
253 MCAPI void* $ctor(
254 ::Enchant::Type type,
255 ::Enchant::Frequency frequency,
256 ::std::string_view stringId,
257 ::std::string_view description,
258 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
259 int primarySlots,
260 int secondarySlots
261 );
262
263 MCAPI void* $ctor(
264 ::Enchant::Type type,
265 ::Enchant::Frequency frequency,
266 ::std::string_view stringId,
267 ::std::string_view scriptStringId,
268 ::std::string_view description,
269 ::Enchant::VillagerTrading isAvailableForVillagerTraining,
270 int primarySlots,
271 int secondarySlots
272 );
273 // NOLINTEND
274
275public:
276 // destructor thunk
277 // NOLINTBEGIN
278 MCAPI void $dtor();
279 // NOLINTEND
280
281public:
282 // virtual function thunks
283 // NOLINTBEGIN
284 MCAPI bool $isCompatibleWith(::Enchant::Type type) const;
285
286 MCAPI int $getMinCost(int level) const;
287
288 MCAPI int $getMaxCost(int level) const;
289
290 MCFOLD int $getMinLevel() const;
291
292 MCFOLD int $getMaxLevel() const;
293
294 MCFOLD int $getDamageProtection(int level, ::ActorDamageSource const& source) const;
295
296 MCFOLD float $getAfterBreachArmorFraction(int, float) const;
297
298 MCFOLD float $getDamageBonus(int, ::Actor const&, ::Actor const&) const;
299
300 MCFOLD void $doPostAttack(::Actor& attacker, ::Actor& victim, int level) const;
301
302 MCFOLD void $doPostItemHurtActor(::Actor&, ::Actor&, int) const;
303
304 MCFOLD void $doPostHurt(::ItemInstance& item, ::Actor& victim, ::Actor& attacker, int level) const;
305
306 MCFOLD bool $isMeleeDamageEnchant() const;
307
308 MCFOLD bool $isProtectionEnchant() const;
309
310 MCFOLD bool $isTreasureOnly() const;
311
312 MCFOLD bool $isDiscoverable() const;
313
314 MCFOLD bool $_isValidEnchantmentTypeForCategory(::Enchant::Type type) const;
315 // NOLINTEND
316
317public:
318 // vftables
319 // NOLINTBEGIN
320 MCNAPI static void** $vftable();
321 // NOLINTEND
322};
Definition ActorDamageSource.h:18
Definition Actor.h:103
Definition Enchant.h:16
static MCAPI void ** $vftable()
Definition ItemInstance.h:16
Definition EnchantSlotEnumHasher.h:5