LeviLamina
Loading...
Searching...
No Matches
BlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/core/container/EnumSet.h"
5
6// auto generated inclusion list
7#include "mc/world/level/BlockPos.h"
8#include "mc/world/level/block/actor/BlockActorType.h"
9
10// auto generated forward declare list
11// clang-format off
13class BlockSource;
14class BlockType;
15class CompoundTag;
17class DataLoadHelper;
19class ILevel;
23class LevelChunk;
24class Player;
26class SaveContext;
27// clang-format on
28
30public:
31 // BlockActor inner types define
32 enum class Property : uchar {
33 Changed = 0,
34 Movable = 1,
35 ClientSideOnly = 2,
36 SaveCustomName = 3,
37 CanRenderCustomName = 4,
38 Count = 5,
39 };
40
41 using MapIdType = ::std::unordered_map<::std::string, ::BlockActorType>;
42
43 using MapTypeId = ::std::unordered_map<::BlockActorType, ::std::string>;
44
46
47public:
48 LLAPI void refresh(optional_ref<class BlockSource> blockSource = std::nullopt);
49
50 LLNDAPI static std::shared_ptr<BlockActor> create(class CompoundTag const& nbt);
51
52 LLNDAPI static std::shared_ptr<BlockActor> create(class CompoundTag const& nbt, class BlockPos const& pos);
53
54 [[nodiscard]] BlockPos const& getPosition() const { return mPosition.get(); }
55
56 [[nodiscard]] BlockActorType getType() const { return mType; }
57
58public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<4, 12, ::BlockPos> mPosition;
62 ::ll::TypedStorage<1, 1, ::BlockActorType const> mType;
63 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DynamicPropertiesBlockActorComponent>> mDynamicProperties;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RandomizableContainerBlockActorComponent>> mRandomizableContainer;
65 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ContainerBlockActorComponent>> mContainer;
66 // NOLINTEND
67
68public:
69 // virtual functions
70 // NOLINTBEGIN
71 virtual ~BlockActor();
72
73 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& helper);
74
75 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
76
77 virtual bool saveItemInstanceData(::CompoundTag& tag) const;
78
79 virtual void saveBlockData(::CompoundTag& tag, ::BlockSource& region) const;
80
81 virtual void loadBlockData(::CompoundTag const& tag, ::BlockSource& region, ::DataLoadHelper& dataLoadHelper);
82
83 virtual void onCustomTagLoadDone(::BlockSource& region);
84
85 virtual void loadStatic();
86
87 virtual void onPlace(::BlockSource& region);
88
89 virtual void onMove();
90
91 virtual void onRemoved(::BlockSource& region);
92
93 virtual void onChunkLoaded(::LevelChunk& lc);
94
95 virtual void onChunkUnloaded(::LevelChunk& lc);
96
97 virtual void onSubChunkLoaded(::LevelChunk&, short, bool);
98
99 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
100
101 virtual void triggerEvent(int b0, int b1);
102
103 virtual bool isTypeOrDerived(::BlockActorType type) const;
104
105 virtual void getDebugText(
106 ::std::vector<::std::string>& outputInfo,
107 ::BlockPos const& debugPos,
108 ::BlockSource const* region
109 ) const;
110
111 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region);
112
113 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
114
115 virtual bool _playerCanUpdate(::Player const& player) const;
116
117 virtual ::IVanillaRenderBlockActorComponent const* _getRenderComponent() const;
118
119 virtual ::IVanillaRenderBlockActorComponent* _getRenderComponent();
120
121 virtual ::IVanillaTickBlockActorComponent const* _getTickComponent() const;
122
123 virtual ::IVanillaTickBlockActorComponent* _getTickComponent();
124
125 virtual ::IVanillaMainBlockActorComponent const* _getMainComponent() const;
126
127 virtual ::IVanillaMainBlockActorComponent* _getMainComponent();
128 // NOLINTEND
129
130public:
131 // member functions
132 // NOLINTBEGIN
133 MCAPI bool onUpdatePacket(::CompoundTag const& data, ::BlockSource& region, ::Player const* fromPlayer);
134 // NOLINTEND
135
136public:
137 // static functions
138 // NOLINTBEGIN
139 MCAPI static ::std::shared_ptr<::BlockActor> loadStatic(
140 ::BlockType const& block,
141 ::BlockPos const& pos,
142 ::ILevel& level,
143 ::CompoundTag const& tag,
144 ::DataLoadHelper& dataLoadHelper
145 );
146 // NOLINTEND
147
148public:
149 // static variables
150 // NOLINTBEGIN
151 MCAPI static ::std::string const& KEY_VERSION();
152 // NOLINTEND
153
154public:
155 // destructor thunk
156 // NOLINTBEGIN
157 MCAPI void $dtor();
158 // NOLINTEND
159
160public:
161 // virtual function thunks
162 // NOLINTBEGIN
163 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& helper);
164
165 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
166
167 MCAPI bool $saveItemInstanceData(::CompoundTag& tag) const;
168
169 MCFOLD void $saveBlockData(::CompoundTag& tag, ::BlockSource& region) const;
170
171 MCFOLD void $loadBlockData(::CompoundTag const& tag, ::BlockSource& region, ::DataLoadHelper& dataLoadHelper);
172
173 MCFOLD void $onCustomTagLoadDone(::BlockSource& region);
174
175 MCFOLD void $loadStatic();
176
177 MCFOLD void $onPlace(::BlockSource& region);
178
179 MCFOLD void $onMove();
180
181 MCFOLD void $onRemoved(::BlockSource& region);
182
183 MCFOLD void $onChunkLoaded(::LevelChunk& lc);
184
185 MCFOLD void $onChunkUnloaded(::LevelChunk& lc);
186
187 MCFOLD void $onSubChunkLoaded(::LevelChunk&, short, bool);
188
189 MCFOLD void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
190
191 MCFOLD void $triggerEvent(int b0, int b1);
192
193 MCAPI bool $isTypeOrDerived(::BlockActorType type) const;
194
195 MCAPI void $getDebugText(
196 ::std::vector<::std::string>& outputInfo,
197 ::BlockPos const& debugPos,
198 ::BlockSource const* region
199 ) const;
200
201 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
202
203 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
204
205 MCFOLD bool $_playerCanUpdate(::Player const& player) const;
206
207 MCFOLD ::IVanillaRenderBlockActorComponent const* $_getRenderComponent() const;
208
209 MCFOLD ::IVanillaRenderBlockActorComponent* $_getRenderComponent();
210
211 MCFOLD ::IVanillaTickBlockActorComponent const* $_getTickComponent() const;
212
213 MCFOLD ::IVanillaTickBlockActorComponent* $_getTickComponent();
214
215 MCFOLD ::IVanillaMainBlockActorComponent const* $_getMainComponent() const;
216
217 MCFOLD ::IVanillaMainBlockActorComponent* $_getMainComponent();
218
219
220 // NOLINTEND
221
222public:
223 // vftables
224 // NOLINTBEGIN
225 MCAPI static void** $vftable();
226 // NOLINTEND
227};
Definition EnumSet.h:9
Definition BlockActorDataPacket.h:19
Definition BlockActor.h:29
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition BlockType.h:79
Definition CompoundTag.h:18
Definition ContainerBlockActorComponent.h:18
Definition DataLoadHelper.h:20
Definition DynamicPropertiesBlockActorComponent.h:20
Definition ILevel.h:221
Definition IVanillaMainBlockActorComponent.h:18
Definition IVanillaRenderBlockActorComponent.h:19
Definition IVanillaTickBlockActorComponent.h:15
Definition LevelChunk.h:77
Definition Player.h:129
Definition RandomizableContainerBlockActorComponent.h:16
Definition SaveContext.h:5
Definition optional_ref.h:10