LeviLamina
Loading...
Searching...
No Matches
Recipes.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/molang/MolangVersion.h"
7#include "mc/world/inventory/network/TypedServerNetId.h"
8#include "mc/world/item/crafting/RecipeUnlockingRequirement.h"
9
10// auto generated forward declare list
11// clang-format off
12class BaseGameVersion;
13class Block;
14class Experiments;
16class HashedString;
17class Item;
18class ItemInstance;
19class ItemStackBase;
20class Level;
22class PackInstance;
23class Recipe;
27class SemVersion;
28class ShapedRecipe;
29class ShapelessRecipe;
30struct RecipeNetIdTag;
32namespace Json { class Value; }
33namespace mce { class UUID; }
34// clang-format on
35
36class Recipes {
37public:
38 // Recipes inner types declare
39 // clang-format off
40 struct FurnaceRecipeKey;
42 class Type;
43 // clang-format on
44
45 // Recipes inner types define
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<4, 4, int> mID;
51 ::ll::TypedStorage<8, 48, ::HashedString> mTag;
52 // NOLINTEND
53
54 public:
55 // member functions
56 // NOLINTBEGIN
57 MCAPI ~FurnaceRecipeKey();
58 // NOLINTEND
59
60 public:
61 // destructor thunk
62 // NOLINTBEGIN
63 MCFOLD void $dtor();
64 // NOLINTEND
65 };
66
67 class Type {
68 public:
69 // member variables
70 // NOLINTBEGIN
71 ::ll::TypedStorage<8, 8, ::Item*> mItem;
72 ::ll::TypedStorage<8, 8, ::Block const*> mBlock;
73 ::ll::TypedStorage<8, 24, ::RecipeIngredient> mIngredient;
74 ::ll::TypedStorage<1, 1, char> mC;
75 // NOLINTEND
76
77 public:
78 // member functions
79 // NOLINTBEGIN
80 MCAPI ~Type();
81 // NOLINTEND
82
83 public:
84 // destructor thunk
85 // NOLINTBEGIN
86 MCAPI void $dtor();
87 // NOLINTEND
88 };
89
90 using TypeList = ::std::vector<::Recipes::Type>;
91
93 public:
94 // member variables
95 // NOLINTBEGIN
96 ::ll::TypedStorage<4, 4, int> mWidth;
97 ::ll::TypedStorage<4, 4, int> mHeight;
98 ::ll::TypedStorage<8, 32, ::std::string> mNormalizedResult;
99 ::ll::TypedStorage<8, 32, ::std::string> mWarning;
100 // NOLINTEND
101
102 public:
103 // member functions
104 // NOLINTBEGIN
106 // NOLINTEND
107
108 public:
109 // destructor thunk
110 // NOLINTBEGIN
111 MCFOLD void $dtor();
112 // NOLINTEND
113 };
114
115public:
116 // member variables
117 // NOLINTBEGIN
118 ::ll::TypedStorage<8, 8, ::ResourcePackManager*> mResourcePackManager;
119 ::ll::TypedStorage<8, 8, ::ExternalRecipeStore> mExternalRecipeStore;
120 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::std::map<::std::string, ::std::shared_ptr<::Recipe>>>>
121 mRecipes;
122 ::ll::TypedStorage<8, 16, ::std::map<::Recipes::FurnaceRecipeKey, ::ItemInstance>> mFurnaceRecipes;
123 ::ll::TypedStorage<1, 1, bool> mInitializing;
124 ::ll::TypedStorage<
125 8,
126 16,
127 ::std::map<::ItemInstance, ::std::unordered_map<::std::string, ::Recipe*>, ::SortItemInstanceIdAux>>
128 mRecipesByOutput;
129 ::ll::TypedStorage<8, 64, ::std::unordered_map<::RecipeNetId, ::Recipe*>> mRecipesByNetId;
130 ::ll::TypedStorage<
131 8,
132 64,
133 ::std::unordered_map<uint64, ::std::unordered_map<uint64, ::std::shared_ptr<::std::vector<::ItemInstance>>>>>
134 mRecipesByInput;
135 ::ll::TypedStorage<8, 24, ::std::vector<::gsl::not_null<::Recipe*>>> mUnlockableRecipes;
136 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::std::weak_ptr<bool>, ::std::function<void()>>>> mListeners;
137 ::ll::TypedStorage<8, 8, ::Level*> mLevel;
138 // NOLINTEND
139
140public:
141 // member functions
142 // NOLINTBEGIN
143 MCAPI explicit Recipes(::Level* level);
144
145 MCAPI void _addItemRecipe(::std::unique_ptr<::Recipe> recipe);
146
147 MCAPI void _addMapRecipes();
148
149 MCAPI ::RecipeUnlockingRequirement
150 _createUnlockingRequirementFromContext(::RecipeUnlockingRequirement::UnlockingContext context) const;
151
152 MCAPI bool _isRecipeValidToAdd(::Recipe const& recipe);
153
154 MCAPI bool _loadBrewingMix(::Json::Value const& objData, ::MinEngineVersion const& minEngineVersion);
155
156 MCAPI void _loadDataDrivenRecipes(::std::vector<::PackInstance> const& resourcePacksNewestToOldest);
157
158 MCAPI void _loadHardcodedRecipes(::BaseGameVersion const& baseGameVersion, ::Experiments const&);
159
160 MCAPI ::RecipeIngredient const _loadIngredientFromJson(
161 ::Json::Value const& obj,
162 ::MolangVersion molangVersion,
163 bool allowItemCount,
164 bool allowItemGroup
165 ) const;
166
167 MCAPI ::RecipeIngredient const
168 _loadInputIngredientFromJson(::Json::Value const& obj, ::MinEngineVersion const& minEngineVersion) const;
169
170 MCAPI ::RecipeIngredient const
171 _loadOutputIngredientFromJson(::Json::Value const& obj, ::MolangVersion molangVersion) const;
172
173 MCAPI bool _loadSmithingTransform(
174 ::Json::Value const& objData,
175 ::MolangVersion molangVersion,
176 ::std::string const& recipeId,
177 ::std::vector<::HashedString> const& tags
178 );
179
180 MCAPI bool _loadSmithingTrim(
181 ::Json::Value const& objData,
182 ::MolangVersion molangVersion,
183 ::std::string const& recipeId,
184 ::std::vector<::HashedString> const& tags
185 );
186
187 MCAPI ::std::optional<::RecipeUnlockingRequirement> _loadUnlockingRequirementFromJson(
188 ::Json::Value const& obj,
189 ::MolangVersion molangVersion,
190 ::std::string const& recipeId
191 ) const;
192
193 MCAPI void addBundleDyeRecipe(
194 ::std::string recipeId,
195 ::ItemInstance const& result,
196 ::RecipeIngredient dyedBundle,
198 ::RecipeUnlockingRequirement unlockingReq,
199 ::SemVersion const& formatVersion
200 );
201
202 MCAPI void addFurnaceRecipeAuxData(
203 ::ItemInstance const& input,
204 ::ItemInstance const& result,
205 ::std::vector<::HashedString> const& tags
206 );
207
208 MCAPI void addShapedRecipe(
209 ::std::string recipeId,
210 ::ItemInstance const& result,
211 ::std::string const& r0,
212 ::std::vector<::Recipes::Type> const& types,
213 ::std::vector<::HashedString> const& tags,
214 int constructor,
215 ::std::function<::std::unique_ptr<
216 ::ShapedRecipe>(::std::string, int, int, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, bool, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
217 unlockingReq,
218 ::RecipeUnlockingRequirement const& formatVersion,
219 ::SemVersion const& priority,
220 bool assumeSymmetry
221 );
222
223 MCAPI void addShapedRecipe(
224 ::std::string recipeId,
225 ::ItemInstance const& result,
226 ::std::vector<::std::string> const& rows,
227 ::std::vector<::Recipes::Type> const& types,
228 ::std::vector<::HashedString> const& tags,
229 int priority,
230 ::std::function<::std::unique_ptr<
231 ::ShapedRecipe>(::std::string, int, int, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, bool, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
232 constructor,
233 ::RecipeUnlockingRequirement const& unlockingReq,
234 ::SemVersion const& formatVersion,
235 bool assumeSymmetry
236 );
237
238 MCAPI void addShapedRecipe(
239 ::std::string recipeId,
240 ::std::vector<::ItemInstance> const& result,
241 ::std::vector<::std::string> const& rows,
242 ::std::vector<::Recipes::Type> const& types,
243 ::std::vector<::HashedString> const& tags,
244 int priority,
245 ::std::function<::std::unique_ptr<
246 ::ShapedRecipe>(::std::string, int, int, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, bool, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
247 constructor,
248 ::RecipeUnlockingRequirement const& unlockingReq,
249 ::SemVersion const& formatVersion,
250 bool assumeSymmetry
251 );
252
253 MCAPI void addShapedRecipe(
254 ::std::string recipeId,
255 ::ItemInstance const& result,
256 ::std::string const& r0,
257 ::std::string const& r1,
258 ::std::vector<::Recipes::Type> const& types,
259 ::std::vector<::HashedString> const& tags,
260 int priority,
261 ::std::function<::std::unique_ptr<
262 ::ShapedRecipe>(::std::string, int, int, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, bool, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
263 constructor,
264 ::RecipeUnlockingRequirement const& unlockingReq,
265 ::SemVersion const& formatVersion,
266 bool assumeSymmetry
267 );
268
269 MCAPI void addShapedRecipe(
270 ::std::string recipeId,
271 ::ItemInstance const& result,
272 ::std::string const& r0,
273 ::std::string const& r1,
274 ::std::string const& r2,
275 ::std::vector<::Recipes::Type> const& types,
276 ::std::vector<::HashedString> const& tags,
277 int priority,
278 ::std::function<::std::unique_ptr<
279 ::ShapedRecipe>(::std::string, int, int, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, bool, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
280 constructor,
281 ::RecipeUnlockingRequirement const& unlockingReq,
282 ::SemVersion const& formatVersion,
283 bool assumeSymmetry
284 );
285
286 MCAPI void addShapelessRecipe(
287 ::std::string recipeId,
288 ::ItemInstance const& result,
289 ::std::vector<::Recipes::Type> const& types,
290 ::std::vector<::HashedString> const& tags,
291 int priority,
292 ::std::function<::std::unique_ptr<
293 ::ShapelessRecipe>(::std::string, ::std::vector<::RecipeIngredient> const&, ::std::vector<::ItemInstance> const&, ::HashedString, int, ::mce::UUID const*, ::RecipeUnlockingRequirement const&, ::SemVersion const&)>
294 constructor,
295 ::RecipeUnlockingRequirement const& unlockingReq,
296 ::SemVersion const& formatVersion
297 );
298
299 MCAPI void addShulkerBoxRecipe(
300 ::std::string& recipeId,
301 ::ItemInstance const& result,
302 ::std::vector<::Recipes::Type> const& types,
303 ::std::vector<::HashedString> const& tags,
304 ::RecipeUnlockingRequirement const& unlockingReq,
305 ::SemVersion const& formatVersion
306 );
307
308 MCAPI void clearRecipes();
309
310 MCAPI ::SemVersion extractRecipeFormatVersion(::Json::Value const& obj);
311
312 MCAPI ::std::pair<::std::string, ::Json::Value> extractRecipeObjInfo(::Json::Value const& obj);
313
314 MCAPI ::ItemInstance getFurnaceRecipeResult(::ItemStackBase const& item, ::HashedString const& tag) const;
315
316 MCAPI ::Recipe const* getRecipeByNetId(::RecipeNetId const& netId) const;
317
318 MCAPI ::Recipe* getRecipeFor(::ItemInstance const& result, ::HashedString const& tag) const;
319
320 MCAPI void init(
321 ::ResourcePackManager& resourcePackManager,
322 ::ExternalRecipeStore& recipeStorage,
323 ::BaseGameVersion const& baseGameVersion,
324 ::Experiments const& experiments
325 );
326
327 MCAPI bool loadRecipe(
328 ::std::pair<::std::string, ::Json::Value> const& recipeObjInfo,
329 ::MinEngineVersion const& minEngineVersion,
330 ::SemVersion const& formatVersion,
331 bool isBaseGamePack
332 );
333
334 MCAPI ~Recipes();
335 // NOLINTEND
336
337public:
338 // static functions
339 // NOLINTBEGIN
340 MCAPI static ::Recipes::NormalizedRectangularRecipeResults
341 _normalizeRectangularRecipe(::std::vector<::std::string> const& rows);
342 // NOLINTEND
343
344public:
345 // constructor thunks
346 // NOLINTBEGIN
347 MCAPI void* $ctor(::Level* level);
348 // NOLINTEND
349
350public:
351 // destructor thunk
352 // NOLINTBEGIN
353 MCAPI void $dtor();
354 // NOLINTEND
355};
Definition BaseGameVersion.h:13
Definition Block.h:36
Definition Experiments.h:14
Definition ExternalRecipeStore.h:5
Definition HashedString.h:5
Definition ItemInstance.h:16
Definition ItemStackBase.h:35
Definition Item.h:65
Definition Value.h:16
Definition Level.h:234
Definition MinEngineVersion.h:10
Definition PackInstance.h:23
Definition RecipeIngredient.h:17
Definition RecipeUnlockingRequirement.h:10
Definition Recipe.h:29
Definition Recipes.h:67
Definition Recipes.h:36
Definition ResourcePackManager.h:24
Definition SemVersion.h:15
Definition ShapedRecipe.h:16
Definition ShapelessRecipe.h:16
Definition TypedServerNetId.h:6
Definition UUID.h:7
Definition RecipeNetIdTag.h:5
Definition Recipes.h:46
Definition SortItemInstanceIdAux.h:5
Definition context.h:5