LeviLamina
Loading...
Searching...
No Matches
PlanterItemComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/pub_sub/Subscription.h"
7#include "mc/world/item/components/BlockTypePtr.h"
8#include "mc/world/item/components/NetworkedItemComponent.h"
9#include "mc/world/level/storage/AllExperiments.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
14class Block;
15class BlockDescriptor;
16class BlockPos;
17class BlockType;
18class ComponentItem;
19class CompoundTag;
20class HashedString;
21class ItemStack;
22class ItemStackBase;
23class SemVersion;
24class Vec3;
25namespace SharedTypes::v1_26_0 { struct PlanterItemComponent; }
26namespace cereal { struct ReflectionCtx; }
27// clang-format on
28
29class PlanterItemComponent : public ::NetworkedItemComponent<::PlanterItemComponent> {
30public:
31 // PlanterItemComponent inner types declare
32 // clang-format off
34 // clang-format on
35
36 // PlanterItemComponent inner types define
38 public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<8, 8, ::BlockType const*> mBlock;
42 ::ll::TypedStorage<1, 1, bool const> mAlignedPlacement;
43 // NOLINTEND
44 };
45
46public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<8, 8, ::BlockTypePtr> mBlock;
50 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mAllowedUseBlocks;
51 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseOnSubscription;
52 ::ll::TypedStorage<1, 1, bool> mCanUseBlockAsIcon;
53 ::ll::TypedStorage<1, 1, bool> mReplaceBlockItem;
54 ::ll::TypedStorage<1, 1, bool> mAlignedPlacement;
55 // NOLINTEND
56
57public:
58 // prevent constructor by default
59 PlanterItemComponent& operator=(PlanterItemComponent const&);
60 PlanterItemComponent(PlanterItemComponent const&);
61 PlanterItemComponent();
62
63public:
64 // virtual functions
65 // NOLINTBEGIN
66 virtual void handleVersionBasedInitialization(::SemVersion const& originalJsonVersion) /*override*/;
67
68 virtual void _initializeComponent(::ComponentItem& owner) /*override*/;
69
70 virtual ::std::unique_ptr<::CompoundTag> buildNetworkTag(::cereal::ReflectionCtx const& ctx) const /*override*/;
71
72 virtual bool initializeFromNetwork(::CompoundTag const& tag, ::cereal::ReflectionCtx const& ctx) /*override*/;
73 // NOLINTEND
74
75public:
76 // member functions
77 // NOLINTBEGIN
78 MCAPI explicit PlanterItemComponent(::Block const& block);
79
80 MCAPI explicit PlanterItemComponent(::SharedTypes::v1_26_0::PlanterItemComponent component);
81
82 MCAPI bool _placeBlock(
83 ::ItemStack& item,
84 ::Actor& entity,
85 ::Block const& block,
86 ::BlockPos const& placePos,
87 uchar face,
88 ::Vec3 const& clickPos
89 ) const;
90
91 MCAPI void _useOn(
92 bool& result,
93 ::ItemStack const& currentItemStack,
94 ::ItemStack& entity,
95 ::Actor& blockPos,
96 ::BlockPos const& face,
97 uchar clickPos,
98 ::Vec3 const&
99 );
100
101 MCAPI bool calculatePlacePos(::ItemStackBase const& instance, ::Actor& entity, uchar& face, ::BlockPos& pos) const;
102
103 MCAPI bool canUseOn(::ItemStack const& instance, ::Actor& entity, ::BlockPos const& pos, uchar face) const;
104
105 MCAPI ::HashedString const& getBlockIdentifier() const;
106
107 MCFOLD bool isReplacingBlockItem() const;
108
109 MCAPI ::PlanterItemComponent& operator=(::PlanterItemComponent&&);
110 // NOLINTEND
111
112public:
113 // static functions
114 // NOLINTBEGIN
115 MCAPI static void bindType(
117 ::std::vector<::AllExperiments> const& requiredToggles,
118 ::std::optional<::SemVersion> releasedMinFormatVersion
119 );
120
121 MCAPI static ::PlanterItemComponent::BlockPlacementContext getBlockPlacementContext(::ItemStackBase const& item);
122
123 MCAPI static ::HashedString const& getIdentifier();
124 // NOLINTEND
125
126public:
127 // constructor thunks
128 // NOLINTBEGIN
129 MCAPI void* $ctor(::Block const& block);
130
131 MCAPI void* $ctor(::SharedTypes::v1_26_0::PlanterItemComponent component);
132 // NOLINTEND
133
134public:
135 // virtual function thunks
136 // NOLINTBEGIN
137 MCAPI void $handleVersionBasedInitialization(::SemVersion const& originalJsonVersion);
138
139 MCAPI void $_initializeComponent(::ComponentItem& owner);
140
141 MCAPI ::std::unique_ptr<::CompoundTag> $buildNetworkTag(::cereal::ReflectionCtx const& ctx) const;
142
143 MCAPI bool $initializeFromNetwork(::CompoundTag const& tag, ::cereal::ReflectionCtx const& ctx);
144
145
146 // NOLINTEND
147
148public:
149 // vftables
150 // NOLINTBEGIN
151 MCNAPI static void** $vftable();
152 // NOLINTEND
153};
Definition Actor.h:123
Definition BlockDescriptor.h:21
Definition BlockPos.h:21
Definition BlockType.h:84
Definition Block.h:69
Definition ComponentItem.h:55
Definition CompoundTag.h:23
Definition HashedString.h:5
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition NetworkedItemComponent.h:7
static MCAPI void ** $vftable()
Definition SemVersion.h:15
Definition Vec3.h:10
Definition PlanterItemComponent.h:37
Definition PlanterItemComponent.h:17
Definition ReflectionCtx.h:11
Definition ctx.h:5