LeviLamina
Loading...
Searching...
No Matches
SignBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Color.h"
7#include "mc/deps/game_refs/WeakRef.h"
8#include "mc/deps/input/InputMode.h"
9#include "mc/input/NewInteractionModel.h"
10#include "mc/legacy/ActorUniqueID.h"
11#include "mc/network/packet/OpenSignPacket.h"
12#include "mc/platform/brstd/move_only_function.h"
13#include "mc/textobject/TextObjectRoot.h"
14#include "mc/world/level/block/actor/BlockActor.h"
15#include "mc/world/level/block/actor/BlockActorRendererId.h"
16#include "mc/world/level/block/actor/BlockActorType.h"
17#include "mc/world/level/block/actor/SignTextSide.h"
18
19// auto generated forward declare list
20// clang-format off
22class BlockPos;
23class BlockSource;
24class CompoundTag;
25class DataLoadHelper;
26class EntityContext;
27class ILevel;
28class Player;
29class SaveContext;
30// clang-format on
31
32class SignBlockActor : public ::BlockActor {
33public:
34 // SignBlockActor inner types declare
35 // clang-format off
36 struct CachedLineData;
37 struct CachedMessageData;
38 struct OpenSignRequest;
39 class Text;
40 // clang-format on
41
42 // SignBlockActor inner types define
44 public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<8, 32, ::std::string> text;
48 ::ll::TypedStorage<4, 4, int> lineLength;
49 // NOLINTEND
50
51 public:
52 // member functions
53 // NOLINTBEGIN
54#ifdef LL_PLAT_C
55 MCAPI ~CachedLineData();
56#endif
57 // NOLINTEND
58
59 public:
60 // destructor thunk
61 // NOLINTBEGIN
62#ifdef LL_PLAT_C
63 MCFOLD void $dtor();
64#endif
65 // NOLINTEND
66 };
67
68 struct CachedMessageData {
69 public:
70 // member variables
71 // NOLINTBEGIN
72 ::ll::TypedStorage<8, 160, ::SignBlockActor::CachedLineData[4]> lineData;
73 ::ll::TypedStorage<4, 4, uint> numLines;
74 ::ll::TypedStorage<8, 32, ::std::string> filteredMessage;
75 ::ll::TypedStorage<8, 8, void const*> cachedFontCompare;
76 ::ll::TypedStorage<1, 1, bool> dirty;
77 ::ll::TypedStorage<4, 4, ::InputMode> inputMode;
78 ::ll::TypedStorage<4, 4, ::NewInteractionModel> interactionModel;
79 // NOLINTEND
80
81#ifdef LL_PLAT_S
82#else // LL_PLAT_C
83 public:
84 // prevent constructor by default
85 CachedMessageData& operator=(CachedMessageData const&);
86 CachedMessageData();
87
88#endif
89 public:
90 // member functions
91 // NOLINTBEGIN
92#ifdef LL_PLAT_C
93 MCAPI CachedMessageData(::SignBlockActor::CachedMessageData const&);
94
95 MCAPI ::SignBlockActor::CachedMessageData& operator=(::SignBlockActor::CachedMessageData&&);
96#endif
97
98 MCAPI ~CachedMessageData();
99 // NOLINTEND
100
101 public:
102 // constructor thunks
103 // NOLINTBEGIN
104#ifdef LL_PLAT_C
105 MCAPI void* $ctor(::SignBlockActor::CachedMessageData const&);
106#endif
107 // NOLINTEND
108
109 public:
110 // destructor thunk
111 // NOLINTBEGIN
112 MCAPI void $dtor();
113 // NOLINTEND
114 };
115
117 public:
118 // member variables
119 // NOLINTBEGIN
120 ::ll::TypedStorage<1, 1, bool> mIsWaitingForChangeClear;
121 ::ll::TypedStorage<8, 72, ::OpenSignPacket> mOpenSignPacket;
122 ::ll::TypedStorage<8, 64, ::brstd::move_only_function<void(::OpenSignPacket&)>> mSendPacket;
123 // NOLINTEND
124 };
125
126 class Text {
127 public:
128 // Text inner types define
129 enum class LoadMode : int {
130 TextOnly = 0,
131 AllData = 1,
132 };
133
134 public:
135 // member variables
136 // NOLINTBEGIN
137 ::ll::TypedStorage<8, 32, ::std::string> mMessage;
138 ::ll::TypedStorage<8, 32, ::std::string> mFilteredMessage;
139 ::ll::TypedStorage<8, 32, ::TextObjectRoot> mTextObjectMessage;
140 ::ll::TypedStorage<8, 224, ::SignBlockActor::CachedMessageData> mCachedMessage;
141 ::ll::TypedStorage<4, 16, ::mce::Color> mSignTextColor;
142 ::ll::TypedStorage<1, 1, bool> mGlowing;
143 ::ll::TypedStorage<1, 1, bool> mHideGlowOutline;
144 ::ll::TypedStorage<1, 1, bool> mShouldPersistFormatting;
145 ::ll::TypedStorage<8, 32, ::std::string> mLastEditXuid;
146 ::ll::TypedStorage<8, 32, ::std::string> mTextObjectString;
147 // NOLINTEND
148
149 public:
150 // member functions
151 // NOLINTBEGIN
152 MCAPI void _parseOldVersionText(::CompoundTag const& tag);
153
154 MCAPI void _parseOtherAttributes(::CompoundTag const& tag);
155
156 MCAPI void _parseText(::CompoundTag const& tag);
157
158 MCAPI ::std::string const& getMessage() const;
159
160 MCAPI void load(::CompoundTag const& tag, ::SignBlockActor::Text::LoadMode load);
161
162 MCAPI bool save(::CompoundTag& tag) const;
163
164 MCAPI void setMessage(::std::string message);
165
166 MCAPI void setMessage(::TextObjectRoot message);
167
168 MCAPI ~Text();
169 // NOLINTEND
170
171 public:
172 // static variables
173 // NOLINTBEGIN
174 MCAPI static ::std::add_lvalue_reference_t<char const[]> SIGN_PERSIST_FORMATTING_TAG();
175 // NOLINTEND
176
177 public:
178 // destructor thunk
179 // NOLINTBEGIN
180 MCAPI void $dtor();
181 // NOLINTEND
182 };
183
184public:
185 // member variables
186 // NOLINTBEGIN
187 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SignBlockActor::Text>> mTextFront;
188 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SignBlockActor::Text>> mTextBack;
189 ::ll::TypedStorage<1, 1, bool> mIsWaxed;
190 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLockedForEditingBy;
191 ::ll::TypedStorage<8, 152, ::std::optional<::SignBlockActor::OpenSignRequest>> mOpenSignRequest;
192 ::ll::TypedStorage<1, 1, bool> mIsRemoteProfanityFilterEnabled;
193 ::ll::TypedStorage<1, 1, bool> mIsLocalProfanityFilterEnabled;
194 // NOLINTEND
195
196public:
197 // prevent constructor by default
198 SignBlockActor();
199
200public:
201 // virtual functions
202 // NOLINTBEGIN
203 virtual ~SignBlockActor() /*override*/;
204
205 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
206
207 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
208
209 virtual void onChanged(::BlockSource& region) /*override*/;
210
211 virtual float getShadowRadius(::BlockSource& region) const /*override*/;
212
213 virtual ::std::string getImmersiveReaderText(::BlockSource& region) /*override*/;
214
215 virtual void tick(::BlockSource& region) /*override*/;
216
217 virtual ::std::vector<::std::string> getUgcStrings(::CompoundTag const& tag) const /*override*/;
218
219 virtual ::std::vector<::std::string> getFilteredUgcStrings(::CompoundTag const& tag) const /*override*/;
220
221 virtual void setUgcStrings(::CompoundTag& tag, ::std::vector<::std::string> const& list) const /*override*/;
222
223 virtual void setFilteredUgcStrings(::CompoundTag& tag, ::std::vector<::std::string> const& list) const /*override*/;
224
225 virtual bool validateData(::CompoundTag const& tag) const /*override*/;
226
227 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
228
229 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
230
231 virtual bool _playerCanUpdate(::Player const& fromPlayer) const /*override*/;
232 // NOLINTEND
233
234public:
235 // member functions
236 // NOLINTBEGIN
237 MCAPI SignBlockActor(::BlockPos const& pos, ::BlockActorType blockActorType, ::BlockActorRendererId rendererId);
238
239 MCAPI bool _tryLoadR13Data(::CompoundTag const& tag, ::SignBlockActor::Text& frontText);
240
241 MCAPI bool _tryLoadR19U7Data(::CompoundTag const& tag, ::SignBlockActor::Text& frontText);
242
243 MCAPI void _updateTextFromClient(::CompoundTag const& data, ::BlockSource const& region);
244
245#ifdef LL_PLAT_C
246 MCAPI ::SignBlockActor::CachedMessageData const& getCachedMessage(::SignTextSide side) const;
247
248 MCAPI bool getHideGlowOutline(::SignTextSide side) const;
249#endif
250
251 MCAPI bool getIsGlowing(::SignTextSide side) const;
252
253 MCAPI bool getIsLockedForEditing(::ILevel& level);
254
255 MCFOLD bool getIsWaxed() const;
256
257 MCAPI ::std::string const& getMessage(::SignTextSide side) const;
258
259 MCAPI ::std::string const& getRawMessage(::SignTextSide side) const;
260
261 MCAPI ::SignTextSide getSideFacingPlayer(::Player const& player) const;
262
263 MCAPI ::mce::Color const& getSignTextColor(::SignTextSide side) const;
264
265 MCAPI ::TextObjectRoot const& getTextObject(::SignTextSide side) const;
266
267 MCAPI bool isStringMessage(::SignTextSide side) const;
268
269 MCAPI void
270 requestToSendOpenSignPacket(::WeakRef<::EntityContext> entityRef, ::BlockPos const& position, bool isFrontSide);
271
272 MCAPI void serverOnlySetIsLockedForEditing(::Player& player);
273
274#ifdef LL_PLAT_C
275 MCAPI void setCachedMessage(::SignTextSide side, ::SignBlockActor::CachedMessageData cachedMessage);
276#endif
277
278 MCAPI void setHideGlowOutline(::SignTextSide side, bool hideGlowOutline);
279
280 MCAPI void setIsGlowing(::SignTextSide side, bool isGlowing);
281
282#ifdef LL_PLAT_C
283 MCAPI void setMessage(::SignTextSide side, ::std::string message);
284
285 MCAPI void setMessage(::SignTextSide side, ::TextObjectRoot message);
286#endif
287
288 MCAPI void setMessageForServerScripingOnly(::SignTextSide side, ::std::string message, ::std::string ownerID);
289
290 MCAPI void setMessageForServerScripingOnly(::SignTextSide side, ::TextObjectRoot message, ::std::string ownerID);
291
292 MCAPI void setSignTextColor(::SignTextSide side, ::mce::Color const& color);
293
294 MCAPI void setWaxed(bool waxed);
295
296#ifdef LL_PLAT_C
297 MCAPI bool shouldPersistFormatting(::SignTextSide side) const;
298#endif
299 // NOLINTEND
300
301public:
302 // constructor thunks
303 // NOLINTBEGIN
304 MCAPI void* $ctor(::BlockPos const& pos, ::BlockActorType blockActorType, ::BlockActorRendererId rendererId);
305 // NOLINTEND
306
307public:
308 // destructor thunk
309 // NOLINTBEGIN
310 MCAPI void $dtor();
311 // NOLINTEND
312
313public:
314 // virtual function thunks
315 // NOLINTBEGIN
316 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
317
318 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
319
320 MCFOLD void $onChanged(::BlockSource& region);
321
322 MCAPI float $getShadowRadius(::BlockSource& region) const;
323
324 MCAPI ::std::string $getImmersiveReaderText(::BlockSource& region);
325
326 MCAPI void $tick(::BlockSource& region);
327
328 MCAPI ::std::vector<::std::string> $getUgcStrings(::CompoundTag const& tag) const;
329
330 MCAPI ::std::vector<::std::string> $getFilteredUgcStrings(::CompoundTag const& tag) const;
331
332 MCAPI void $setUgcStrings(::CompoundTag& tag, ::std::vector<::std::string> const& list) const;
333
334 MCAPI void $setFilteredUgcStrings(::CompoundTag& tag, ::std::vector<::std::string> const& list) const;
335
336 MCAPI bool $validateData(::CompoundTag const& tag) const;
337
338 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
339
340 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
341
342 MCAPI bool $_playerCanUpdate(::Player const& fromPlayer) const;
343
344
345 // NOLINTEND
346
347public:
348 // vftables
349 // NOLINTBEGIN
350 MCAPI static void** $vftable();
351 // NOLINTEND
352};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition EntityContext.h:17
Definition ILevel.h:219
Definition OpenSignPacket.h:19
Definition Player.h:137
Definition SaveContext.h:5
Definition SignBlockActor.h:126
Definition TextObjectRoot.h:17
Definition WeakRef.h:8
Definition move_only_function.h:9
Definition Color.h:13
Definition SignBlockActor.h:43
Definition SignBlockActor.h:68
Definition SignBlockActor.h:116