LeviLamina
Loading...
Searching...
No Matches
LootItemFunction.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/world/level/storage/loot/predicates/LootItemCondition.h"
5
6// auto generated inclusion list
7#include "mc/deps/core/sem_ver/SemVersion.h"
8
9// auto generated forward declare list
10// clang-format off
11class HashedString;
12class ItemStackBase;
15class Random;
16struct Trade;
17namespace Json { class Value; }
18// clang-format on
19
21public:
22 // LootItemFunction inner types declare
23 // clang-format off
24 struct ApplyArguments;
25 // clang-format on
26
27 // LootItemFunction inner types define
28 enum class FunctionType : int {
29 SetItemCount = 0,
30 SetItemData = 1,
31 SetItemDamage = 2,
32 LootingEnchant = 3,
33 EnchantWithLevels = 4,
34 EnchantBookForTrading = 5,
35 EnchantRandomly = 6,
36 SmeltItem = 7,
37 SetDataFromColorIndex = 8,
38 EnchantRandomEquipment = 9,
39 RandomAuxValue = 10,
40 RandomBlockState = 11,
41 RandomDye = 12,
42 ExplorationMap = 13,
43 SetBannerDetails = 14,
44 ExplosionDecay = 15,
45 SetItemName = 16,
46 SetItemLore = 17,
47 SpecificEnchant = 18,
48 FillContainer = 19,
49 SetSpawnEgg = 20,
50 SetBookContents = 21,
51 SetStewEffect = 22,
52 SetOminousBottle = 23,
53 SetArmorTrim = 24,
54 SetPotion = 25,
55 CarryOverBlockEntityData = 26,
56 Count = 27,
57 };
58
59 struct ApplyArguments {
60 public:
61 // member variables
62 // NOLINTBEGIN
63 ::ll::TypedStorage<8, 8, ::ItemStackBase&> mItem;
64 ::ll::TypedStorage<8, 8, ::Random&> mRandom;
65 ::ll::TypedStorage<8, 8, ::LootTableContext&> mContext;
66 ::ll::TypedStorage<8, 8, ::Trade const*> mTrade;
67 ::ll::TypedStorage<8, 24, ::SemVersion> mVersion;
68 // NOLINTEND
69
70 public:
71 // prevent constructor by default
72 ApplyArguments& operator=(ApplyArguments const&);
73 ApplyArguments(ApplyArguments const&);
74 ApplyArguments();
75 };
76
77public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::LootItemCondition>>> mPredicates;
81 // NOLINTEND
82
83public:
84 // virtual functions
85 // NOLINTBEGIN
86#ifdef LL_PLAT_S
87 virtual ~LootItemFunction() = default;
88#else // LL_PLAT_C
89 virtual ~LootItemFunction();
90#endif
91
92 virtual ::LootItemFunction::FunctionType getFunctionType() const = 0;
93
94 virtual void applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context) = 0;
95
96 virtual int applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const&);
97
98 virtual void apply26U5(::ItemStackBase& item, ::Random& random, ::LootTableContext& context);
99
100 virtual int apply26U5(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const& trade);
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
106 MCAPI int apply(::LootItemFunction::ApplyArguments arguments);
107 // NOLINTEND
108
109public:
110 // static functions
111 // NOLINTBEGIN
112 MCAPI static ::std::unique_ptr<::LootItemFunction>
113 deserialize(::Json::Value object, bool usingUpcomingCreatorFeaturesExperiment);
114 // NOLINTEND
115
116public:
117 // static variables
118 // NOLINTBEGIN
119 MCAPI static ::std::unordered_map<
121 ::std::function<::std::unique_ptr<
122 ::LootItemFunction>(::Json::Value&, ::std::vector<::std::unique_ptr<::LootItemCondition>>&)>> const&
123 mLootingExperimentalFunctions();
124
125 MCAPI static ::std::unordered_map<
127 ::std::function<::std::unique_ptr<
128 ::LootItemFunction>(::Json::Value&, ::std::vector<::std::unique_ptr<::LootItemCondition>>&)>> const&
129 mLootingFunctions();
130 // NOLINTEND
131
132public:
133 // destructor thunk
134 // NOLINTBEGIN
135#ifdef LL_PLAT_C
136 MCAPI void $dtor();
137#endif
138 // NOLINTEND
139
140public:
141 // virtual function thunks
142 // NOLINTBEGIN
143 MCAPI int $applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const&);
144
145 MCAPI void $apply26U5(::ItemStackBase& item, ::Random& random, ::LootTableContext& context);
146
147 MCAPI int $apply26U5(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const& trade);
148
149
150 // NOLINTEND
151
152public:
153 // vftables
154 // NOLINTBEGIN
155 MCNAPI static void** $vftable();
156 // NOLINTEND
157};
Definition HashedString.h:5
Definition ItemStackBase.h:44
Definition Value.h:16
Definition LootItemCondition.h:12
Definition LootItemFunction.h:20
static MCAPI void ** $vftable()
Definition LootTableContext.h:20
Definition Random.h:10
Definition LootItemFunction.h:59
Definition Trade.h:10
Definition context.h:5