Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ItemInHandRenderer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/renderer/ActorShaderManager.h"
7#include "mc/client/renderer/game/ItemInHandRenderFrameId.h"
8#include "mc/deps/core/container/DenseEnumMap.h"
9#include "mc/deps/core/math/Matrix.h"
10#include "mc/deps/core/utility/pub_sub/Connector.h"
11#include "mc/deps/core/utility/pub_sub/Subscription.h"
12#include "mc/deps/minecraft_renderer/game/ItemContextFlags.h"
13#include "mc/deps/minecraft_renderer/renderer/MaterialPtr.h"
14#include "mc/deps/minecraft_renderer/renderer/TexturePtr.h"
15#include "mc/deps/renderer/MatrixStack.h"
16#include "mc/world/item/HandSlot.h"
17#include "mc/world/level/block/BlockShape.h"
18
19// auto generated forward declare list
20// clang-format off
21class Actor;
24class Block;
26class BlockType;
29class IClientInstance;
30class ItemRenderCall;
31class ItemStack;
32class Level;
33class Mob;
34class Player;
36class Tessellator;
38struct Brightness;
39namespace dragon { struct RenderMetadata; }
40namespace mce { class TextureGroup; }
41namespace mce::framebuilder { struct FrameLightingModelCapabilities; }
42// clang-format on
43
45public:
46 // ItemInHandRenderer inner types declare
47 // clang-format off
49 struct HandAnimationState;
50 // clang-format on
51
52 // ItemInHandRenderer inner types define
54 public:
55 // OffsetForLowAspectRatio inner types declare
56 // clang-format off
57 struct Scoped;
58 // clang-format on
59
60 // OffsetForLowAspectRatio inner types define
61 enum class Direction : uchar {
62 Left = 0,
63 Right = 1,
64 };
65
66 struct Scoped {
67 public:
68 // member variables
69 // NOLINTBEGIN
70 ::ll::UntypedStorage<1, 1> mUnk8b3a1f;
71 ::ll::UntypedStorage<8, 8> mUnkad04bd;
72 ::ll::UntypedStorage<8, 8> mUnk711535;
73 ::ll::UntypedStorage<8, 8> mUnk673c3d;
74 ::ll::UntypedStorage<1, 1> mUnk70d991;
75 ::ll::UntypedStorage<4, 4> mUnk1a7539;
76 ::ll::UntypedStorage<1, 1> mUnkb8460a;
77 // NOLINTEND
78
79 public:
80 // prevent constructor by default
81 Scoped& operator=(Scoped const&);
82 Scoped(Scoped const&);
83 Scoped();
84
85 public:
86 // member functions
87 // NOLINTBEGIN
88 MCNAPI ~Scoped();
89 // NOLINTEND
90
91 public:
92 // destructor thunk
93 // NOLINTBEGIN
94 MCNAPI void $dtor();
95 // NOLINTEND
96 };
97 };
98
99 struct HandAnimationState {
100 public:
101 // member variables
102 // NOLINTBEGIN
107 // NOLINTEND
108
109 public:
110 // prevent constructor by default
111 HandAnimationState& operator=(HandAnimationState const&);
114 };
115
116 using RenderMap = ::std::map<::ItemInHandRenderFrameId, ::ItemRenderCall>;
117
118public:
119 // member variables
120 // NOLINTBEGIN
121 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
122 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::TextureTessellator>> mTextureTessellator;
123 ::ll::TypedStorage<8, 336, ::Bedrock::DenseEnumMap<::HandSlot, ::ItemInHandRenderer::HandAnimationState, 2>>
124 mHandAnimationState;
125 ::ll::TypedStorage<8, 8, ::BlockTessellator&> mBlockTessellator;
126 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatOpaqueBlock;
127 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatOpaqueBlockColor;
128 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatAlphaBlock;
129 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatItem;
130 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatBlendBlock;
131 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatBlendBlockNoColor;
132 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatAlphaColoredBlock;
133 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatItemMultiColorTint;
134 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatAlphaOneSidedBlock;
135 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatAlphaOneSidedColoredBlock;
136 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatOpaqueBlockGlint;
137 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatAlphaBlockGlint;
138 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatItemGlint;
139 ::ll::TypedStorage<8, 16, ::mce::MaterialPtr> mMatFishingLine;
140 ::ll::TypedStorage<8, 128, ::std::array<::mce::MaterialPtr const*, 16>> mMaterialMatrix;
141 ::ll::TypedStorage<8, 32, ::mce::TexturePtr> mGlintTexture;
142 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BannerBlockActor>> mBannerEntity;
143 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DecoratedPotBlockActor>> mDecoratedPotEntity;
144 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SerializedActorBlockActor>> mCopperGolemStatueEntity;
145 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ConduitBlockActor>> mConduitEntity;
146 ::ll::TypedStorage<8, 16, ::std::map<::ItemInHandRenderFrameId, ::ItemRenderCall>> mRenderObjects;
147 ::ll::TypedStorage<4, 64, ::Matrix> mTransform;
148 ::ll::TypedStorage<4, 64, ::Matrix> mPreFirstPersonItemRenderProj;
149 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mPauseStateChange;
150 ::ll::TypedStorage<8, 8, ::std::chrono::duration<double, ::std::ratio<1, 1>>> mTimer;
151 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastTime;
152 ::ll::TypedStorage<1, 1, bool> mIsDeferredEnabled;
153 // NOLINTEND
154
155public:
156 // prevent constructor by default
157 ItemInHandRenderer& operator=(ItemInHandRenderer const&);
160
161public:
162 // virtual functions
163 // NOLINTBEGIN
164 virtual ~ItemInHandRenderer() /*override*/ = default;
165 // NOLINTEND
166
167public:
168 // member functions
169 // NOLINTBEGIN
171 ::IClientInstance& client,
172 ::BlockTessellator& commonRenderer,
173 ::std::shared_ptr<::mce::TextureGroup> textureGroup
174 );
175
176 MCAPI void _applyDefaultItemTransforms(
178 ::ItemStack const& item,
179 bool isInHandItem,
180 ::BlockType const* blockType,
181 ::BlockShape blockShape,
182 ::ItemRenderCall const* renderObjectCall,
183 float heldItemScale,
184 bool posAndRotSetByJSON
185 );
186
187 MCNAPI ::ItemRenderCall* _getRenderCall(::Mob* mob, ::ItemStack const& itemInstance, int fallbackFrame);
188
189 MCNAPI void
191
192 MCNAPI ::ItemRenderCall&
193 _rebuildItem(::BaseActorRenderContext& renderContext, ::Mob* mob, ::ItemStack const& item, int fallbackFrame);
194
196 ::BaseActorRenderContext& renderContext,
197 ::dragon::RenderMetadata const renderMetadata,
198 ::ItemStack const& item,
199 ::Actor& entity,
200 ::Brightness lightEmission,
201 ::std::optional<::glm::vec3> const& lightEmissionColor,
202 float frameAlpha,
203 float scale
204 ) const;
205
207 ::BaseActorRenderContext& renderContext,
208 ::dragon::RenderMetadata const renderMetadata,
209 ::Actor& entity,
210 ::Brightness lightEmission,
211 ::std::optional<::glm::vec3> const& lightEmissionColor,
212 float frameAlpha
213 ) const;
214
216 ::BaseActorRenderContext& renderContext,
217 ::dragon::RenderMetadata const renderMetadata,
218 ::ItemStack const& item,
219 ::Actor& entity,
220 bool const isFirstPerson,
221 bool const isInHandItem
222 ) const;
223
225 ::BaseActorRenderContext& renderContext,
226 ::dragon::RenderMetadata const renderMetadata,
227 ::ItemStack const& item,
228 ::Actor& entity,
229 bool const isFirstPerson
230 ) const;
231
233 ::BaseActorRenderContext& renderContext,
234 ::dragon::RenderMetadata const renderMetadata,
235 ::ItemStack const& item,
236 ::Actor& entity,
237 ::Brightness lightEmission,
238 ::std::optional<::glm::vec3> const& lightEmissionColor,
239 float frameAlpha,
240 ::ItemContextFlags itemFlags,
241 float scale
242 );
243
244 MCAPI void _renderMiniMapHand(::BaseActorRenderContext& renderContext, ::Player& player, bool inOffhand);
245
246 MCAPI void _renderPhotoMapItem(
247 ::BaseActorRenderContext& renderContext,
248 ::Player& player,
249 float const frameAlpha,
250 bool const isMainHand
251 );
252
254 ::Tessellator& tessellator,
256 ::Block const& block,
258 );
259
262 ::ItemStack const& item,
263 bool const isMainHand,
264 ::ItemContextFlags itemFlags,
265 float textureScale
266 );
267
268 MCNAPI void clearRenderObjects();
269
270 MCAPI ::ItemRenderCall const&
271 getRenderCallAtFrame(::BaseActorRenderContext& renderContext, ::ItemStack const& item, int frame);
272
274
275 MCAPI void
276 renderFirstPerson(::BaseActorRenderContext& renderContext, ::Matrix const& prevProj, ::ItemContextFlags itemFlags);
277
278 MCAPI void renderItem(
279 ::BaseActorRenderContext& renderContext,
280 ::Actor& entity,
281 ::ItemStack const& item,
282 bool posAndRotSetByJSON,
283 ::ItemContextFlags itemFlags,
284 bool useMatrixAsIs,
285 bool renderingMainHand
286 );
287
288 MCNAPI void renderItemNew(
289 ::BaseActorRenderContext& renderContext,
290 ::Actor& entity,
291 ::ItemStack const& item,
292 ::ItemContextFlags itemFlags,
293 ::Brightness lightEmission
294 );
295
296 MCAPI void renderObject(
297 ::BaseActorRenderContext& renderContext,
298 ::ItemRenderCall const& renderObject,
299 ::dragon::RenderMetadata const& renderMetadata,
300 ::ItemContextFlags itemFlags
301 );
302
303 MCNAPI void
304 tessellateAtFrame(::BaseActorRenderContext& renderContext, ::Mob* mob, ::ItemStack const& item, int frame);
305 // NOLINTEND
306
307public:
308 // static functions
309 // NOLINTBEGIN
310 MCNAPI static bool _areNotMatchingChemistrySticks(::ItemStack& itemBefore, ::ItemStack const& itemAfter);
311
312 MCNAPI static ::dragon::RenderMetadata _createRenderMetadata(
313 ::BaseActorRenderContext const& renderContext,
314 ::Actor const& entity,
315 ::ItemStack const& item,
316 bool const isPaperDoll
317 );
318
319 MCNAPI static void _tessellateTextureItem(
320 ::BaseActorRenderContext& renderContext,
321 ::TextureTessellator& textureTessellator,
322 ::Mob* mob,
323 ::ItemStack const& item,
324 int fallbackFrame,
325 ushort& heightOut,
326 ushort& widthOut
327 );
328
329 MCAPI static bool canTessellateAsBlockItem(::ItemStack const& item);
330 // NOLINTEND
331
332public:
333 // constructor thunks
334 // NOLINTBEGIN
335 MCNAPI void* $ctor(
336 ::IClientInstance& client,
337 ::BlockTessellator& commonRenderer,
338 ::std::shared_ptr<::mce::TextureGroup> textureGroup
339 );
340 // NOLINTEND
341};
Definition ActorShaderManager.h:5
Definition Actor.h:116
Definition BannerBlockActor.h:21
Definition BaseActorRenderContext.h:5
Definition Connector.h:15
Definition BlockTessellator.h:5
Definition BlockType.h:79
Definition Block.h:42
Definition ConduitBlockActor.h:20
Definition DecoratedPotBlockActor.h:23
Definition IClientInstance.h:5
Definition ItemInHandRenderer.h:5
MCAPI void tessellateAtFrame(::BaseActorRenderContext &renderContext, ::Mob *mob, ::ItemStack const &item, int frame)
MCAPI void _tessellateBlockItem(::Tessellator &tessellator, ::BlockTessellator &t, ::Block const &block, ::mce::framebuilder::FrameLightingModelCapabilities const &lightingModelCaps)
MCAPI void * $ctor(::IClientInstance &client, ::BlockTessellator &commonRenderer, ::std::shared_ptr<::mce::TextureGroup > textureGroup)
static MCAPI ::dragon::RenderMetadata _createRenderMetadata(::BaseActorRenderContext const &renderContext, ::Actor const &entity, ::ItemStack const &item, bool const isPaperDoll)
MCAPI void renderItemNew(::BaseActorRenderContext &renderContext, ::Actor &entity, ::ItemStack const &item, ::ItemContextFlags itemFlags, ::Brightness lightEmission)
MCAPI void _renderDecoratedPotBlockItem(::BaseActorRenderContext &renderContext, ::dragon::RenderMetadata const renderMetadata, ::ItemStack const &item, ::Actor &entity, bool const isFirstPerson) const
MCAPI void _renderCopperGolemStatueBlockItem(::BaseActorRenderContext &renderContext, ::dragon::RenderMetadata const renderMetadata, ::ItemStack const &item, ::Actor &entity, bool const isFirstPerson, bool const isInHandItem) const
MCAPI void _renderConduitBlockItem(::BaseActorRenderContext &renderContext, ::dragon::RenderMetadata const renderMetadata, ::Actor &entity, ::Brightness lightEmission, ::std::optional<::glm::vec3 > const &lightEmissionColor, float frameAlpha) const
MCAPI void _renderGlowstickBlockItem(::BaseActorRenderContext &renderContext, ::dragon::RenderMetadata const renderMetadata, ::ItemStack const &item, ::Actor &entity, ::Brightness lightEmission, ::std::optional<::glm::vec3 > const &lightEmissionColor, float frameAlpha, ::ItemContextFlags itemFlags, float scale)
MCAPI void registerPauseManagerCallback(::Bedrock::PubSub::Connector< void(bool)> &connector)
MCAPI::ItemRenderCall * _getRenderCall(::Mob *mob, ::ItemStack const &itemInstance, int fallbackFrame)
static MCAPI bool _areNotMatchingChemistrySticks(::ItemStack &itemBefore, ::ItemStack const &itemAfter)
MCAPI ItemInHandRenderer(::IClientInstance &client, ::BlockTessellator &commonRenderer, ::std::shared_ptr<::mce::TextureGroup > textureGroup)
MCAPI void _renderBannerBlockItem(::BaseActorRenderContext &renderContext, ::dragon::RenderMetadata const renderMetadata, ::ItemStack const &item, ::Actor &entity, ::Brightness lightEmission, ::std::optional<::glm::vec3 > const &lightEmissionColor, float frameAlpha, float scale) const
MCAPI void clearRenderObjects()
static MCAPI void _tessellateTextureItem(::BaseActorRenderContext &renderContext, ::TextureTessellator &textureTessellator, ::Mob *mob, ::ItemStack const &item, int fallbackFrame, ushort &heightOut, ushort &widthOut)
MCAPI void _transformWorldMatrixFromJson(::MatrixStack::MatrixStackRef &worldMatrix, ::ItemStack const &item, bool const isMainHand, ::ItemContextFlags itemFlags, float textureScale)
MCAPI::ItemRenderCall & _rebuildItem(::BaseActorRenderContext &renderContext, ::Mob *mob, ::ItemStack const &item, int fallbackFrame)
MCAPI void _pushSparklerParticles(::BaseActorRenderContext &renderContext, ::ItemStack const &item, ::Level &level)
Definition ItemRenderCall.h:5
Definition ItemStack.h:26
Definition Level.h:255
Definition Matrix.h:10
Definition Mob.h:58
Definition Player.h:131
Definition SerializedActorBlockActor.h:26
Definition Tessellator.h:5
Definition TextureTessellator.h:5
Definition TextureGroup.h:7
Definition Brightness.h:8
Definition ItemInHandRenderer.h:27
Definition ItemInHandRenderer.h:24
Definition ItemInHandRenderer.h:14
Definition MatrixStack.h:13
Definition RenderMetadata.h:7
Definition Alias.h:14
Definition FrameLightingModelCapabilities.h:7