LeviLamina
Loading...
Searching...
No Matches
Recipe.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/core/string/HashedString.h"
5#include "mc/platform/UUID.h"
6#include "mc/world/item/crafting/RecipeIngredient.h"
7#include "mc/world/item/crafting/RecipeUnlockingRequirement.h"
8
9// auto generated inclusion list
10#include "mc/deps/core/sem_ver/SemVersion.h"
11#include "mc/deps/core/string/HashedString.h"
12#include "mc/platform/UUID.h"
13#include "mc/world/inventory/network/TypedServerNetId.h"
14#include "mc/world/item/crafting/RecipeUnlockingRequirement.h"
15
16// auto generated forward declare list
17// clang-format off
18class CompoundTag;
19class ContainerModel;
21class CraftingContext;
22class ItemDescriptor;
23class ItemInstance;
24class ItemStack;
28struct RecipeNetIdTag;
29// clang-format on
30
31class Recipe {
32public:
33 // Recipe inner types declare
34 // clang-format off
35 class Results;
37 // clang-format on
38
39 // Recipe inner types define
40 class Results {
41 public:
42 // member variables
43 // NOLINTBEGIN
44 ::ll::TypedStorage<1, 1, bool> mResultsAreLoaded;
45 ::ll::TypedStorage<8, 24, ::std::vector<::ItemInstance>> mResults;
46 ::ll::TypedStorage<8, 24, ::std::vector<::NetworkItemInstanceDescriptor>> mUnloadedResults;
47 // NOLINTEND
48
49 public:
50 // member functions
51 // NOLINTBEGIN
52 MCAPI ~Results();
53 // NOLINTEND
54
55 public:
56 // destructor thunk
57 // NOLINTBEGIN
58 MCAPI void $dtor();
59 // NOLINTEND
60 };
61
63 public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 32, ::std::string> recipeId;
67 ::ll::TypedStorage<8, 24, ::std::vector<::RecipeIngredient>> ingredients;
68 ::ll::TypedStorage<8, 56, ::Recipe::Results> results;
69 ::ll::TypedStorage<8, 48, ::HashedString> tag;
70 ::ll::TypedStorage<4, 4, int> priority;
71 ::ll::TypedStorage<8, 8, ::mce::UUID const*> uuid;
72 ::ll::TypedStorage<8, 32, ::RecipeUnlockingRequirement> unlockingRequirement;
73 ::ll::TypedStorage<8, 24, ::SemVersion> formatVersion;
74 // NOLINTEND
75
76 public:
77 // member functions
78 // NOLINTBEGIN
80 // NOLINTEND
81
82 public:
83 // destructor thunk
84 // NOLINTBEGIN
85 MCAPI void $dtor();
86 // NOLINTEND
87 };
88
89 using Ingredients = ::std::vector<::RecipeIngredient>;
90
91 using ResultList = ::std::vector<::ItemInstance>;
92
93 using UnloadedItemInstanceResultList = ::std::vector<::NetworkItemInstanceDescriptor>;
94
95public:
96 // member variables
97 // NOLINTBEGIN
98 ::ll::TypedStorage<8, 32, ::std::string> mRecipeId;
99 ::ll::TypedStorage<8, 16, ::mce::UUID> mMyId;
100 ::ll::TypedStorage<4, 4, int> mWidth;
101 ::ll::TypedStorage<4, 4, int> mHeight;
102 ::ll::TypedStorage<4, 4, int> mPriority;
103 ::ll::TypedStorage<4, 4, ::RecipeNetId> mRecipeNetId;
104 ::ll::TypedStorage<8, 24, ::std::vector<::RecipeIngredient>> mMyIngredients;
105 ::ll::TypedStorage<8, 56, ::Recipe::Results> mResults;
106 ::ll::TypedStorage<8, 32, ::RecipeUnlockingRequirement> mUnlockingRequirement;
107 ::ll::TypedStorage<8, 24, ::SemVersion> mRecipeDataVersion;
108 ::ll::TypedStorage<8, 48, ::HashedString> mTag;
109 // NOLINTEND
110
111#ifdef LL_PLAT_S
112public:
113 // prevent constructor by default
114 Recipe();
115
116#else // LL_PLAT_C
117public:
118 // prevent constructor by default
119 Recipe& operator=(Recipe const&);
120 Recipe(Recipe const&);
121 Recipe();
122
123#endif
124public:
125 // virtual functions
126 // NOLINTBEGIN
127 virtual ~Recipe();
128
129 virtual ::std::vector<::ItemInstance> const&
130 assemble(::CraftingContainer& craftSlots, ::CraftingContext& craftingContext) const = 0;
131
132 virtual int getCraftingSize() const = 0;
133
134 virtual ::RecipeIngredient const& getIngredient(int x, int y) const = 0;
135
136 virtual bool isShapeless() const = 0;
137
138 virtual bool matches(::CraftingContainer const& craftSlots, ::CraftingContext const& craftingContext) const = 0;
139
140 virtual int size() const = 0;
141
142 virtual ::mce::UUID const& getId() const;
143
144 virtual ::std::vector<::ItemInstance> const& getResultItems() const;
145
146 virtual bool isMultiRecipe() const;
147
148 virtual bool hasDataDrivenResult() const;
149
150 virtual bool itemValidForRecipe(::ItemDescriptor const& recipeItem, ::ItemStack const& item) const;
151
152 virtual bool itemsMatch(::ItemDescriptor const& lhs, ::ItemDescriptor const& rhs) const;
153
154 virtual bool
155 itemsMatch(::ItemDescriptor const& lhs, ::ItemDescriptor const& rhs, ::CompoundTag const* rhsTag) const;
156
157 virtual uint64 getIngredientsHash() const;
158 // NOLINTEND
159
160public:
161 // member functions
162 // NOLINTBEGIN
163 MCAPI explicit Recipe(::Recipe::ConstructionContext&& context);
164
165#ifdef LL_PLAT_C
166 MCAPI Recipe(::Recipe&& recipe);
167
168 MCAPI ::IngredientSearchResults
169 checkContainerItemsForUsability(::std::vector<::ContainerModel*> const& containers) const;
170#endif
171
172 MCAPI int countQuantityOfIngredient(::ItemInstance const& ingredient) const;
173
174 MCAPI void generateUUID();
175
176 MCAPI ::Recipe::ConstructionContext getConstructionContext() const;
177 // NOLINTEND
178
179public:
180 // static functions
181 // NOLINTBEGIN
182 MCAPI static bool isAnyAuxValue(::ItemDescriptor const& ii);
183 // NOLINTEND
184
185public:
186 // constructor thunks
187 // NOLINTBEGIN
188 MCAPI void* $ctor(::Recipe::ConstructionContext&& context);
189
190#ifdef LL_PLAT_C
191 MCAPI void* $ctor(::Recipe&& recipe);
192#endif
193 // NOLINTEND
194
195public:
196 // destructor thunk
197 // NOLINTBEGIN
198 MCAPI void $dtor();
199 // NOLINTEND
200
201public:
202 // virtual function thunks
203 // NOLINTBEGIN
204 MCFOLD ::mce::UUID const& $getId() const;
205
206 MCFOLD ::std::vector<::ItemInstance> const& $getResultItems() const;
207
208 MCFOLD bool $isMultiRecipe() const;
209
210 MCFOLD bool $hasDataDrivenResult() const;
211
212 MCAPI bool $itemValidForRecipe(::ItemDescriptor const& recipeItem, ::ItemStack const& item) const;
213
214 MCAPI bool $itemsMatch(::ItemDescriptor const& lhs, ::ItemDescriptor const& rhs) const;
215
216 MCFOLD bool
217 $itemsMatch(::ItemDescriptor const& lhs, ::ItemDescriptor const& rhs, ::CompoundTag const* rhsTag) const;
218
219 MCAPI uint64 $getIngredientsHash() const;
220
221
222 // NOLINTEND
223
224public:
225 // vftables
226 // NOLINTBEGIN
227 MCAPI static void** $vftable();
228 // NOLINTEND
229};
Definition CompoundTag.h:23
Definition ContainerModel.h:27
Definition CraftingContainer.h:14
Definition CraftingContext.h:20
Definition ItemDescriptor.h:24
Definition ItemInstance.h:15
Definition ItemStack.h:26
Definition NetworkItemInstanceDescriptor.h:16
Definition RecipeIngredient.h:17
Definition Recipe.h:40
Definition IngredientSearchResults.h:10
Definition RecipeNetIdTag.h:5
Definition Recipe.h:62
Definition context.h:5