Skip to content
LeviMC
English
AutoLightDark
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 virtual ~LootItemFunction();
87
88 virtual ::LootItemFunction::FunctionType getFunctionType() const = 0;
89
90 virtual void applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context) = 0;
91
92 virtual int applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const&);
93
94 virtual void apply26U6(::ItemStackBase& item, ::Random& random, ::LootTableContext& context);
95
96 virtual int apply26U6(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const& trade);
97 // NOLINTEND
98
99public:
100 // member functions
101 // NOLINTBEGIN
103 // NOLINTEND
104
105public:
106 // static functions
107 // NOLINTBEGIN
108 MCNAPI static ::std::unique_ptr<::LootItemFunction>
109 deserialize(::Json::Value object, bool usingUpcomingCreatorFeaturesExperiment);
110 // NOLINTEND
111
112public:
113 // static variables
114 // NOLINTBEGIN
115 MCNAPI static ::std::unordered_map<
117 ::std::function<::std::unique_ptr<
118 ::LootItemFunction>(::Json::Value&, ::std::vector<::std::unique_ptr<::LootItemCondition>>&)>> const&
120
121 MCAPI static ::std::unordered_map<
123 ::std::function<::std::unique_ptr<
124 ::LootItemFunction>(::Json::Value&, ::std::vector<::std::unique_ptr<::LootItemCondition>>&)>> const&
125 mLootingFunctions();
126 // NOLINTEND
127
128public:
129 // destructor thunk
130 // NOLINTBEGIN
131 MCAPI void $dtor();
132 // NOLINTEND
133
134public:
135 // virtual function thunks
136 // NOLINTBEGIN
137 MCAPI int $applyPreVersion(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const&);
138
139 MCAPI void $apply26U6(::ItemStackBase& item, ::Random& random, ::LootTableContext& context);
140
141 MCAPI int $apply26U6(::ItemStackBase& item, ::Random& random, ::LootTableContext& context, ::Trade const& trade);
142
143
144 // NOLINTEND
145
146public:
147 // vftables
148 // NOLINTBEGIN
149 MCNAPI static void** $vftable();
150 // NOLINTEND
151};
Definition HashedString.h:5
Definition ItemStackBase.h:45
Definition Value.h:16
Definition LootItemCondition.h:12
Definition LootItemFunction.h:20
MCAPI int apply(::LootItemFunction::ApplyArguments arguments)
static MCAPI void ** $vftable()
static MCAPI ::std::unique_ptr<::LootItemFunction > deserialize(::Json::Value object, bool usingUpcomingCreatorFeaturesExperiment)
static MCAPI ::std::unordered_map< ::HashedString, ::std::function<::std::unique_ptr< ::LootItemFunction >(::Json::Value &, ::std::vector<::std::unique_ptr<::LootItemCondition > > &)> > const & mLootingExperimentalFunctions()
Definition LootTableContext.h:20
Definition Random.h:10
Definition LootItemFunction.h:59
Definition Trade.h:10
Definition context.h:5