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