LeviLamina
Loading...
Searching...
No Matches
BlockLegacy.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/world/level/block/AttachmentType.h"
5#include "mc/world/level/block/BigDripleafTilt.h"
6#include "mc/world/level/block/states/BlockState.h"
7#include "mc/world/level/block/states/BlockStateInstance.h"
8
9// auto generated inclusion list
10#include "mc/common/WeakPtr.h"
11#include "mc/deps/core/container/Cache.h"
12#include "mc/deps/core/container/EnumSet.h"
13#include "mc/deps/core/utility/optional_ref.h"
14#include "mc/world/Direction.h"
15#include "mc/world/Flip.h"
16#include "mc/world/item/CreativeItemCategory.h"
17#include "mc/world/item/FertilizerType.h"
18#include "mc/world/level/ShapeType.h"
19#include "mc/world/level/block/BlockClientPredictionOverrides.h"
20#include "mc/world/level/block/BlockProperty.h"
21#include "mc/world/level/block/BlockRenderLayer.h"
22#include "mc/world/level/block/BlockSupportType.h"
23#include "mc/world/level/block/BurnOdds.h"
24#include "mc/world/level/block/FlameOdds.h"
25#include "mc/world/level/block/LavaFlammable.h"
26#include "mc/world/level/block/NoteBlockInstrument.h"
27#include "mc/world/level/block/TintMethod.h"
28#include "mc/world/level/block/actor/BlockActorType.h"
29
30// auto generated forward declare list
31// clang-format off
32class AABB;
33class Actor;
34class BaseGameVersion;
35class Block;
36class BlockActor;
38class BlockItem;
39class BlockPos;
40class BlockSource;
41class BlockState;
42class BlockStateGroup;
44class Container;
45class CopperBehavior;
46class DefinitionEvent;
48class EntityContext;
49class Experiments;
51class HashedString;
52class HitResult;
55class ItemActor;
56class ItemInstance;
57class ItemStack;
58class Material;
59class MobSpawnerData;
61class Player;
62class Random;
63class Randomize;
64class RenderParams;
66class SemVersion;
67class SpawnConditions;
68class Vec3;
73struct Brightness;
74struct CommandName;
75struct IntRange;
76struct NewBlockID;
77struct ResourceDrops;
80namespace BlockEvents { class BlockEntityFallOnEvent; }
81namespace BlockEvents { class BlockEventManager; }
82namespace BlockTrait { class IGetPlacementBlockCallback; }
83namespace BlockTrait { class ITrait; }
84namespace br::spawn { struct EntityType; }
85namespace mce { class Color; }
86// clang-format on
87
89public:
90 template <typename T>
91 std::optional<T> getState(uint64 id, ushort data) const {
92 auto it = mStates->find(id);
93
94 if (it == mStates->end()) {
95 {
96 for (const auto& collection : *mAlteredStateCollections) {
97 if (collection && collection->mBlockState->get().mID == id) {
98 auto result = collection->getState(*this, data);
99 if (result) {
100 return result;
101 }
102 }
103 }
104
105 return std::nullopt;
106 }
107 }
108
109 return it->second.get<T>(data);
110 }
111
112 template <typename T>
113 std::optional<T> getState(BlockState const& stateType, ushort data) const {
114 return getState<T>(stateType.mID, data);
115 }
116
117 template <typename T>
118 requires(std::is_integral_v<T> || std::is_enum_v<T>)
119 optional_ref<Block const> trySetState(uint64 id, T val, ushort data) {
120 auto it = mStates->find(id);
121
122 if (it != mStates->end()) {
123 auto& stateInstance = it->second;
124
125 if (static_cast<uchar>(val) < stateInstance.mVariationCount) {
126 ushort maskedData = (data & ~stateInstance.mMask)
127 | (static_cast<ushort>(val) << (stateInstance.mEndBit - stateInstance.mNumBits + 1));
128
129 if (maskedData < mBlockPermutations->size()) {
130 return *mBlockPermutations->at(maskedData);
131 }
132 return nullptr;
133 }
134 }
135
136 for (auto& collection : *mAlteredStateCollections) {
137 if (collection && collection->mBlockState->get().mID == id) {
138 auto result = collection->setState(*this, data, val);
139 if (result) {
140 return result;
141 }
142 }
143 }
144
145 return mReturnDefaultBlockOnUnidentifiedBlockState ? mDefaultState : nullptr;
146 }
147
148 template <typename T>
149 optional_ref<Block const> trySetState(BlockState const& stateType, T val, ushort data) {
150 return trySetState(stateType.mID, val, data);
151 }
152
153public:
154 // BlockLegacy inner types declare
155 // clang-format off
158 struct NameInfo;
161 // clang-format on
162
163 // BlockLegacy inner types define
164 struct NameInfo {
165 public:
166 // member variables
167 // NOLINTBEGIN
168 ::ll::TypedStorage<8, 48, ::HashedString> mRawName;
169 ::ll::TypedStorage<8, 32, ::std::string> mNamespaceName;
170 ::ll::TypedStorage<8, 48, ::HashedString> mFullName;
171 ::ll::TypedStorage<8, 48, ::HashedString> mPreFlatteningName;
172 // NOLINTEND
173
174 public:
175 // prevent constructor by default
176 NameInfo& operator=(NameInfo const&);
177 NameInfo(NameInfo const&);
178
179 public:
180 // member functions
181 // NOLINTBEGIN
182 MCAPI ::BlockLegacy::NameInfo& operator=(::BlockLegacy::NameInfo&&);
183
184 MCAPI ~NameInfo();
185 // NOLINTEND
186
187 public:
188 // destructor thunk
189 // NOLINTBEGIN
190 MCAPI void $dtor();
191 // NOLINTEND
192 };
193
195 public:
196 // member variables
197 // NOLINTBEGIN
198 ::ll::TypedStorage<1, 1, bool> mNorth;
199 ::ll::TypedStorage<1, 1, bool> mEast;
200 ::ll::TypedStorage<1, 1, bool> mSouth;
201 ::ll::TypedStorage<1, 1, bool> mWest;
202 // NOLINTEND
203 };
204
206 public:
207 // member variables
208 // NOLINTBEGIN
209 ::ll::TypedStorage<8, 8, ::std::reference_wrapper<::BlockState const>> mBlockState;
210 // NOLINTEND
211
212 public:
213 // virtual functions
214 // NOLINTBEGIN
215 // vIndex: 0
216 virtual ::std::optional<int> getState(::BlockLegacy const&, int) const = 0;
217
218 // vIndex: 1
219 virtual ::Block const* setState(::BlockLegacy const&, int, int) const = 0;
220
221 // vIndex: 2
222 virtual ~AlteredStateCollection() = default;
223 // NOLINTEND
224
225 public:
226 // static functions
227 // NOLINTBEGIN
228 MCAPI static bool _checkVersioningRequirements(::SemVersion const& removedSupportVersion);
229 // NOLINTEND
230
231 public:
232 // destructor thunk
233 // NOLINTBEGIN
234
235 // NOLINTEND
236
237 public:
238 // virtual function thunks
239 // NOLINTBEGIN
240
241 // NOLINTEND
242 };
243
245 public:
246 // RemovedStateCollection inner types declare
247 // clang-format off
248 struct SplitBlock;
249 // clang-format on
250
251 // RemovedStateCollection inner types define
252 struct SplitBlock {
253 public:
254 // member variables
255 // NOLINTBEGIN
256 ::ll::TypedStorage<4, 4, int> mData;
257 ::ll::TypedStorage<8, 8, ::std::reference_wrapper<::BlockLegacy>> mBlockLegacy;
258 // NOLINTEND
259 };
260
261 public:
262 // member variables
263 // NOLINTBEGIN
264 ::ll::TypedStorage<8, 24, ::std::vector<::BlockLegacy::RemovedStateCollection::SplitBlock>> mSplitBlocks;
265 // NOLINTEND
266
267 public:
268 // virtual functions
269 // NOLINTBEGIN
270 // vIndex: 0
271 virtual ::std::optional<int> getState(::BlockLegacy const& blockLegacy, int) const /*override*/;
272
273 // vIndex: 1
274 virtual ::Block const* setState(::BlockLegacy const& blockLegacy, int blockData, int stateData) const
275 /*override*/;
276
277 // vIndex: 2
278 virtual ~RemovedStateCollection() /*override*/ = default;
279 // NOLINTEND
280
281 public:
282 // static functions
283 // NOLINTBEGIN
284 MCAPI static void
285 add(::BlockState const& stateRef,
286 ::std::vector<::BlockLegacy::RemovedStateCollection::SplitBlock>&& splitBlocks,
287 ::SemVersion const& removedSupportVersion);
288 // NOLINTEND
289
290 public:
291 // destructor thunk
292 // NOLINTBEGIN
293
294 // NOLINTEND
295
296 public:
297 // virtual function thunks
298 // NOLINTBEGIN
299 MCAPI ::std::optional<int> $getState(::BlockLegacy const& blockLegacy, int) const;
300
301 MCAPI ::Block const* $setState(::BlockLegacy const& blockLegacy, int blockData, int stateData) const;
302 // NOLINTEND
303
304 public:
305 // vftables
306 // NOLINTBEGIN
307 MCAPI static void** $vftable();
308 // NOLINTEND
309 };
310
312 public:
313 // RearrangedStateCollection inner types define
314 using GetterType = ::std::function<::std::optional<int>(::BlockLegacy const&, int)>;
315
316 using SetterType = ::std::function<::Block const*(::BlockLegacy const&, int, int)>;
317
318 public:
319 // member variables
320 // NOLINTBEGIN
321 ::ll::TypedStorage<8, 64, ::std::function<::std::optional<int>(::BlockLegacy const&, int)>> mGetter;
322 ::ll::TypedStorage<8, 64, ::std::function<::Block const*(::BlockLegacy const&, int, int)>> mSetter;
323 // NOLINTEND
324
325 public:
326 // virtual functions
327 // NOLINTBEGIN
328 // vIndex: 0
329 virtual ::std::optional<int> getState(::BlockLegacy const& blockLegacy, int blockData) const /*override*/;
330
331 // vIndex: 1
332 virtual ::Block const* setState(::BlockLegacy const& blockLegacy, int blockData, int stateData) const
333 /*override*/;
334
335 // vIndex: 2
336 virtual ~RearrangedStateCollection() /*override*/ = default;
337 // NOLINTEND
338
339 public:
340 // member functions
341 // NOLINTBEGIN
343 ::BlockState const& stateRef,
344 ::std::function<::std::optional<int>(::BlockLegacy const&, int)> getter,
345 ::std::function<::Block const*(::BlockLegacy const&, int, int)> setter
346 );
347 // NOLINTEND
348
349 public:
350 // static functions
351 // NOLINTBEGIN
352 MCAPI static void
353 add(::BlockLegacy& blockLegacy,
354 ::BlockState const& stateRef,
355 ::std::function<::std::optional<int>(::BlockLegacy const&, int)> getter,
356 ::std::function<::Block const*(::BlockLegacy const&, int, int)> setter,
357 ::SemVersion const& removedSupportVersion);
358 // NOLINTEND
359
360 public:
361 // constructor thunks
362 // NOLINTBEGIN
363 MCAPI void* $ctor(
364 ::BlockState const& stateRef,
365 ::std::function<::std::optional<int>(::BlockLegacy const&, int)> getter,
366 ::std::function<::Block const*(::BlockLegacy const&, int, int)> setter
367 );
368 // NOLINTEND
369
370 public:
371 // destructor thunk
372 // NOLINTBEGIN
373
374 // NOLINTEND
375
376 public:
377 // virtual function thunks
378 // NOLINTBEGIN
379 MCAPI ::std::optional<int> $getState(::BlockLegacy const& blockLegacy, int blockData) const;
380
381 MCAPI ::Block const* $setState(::BlockLegacy const& blockLegacy, int blockData, int stateData) const;
382 // NOLINTEND
383
384 public:
385 // vftables
386 // NOLINTBEGIN
387 MCAPI static void** $vftable();
388 // NOLINTEND
389 };
390
391public:
392 LLNDAPI std::string const& getTypeName() const;
393
394 LLNDAPI static optional_ref<BlockLegacy> tryGetFromRegistry(std::string_view name);
395 LLNDAPI static optional_ref<BlockLegacy const> tryGetFromRegistry(uint legacyBlockID);
396
397public:
398 // member variables
399 // NOLINTBEGIN
400 ::ll::TypedStorage<8, 32, ::std::string> mDescriptionId;
401 ::ll::TypedStorage<8, 104, ::BlockComponentStorage> mComponents;
402 ::ll::TypedStorage<8, 176, ::BlockLegacy::NameInfo> mNameInfo;
403 ::ll::TypedStorage<8, 8, ::BlockProperty> mProperties;
404 ::ll::TypedStorage<1, 1, bool> mFancy;
405 ::ll::TypedStorage<1, 1, ::BlockRenderLayer> mRenderLayer;
406 ::ll::TypedStorage<1, 1, bool> mRenderLayerCanRenderAsOpaque;
407 ::ll::TypedStorage<4, 4, ::BlockActorType> mBlockEntityType;
408 ::ll::TypedStorage<1, 1, bool> mAnimatedTexture;
409 ::ll::TypedStorage<4, 4, float> mThickness;
410 ::ll::TypedStorage<1, 1, bool> mCanSlide;
411 ::ll::TypedStorage<1, 1, bool> mCanReactToNeighborsDuringInstatick;
412 ::ll::TypedStorage<1, 1, bool> mIsInteraction;
413 ::ll::TypedStorage<4, 4, float> mGravity;
414 ::ll::TypedStorage<8, 8, ::Material const&> mMaterial;
415 ::ll::TypedStorage<1, 1, bool> mFalling;
416 ::ll::TypedStorage<4, 4, float> mParticleQuantityScalar;
417 ::ll::TypedStorage<4, 4, ::CreativeItemCategory> mCreativeCategory;
418 ::ll::TypedStorage<8, 32, ::std::string> mCreativeGroup;
419 ::ll::TypedStorage<1, 1, bool> mIsHiddenInCommands;
420 ::ll::TypedStorage<1, 1, bool> mAllowsRunes;
421 ::ll::TypedStorage<1, 1, bool> mCanBeBrokenFromFalling;
422 ::ll::TypedStorage<1, 1, bool> mCanBeOriginalSurface;
423 ::ll::TypedStorage<1, 1, bool> mSolid;
424 ::ll::TypedStorage<1, 1, bool> mPushesOutItems;
425 ::ll::TypedStorage<1, 1, bool> mIgnoreBlockForInsideCubeRenderer;
426 ::ll::TypedStorage<1, 1, bool> mIsTrapdoor;
427 ::ll::TypedStorage<1, 1, bool> mIsDoor;
428 ::ll::TypedStorage<1, 1, bool> mIsOpaqueFullBlock;
429 ::ll::TypedStorage<4, 4, float> mTranslucency;
430 ::ll::TypedStorage<1, 1, bool> mShouldRandomTick;
431 ::ll::TypedStorage<1, 1, bool> mShouldRandomTickExtraLayer;
432 ::ll::TypedStorage<1, 1, bool> mIsMobPiece;
433 ::ll::TypedStorage<1, 1, bool> mCanBeExtraBlock;
434 ::ll::TypedStorage<1, 1, bool> mCanPropagateBrightness;
435 ::ll::TypedStorage<1, 1, ::Brightness> mLightBlock;
436 ::ll::TypedStorage<1, 1, ::Brightness> mLightEmission;
437 ::ll::TypedStorage<4, 4, ::FlameOdds> mFlameOdds;
438 ::ll::TypedStorage<4, 4, ::BurnOdds> mBurnOdds;
439 ::ll::TypedStorage<1, 1, ::LavaFlammable> mLavaFlammable;
440 ::ll::TypedStorage<4, 16, ::mce::Color> mMapColor;
441 ::ll::TypedStorage<4, 4, float> mFriction;
442 ::ll::TypedStorage<4, 4, ::NoteBlockInstrument> mNoteBlockInstrument;
443 ::ll::TypedStorage<1, 1, ::TintMethod> mTintMethod;
444 ::ll::TypedStorage<1, 1, bool> mReturnDefaultBlockOnUnidentifiedBlockState;
445 ::ll::TypedStorage<2, 2, ::NewBlockID> mID;
446 ::ll::TypedStorage<8, 32, ::BaseGameVersion> mMinRequiredBaseGameVersion;
447 ::ll::TypedStorage<1, 1, bool> mIsVanilla;
448 ::ll::TypedStorage<8, 24, ::std::vector<::HashedString>> mTags;
449 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DefinitionEvent>> mEventHandlers;
450 ::ll::TypedStorage<1, 1, bool> mDataDrivenVanillaBlocksAndItemsEnabled;
451 ::ll::TypedStorage<4, 24, ::AABB> mVisualShape;
452 ::ll::TypedStorage<4, 4, uint> mBitsUsed;
453 ::ll::TypedStorage<4, 4, uint> mTotalBitsUsed;
454 ::ll::TypedStorage<8, 16, ::std::map<uint64, ::BlockStateInstance>> mStates;
455 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, uint64>> mStateNameMap;
456 ::ll::TypedStorage<8, 8, uint64> mCreativeEnumState;
457 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::Block>>> mBlockPermutations;
458 ::ll::TypedStorage<8, 8, ::Block const*> mDefaultState;
459 ::ll::TypedStorage<8, 24, ::std::vector<::std::unique_ptr<::BlockTrait::IGetPlacementBlockCallback>>>
460 mGetPlacementBlockCallbacks;
461 ::ll::TypedStorage<8, 72, ::Core::Cache<ushort, ::Block const*, ::Block const*>> mLegacyDataLookupTable;
462 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockStateGroup>> mBlockStateGroup;
463 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IResourceDropsStrategy>> mResourceDropsStrategy;
464 ::ll::TypedStorage<4, 8, ::IntRange> mExperienceDropRange;
465 ::ll::TypedStorage<1, 1, bool> mRequiresCorrectToolForDrops;
466 ::ll::TypedStorage<8, 104, ::NetEaseBlockComponentStorage> mNetEaseComponentStorage;
467 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::BlockLegacy::AlteredStateCollection>>>
468 mAlteredStateCollections;
469 ::ll::TypedStorage<1, 1, ::Bedrock::EnumSet<::BlockClientPredictionOverrides, 7>> mClientPredictionOverrides;
470 ::ll::TypedStorage<8, 32, ::BlockEvents::BlockEventManager> mEventManager;
471 // NOLINTEND
472
473public:
474 // virtual functions
475 // NOLINTBEGIN
476 // vIndex: 0
477 virtual ~BlockLegacy();
478
479 // vIndex: 1
480 virtual ::std::shared_ptr<::BlockActor> newBlockEntity(::BlockPos const& pos, ::Block const& block) const;
481
482 // vIndex: 2
483 virtual ::Block const* getNextBlockPermutation(::Block const& currentBlock) const;
484
485 // vIndex: 3
486 virtual bool
487 hasTag(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::std::string const& tagName) const;
488
489 // vIndex: 4
490 virtual ::HitResult
491 clip(::Block const&, ::BlockSource const&, ::BlockPos const&, ::Vec3 const&, ::Vec3 const&, ::ShapeType, ::optional_ref<::GetCollisionShapeInterface const>)
492 const;
493
494 // vIndex: 5
495 virtual ::AABB
496 getCollisionShape(::Block const& block, ::IConstBlockSource const&, ::BlockPos const& pos, ::optional_ref<::GetCollisionShapeInterface const>)
497 const;
498
499 // vIndex: 6
500 virtual bool getCollisionShapeForCamera(
501 ::AABB& outAABB,
502 ::Block const& block,
503 ::IConstBlockSource const& region,
504 ::BlockPos const& pos
505 ) const;
506
507 // vIndex: 7
508 virtual bool addCollisionShapes(
509 ::Block const& block,
510 ::IConstBlockSource const& region,
511 ::BlockPos const& pos,
512 ::AABB const* intersectTestBox,
513 ::std::vector<::AABB>& inoutBoxes,
515 ) const;
516
517 // vIndex: 8
518 virtual void addAABBs(
519 ::Block const& block,
520 ::IConstBlockSource const& region,
521 ::BlockPos const& pos,
522 ::AABB const* intersectTestBox,
523 ::std::vector<::AABB>& inoutBoxes
524 ) const;
525
526 // vIndex: 9
527 virtual ::AABB const&
528 getOutline(::Block const& block, ::IConstBlockSource const&, ::BlockPos const& pos, ::AABB& bufferValue) const;
529
530 // vIndex: 10
531 virtual ::AABB const&
532 getVisualShapeInWorld(::Block const& block, ::IConstBlockSource const&, ::BlockPos const&, ::AABB& bufferAABB)
533 const;
534
535 // vIndex: 11
536 virtual ::AABB const& getVisualShape(::Block const&, ::AABB&) const;
537
538 // vIndex: 12
539 virtual ::AABB const& getUIShape(::Block const& block, ::AABB& bufferAABB) const;
540
541 // vIndex: 13
542 virtual bool
543 getLiquidClipVolume(::Block const& block, ::BlockSource& region, ::BlockPos const& pos, ::AABB& includeBox) const;
544
545 // vIndex: 14
546 virtual bool isObstructingChests(::BlockSource& region, ::BlockPos const& pos, ::Block const& thisBlock) const;
547
548 // vIndex: 16
549 virtual ::Vec3 randomlyModifyPosition(::BlockPos const& pos, int& seed) const;
550
551 // vIndex: 15
552 virtual ::Vec3 randomlyModifyPosition(::BlockPos const& pos) const;
553
554 // vIndex: 17
555 virtual void onProjectileHit(::BlockSource&, ::BlockPos const&, ::Actor const&) const;
556
557 // vIndex: 18
558 virtual void onLightningHit(::BlockSource& region, ::BlockPos const& pos) const;
559
560 // vIndex: 19
561 virtual bool liquidCanFlowIntoFromDirection(
562 uchar flowIntoFacing,
563 ::std::function<::Block const&(::BlockPos const&)> const& getBlock,
564 ::BlockPos const& pos
565 ) const;
566
567 // vIndex: 20
568 virtual bool hasVariableLighting() const;
569
570 // vIndex: 21
571 virtual bool isStrippable(::Block const& srcBlock) const;
572
573 // vIndex: 22
574 virtual ::Block const& getStrippedBlock(::Block const& srcBlock) const;
575
576 // vIndex: 23
577 virtual bool canProvideSupport(::Block const&, uchar, ::BlockSupportType) const;
578
579 // vIndex: 24
580 virtual bool canProvideMultifaceSupport(::Block const& block, uchar face) const;
581
582 // vIndex: 25
583 virtual bool canConnect(::Block const&, uchar toOther, ::Block const& thisBlock) const;
584
585 // vIndex: 26
586 virtual bool isMovingBlock() const;
587
588 // vIndex: 27
589 virtual ::CopperBehavior const* tryGetCopperBehavior() const;
590
591 // vIndex: 28
592 virtual bool isStemBlock() const;
593
594 // vIndex: 29
595 virtual bool isContainerBlock() const;
596
597 // vIndex: 30
598 virtual bool isCraftingBlock() const;
599
600 // vIndex: 31
601 virtual bool isLavaBlocking() const;
602
603 // vIndex: 32
604 virtual bool isFenceBlock() const;
605
606 // vIndex: 33
607 virtual bool isFenceGateBlock() const;
608
609 // vIndex: 34
610 virtual bool isThinFenceBlock() const;
611
612 // vIndex: 35
613 virtual bool isWallBlock() const;
614
615 // vIndex: 36
616 virtual bool isStairBlock() const;
617
618 // vIndex: 37
619 virtual bool isSlabBlock() const;
620
621 // vIndex: 38
622 virtual bool isDoorBlock() const;
623
624 // vIndex: 39
625 virtual bool isRailBlock() const;
626
627 // vIndex: 40
628 virtual bool isButtonBlock() const;
629
630 // vIndex: 41
631 virtual bool isLeverBlock() const;
632
633 // vIndex: 42
634 virtual bool isCandleCakeBlock() const;
635
636 // vIndex: 43
637 virtual bool isMultifaceBlock() const;
638
639 // vIndex: 44
640 virtual bool isSignalSource() const;
641
642 // vIndex: 45
643 virtual bool isConsumerComponent() const;
644
645 // vIndex: 46
646 virtual bool canBeOriginalSurface() const;
647
648 // vIndex: 47
649 virtual bool isSilentWhenJumpingOff() const;
650
651 // vIndex: 48
652 virtual bool isValidAuxValue(int value) const;
653
654 // vIndex: 49
655 virtual bool canFillAtPos(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
656
657 // vIndex: 50
658 virtual ::Block const& sanitizeFillBlock(::Block const& block) const;
659
660 // vIndex: 51
661 virtual void onFillBlock(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
662
663 // vIndex: 52
664 virtual int getDirectSignal(::BlockSource& region, ::BlockPos const& pos, int dir) const;
665
666 // vIndex: 53
667 virtual ::std::optional<::HashedString> getRequiredMedium() const;
668
669 // vIndex: 54
670 virtual bool
671 shouldConnectToRedstone(::BlockSource& region, ::BlockPos const& pos, ::Direction::Type direction) const;
672
673 // vIndex: 55
674 virtual void
675 handlePrecipitation(::BlockSource& region, ::BlockPos const& pos, float downfallAmount, float temperature) const;
676
677 // vIndex: 56
678 virtual bool canBeUsedInCommands(::BaseGameVersion const& baseGameVersion) const;
679
680 // vIndex: 57
681 virtual bool checkIsPathable(::Actor& entity, ::BlockPos const& lastPathPos, ::BlockPos const& pathPos) const;
682
683 // vIndex: 58
684 virtual bool shouldDispense(::BlockSource& region, ::Container& container) const;
685
686 // vIndex: 59
687 virtual bool dispense(::BlockSource& region, ::Container& container, int slot, ::Vec3 const& pos, uchar face) const;
688
689 // vIndex: 60
690 virtual void
691 transformOnFall(::BlockSource& region, ::BlockPos const& pos, ::Actor* entity, float fallDistance) const;
692
693 // vIndex: 61
694 virtual void onRedstoneUpdate(::BlockSource& region, ::BlockPos const& pos, int strength, bool isFirstTime) const;
695
696 // vIndex: 62
697 virtual void onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const;
698
699 // vIndex: 63
700 virtual bool detachesOnPistonMove(::BlockSource& region, ::BlockPos const& pos) const;
701
702 // vIndex: 64
703 virtual void movedByPiston(::BlockSource& region, ::BlockPos const& pos) const;
704
705 // vIndex: 65
706 virtual void onStructureBlockPlace(::BlockSource& region, ::BlockPos const& pos) const;
707
708 // vIndex: 66
709 virtual void onStructureNeighborBlockPlace(::BlockSource& region, ::BlockPos const& pos) const;
710
711 // vIndex: 67
712 virtual void setupRedstoneComponent(::BlockSource& region, ::BlockPos const& pos) const;
713
714 // vIndex: 68
715 virtual void updateEntityAfterFallOn(::BlockPos const& pos, ::UpdateEntityAfterFallOnInterface& entity) const;
716
717 // vIndex: 69
718 virtual bool isBounceBlock() const;
719
720 // vIndex: 70
721 virtual bool isPreservingMediumWhenPlaced(::BlockLegacy const* medium) const;
722
723 // vIndex: 71
724 virtual bool isFilteredOut(::BlockRenderLayer) const;
725
726 // vIndex: 72
727 virtual bool canRenderSelectionOverlay(::BlockRenderLayer) const;
728
729 // vIndex: 73
730 virtual bool ignoreEntitiesOnPistonMove(::Block const& block) const;
731
732 // vIndex: 74
733 virtual bool
734 onFertilized(::BlockSource& region, ::BlockPos const& pos, ::Actor* actor, ::FertilizerType fType) const;
735
736 // vIndex: 75
737 virtual bool mayConsumeFertilizer(::BlockSource& region) const;
738
739 // vIndex: 76
740 virtual bool canBeFertilized(::BlockSource& region, ::BlockPos const& pos, ::Block const& aboveBlock) const;
741
742 // vIndex: 78
743 virtual bool mayPick() const;
744
745 // vIndex: 77
746 virtual bool mayPick(::BlockSource const& region, ::Block const& block, bool liquid) const;
747
748 // vIndex: 80
749 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
750
751 // vIndex: 79
752 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos) const;
753
754 // vIndex: 81
755 virtual bool mayPlaceOn(::BlockSource& region, ::BlockPos const& pos) const;
756
757 // vIndex: 82
758 virtual bool tryToPlace(
759 ::BlockSource& region,
760 ::BlockPos const& pos,
761 ::Block const& block,
762 ::ActorBlockSyncMessage const* syncMsg
763 ) const;
764
765 // vIndex: 83
766 virtual bool tryToTill(::BlockSource& region, ::BlockPos const& pos, ::Actor& entity, ::ItemStack& item) const;
767
768 // vIndex: 84
769 virtual bool breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const;
770
771 // vIndex: 85
772 virtual void
773 destroy(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::Actor* entitySource) const;
774
775 // vIndex: 86
776 virtual bool getIgnoresDestroyPermissions(::Actor& entity, ::BlockPos const& pos) const;
777
778 // vIndex: 87
779 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
780
781 // vIndex: 88
782 virtual bool getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const;
783
784 // vIndex: 89
785 virtual ::Block const* playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const;
786
787 // vIndex: 90
788 virtual ::ItemInstance asItemInstance(::Block const&, ::BlockActor const*) const;
789
790 // vIndex: 91
791 virtual void
792 spawnAfterBreak(::BlockSource&, ::Block const&, ::BlockPos const&, ::ResourceDropsContext const&) const;
793
794 // vIndex: 92
795 virtual ::Block const&
796 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue)
797 const;
798
799 // vIndex: 93
800 virtual int calcVariant(::BlockSource& region, ::BlockPos const& pos, ::mce::Color const& baseColor) const;
801
802 // vIndex: 94
803 virtual bool isAttachedTo(::BlockSource& region, ::BlockPos const& pos, ::BlockPos& outAttachedTo) const;
804
805 // vIndex: 95
806 virtual bool attack(::Player* player, ::BlockPos const& pos) const;
807
808 // vIndex: 96
809 virtual bool shouldTriggerEntityInside(::BlockSource& region, ::BlockPos const& pos, ::Actor& entity) const;
810
811 // vIndex: 98
812 virtual bool canBeBuiltOver(::BlockSource& region, ::BlockPos const& pos, ::BlockItem const& newItem) const;
813
814 // vIndex: 97
815 virtual bool canBeBuiltOver(::BlockSource& region, ::BlockPos const& pos) const;
816
817 // vIndex: 99
818 virtual void triggerEvent(::BlockSource& region, ::BlockPos const& pos, int b0, int b1) const;
819
820 // vIndex: 100
821 virtual void executeEvent(
822 ::BlockSource& region,
823 ::BlockPos const& pos,
824 ::Block const& block,
825 ::std::string const& eventName,
826 ::Actor& sourceEntity
827 ) const;
828
829 // vIndex: 101
830 virtual ::MobSpawnerData const* getMobToSpawn(::SpawnConditions const& conditions, ::BlockSource& region) const;
831
832 // vIndex: 102
833 virtual bool shouldStopFalling(::Actor& entity) const;
834
835 // vIndex: 103
836 virtual bool pushesUpFallingBlocks() const;
837
838 // vIndex: 104
839 virtual bool canHaveExtraData() const;
840
841 // vIndex: 105
842 virtual bool hasComparatorSignal() const;
843
844 // vIndex: 106
845 virtual int
846 getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
847
848 // vIndex: 107
849 virtual bool canSlide(::BlockSource& region, ::BlockPos const& pos) const;
850
851 // vIndex: 108
852 virtual bool canInstatick() const;
853
854 // vIndex: 109
855 virtual bool canSpawnAt(::BlockSource const& region, ::BlockPos const& pos) const;
856
857 // vIndex: 110
858 virtual void notifySpawnedAt(::BlockSource& region, ::BlockPos const& pos) const;
859
860 // vIndex: 111
861 virtual bool causesFreezeEffect() const;
862
863 // vIndex: 112
864 virtual ::std::string buildDescriptionId(::Block const&) const;
865
866 // vIndex: 113
867 virtual bool isAuxValueRelevantForPicking() const;
868
869 // vIndex: 114
870 virtual bool isSeasonTinted(::Block const& block, ::BlockSource& region, ::BlockPos const& p) const;
871
872 // vIndex: 115
873 virtual void onGraphicsModeChanged(::BlockGraphicsModeChangeContext const& context);
874
875 // vIndex: 116
876 virtual float getShadeBrightness(::Block const& block) const;
877
878 // vIndex: 117
879 virtual int telemetryVariant(::BlockSource& region, ::BlockPos const& pos) const;
880
881 // vIndex: 118
882 virtual int getVariant(::Block const& block) const;
883
884 // vIndex: 119
885 virtual bool canSpawnOn(::Actor*) const;
886
887 // vIndex: 120
888 virtual ::Block const& getRenderBlock() const;
889
890 // vIndex: 121
891 virtual uchar getMappedFace(uchar face, ::Block const& block) const;
892
893 // vIndex: 122
894 virtual ::Flip getFaceFlip(uchar face, ::Block const& block) const;
895
896 // vIndex: 123
897 virtual void animateTickBedrockLegacy(::BlockAnimateTickData const&) const;
898
899 // vIndex: 124
900 virtual void animateTick(::BlockAnimateTickData const&) const;
901
902 // vIndex: 125
903 virtual ::BlockLegacy& init();
904
905 // vIndex: 126
906 virtual ::Brightness getLightEmission(::Block const&) const;
907
908 // vIndex: 127
909 virtual ::Block const* tryLegacyUpgrade(ushort) const;
910
911 // vIndex: 128
912 virtual bool dealsContactDamage(::Actor const& actor, ::Block const& block, bool isPathFinding) const;
913
914 // vIndex: 129
915 virtual ::Block const* tryGetInfested(::Block const&) const;
916
917 // vIndex: 130
918 virtual ::Block const* tryGetUninfested(::Block const&) const;
919
920 // vIndex: 131
921 virtual void _addHardCodedBlockComponents(::Experiments const&);
922
923 // vIndex: 132
924 virtual void onRemove(::BlockSource& region, ::BlockPos const& pos) const;
925
926 // vIndex: 133
927 virtual void onExploded(::BlockSource& region, ::BlockPos const& pos, ::Actor* entitySource) const;
928
929 // vIndex: 134
930 virtual void onStandOn(::EntityContext& entity, ::BlockPos const& pos) const;
931
932 // vIndex: 135
933 virtual bool shouldTickOnSetBlock() const;
934
935 // vIndex: 136
936 virtual void tick(::BlockSource& region, ::BlockPos const& pos, ::Random& random) const;
937
938 // vIndex: 137
939 virtual void randomTick(::BlockSource& region, ::BlockPos const& pos, ::Random& random) const;
940
941 // vIndex: 138
942 virtual bool isInteractiveBlock() const;
943
944 // vIndex: 140
945 virtual bool use(::Player& player, ::BlockPos const& pos, uchar face, ::std::optional<::Vec3>) const;
946
947 // vIndex: 139
948 virtual bool use(::Player&, ::BlockPos const&, uchar) const;
949
950 // vIndex: 141
951 virtual bool allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const;
952
953 // vIndex: 142
954 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
955
956 // vIndex: 143
957 virtual ::BlockRenderLayer getRenderLayer(::Block const& block, ::BlockSource&, ::BlockPos const& pos) const;
958
959 // vIndex: 144
960 virtual int getExtraRenderLayers() const;
961
962 // vIndex: 145
963 virtual ::Brightness getLight(::Block const&) const;
964
965 // vIndex: 146
966 virtual ::Brightness getEmissiveBrightness(::Block const&) const;
967
968 // vIndex: 147
969 virtual ::mce::Color getMapColor(::BlockSource&, ::BlockPos const&, ::Block const&) const;
970
971 // vIndex: 148
972 virtual void _onHitByActivatingAttack(::BlockSource&, ::BlockPos const&, ::Actor*) const;
973
974 // vIndex: 149
975 virtual void entityInside(::BlockSource&, ::BlockPos const&, ::Actor&) const;
976 // NOLINTEND
977
978public:
979 // member functions
980 // NOLINTBEGIN
981 MCAPI BlockLegacy(::std::string const& nameId, int id, ::Material const& material);
982
983 MCAPI void _executeEvent(
984 ::std::string const& name,
985 ::std::vector<::std::pair<::std::string const, ::std::string const>>& eventStack,
986 ::RenderParams& params
987 ) const;
988
989 MCAPI void _forceExecuteTrigger(
990 ::DefinitionTrigger const& trigger,
991 ::std::vector<::std::pair<::std::string const, ::std::string const>>& eventStack,
992 ::RenderParams& params
993 ) const;
994
995 MCAPI ::BlockLegacy& addBlockProperties(::BlockProperty addedProperties);
996
997 MCAPI ::BlockLegacy& addComponent(::BlockComponentDescription const& blockComponentDescription);
998
999 MCAPI ::BlockLegacy& addState(::BlockState const& state);
1000
1001 MCAPI ::BlockLegacy& addState(::BlockState const& state, uint64 variationCount);
1002
1003 MCAPI ::BlockLegacy& addTag(::HashedString const& tag);
1004
1005 MCAPI ::BlockLegacy& addTrait(::BlockTrait::ITrait const& trait);
1006
1007 MCAPI bool anyOf(::gsl::span<::std::reference_wrapper<::HashedString const> const> const& blockTypeIdList) const;
1008
1009 MCAPI ::std::string buildDescriptionName(::Block const& block) const;
1010
1011 MCAPI void createBlockPermutations(uint latestUpdaterVersion);
1012
1013 MCAPI ::WeakPtr<::BlockLegacy> createWeakPtr() const;
1014
1015 MCAPI void executeEvent(::std::string const& name, ::RenderParams& params) const;
1016
1017 MCAPI bool executeTrigger(::DefinitionTrigger const& trigger, ::RenderParams& params) const;
1018
1019 MCAPI void finalizeBlockComponentStorage();
1020
1021 MCAPI void finalizeScriptCustomComponents(::ScriptBlockCustomComponentsFinalizer& finalizer);
1022
1023 MCAPI void forEachBlockPermutation(::std::function<bool(::Block const&)> callback) const;
1024
1025 MCAPI bool forEachBlockPermutationMutable(::std::function<bool(::Block&)> callback);
1026
1027 MCAPI void forEachBlockStateInstance(::std::function<bool(::BlockStateInstance const&)> callback) const;
1028
1029 MCAPI short getBlockItemId() const;
1030
1031 MCAPI ::BlockState const* getBlockState(::HashedString const& name) const;
1032
1033 MCAPI ::std::vector<::CommandName> getCommandNames() const;
1034
1035 MCAPI void getDebugText(::std::vector<::std::string>& outputInfo, ::BlockPos const& debugPos) const;
1036
1037 MCAPI ::ResourceDrops
1038 getResourceDrops(::Block const& block, ::Randomize& randomize, ::ResourceDropsContext const& resourceDropsContext)
1039 const;
1040
1041 MCAPI bool hasState(::BlockState const& stateType) const;
1042
1043 MCAPI bool hasTag(::HashedString const& tag) const;
1044
1045 MCAPI bool
1046 isValidSpawn(::BlockSource& region, ::Block const& state, ::BlockPos pos, ::br::spawn::EntityType const& entityType)
1047 const;
1048
1049 MCAPI void onFallOnBase(::BlockEvents::BlockEntityFallOnEvent& eventData) const;
1050
1051 MCAPI ::BlockLegacy& overrideBlockProperties(::BlockProperty newProperties);
1052
1053 MCAPI ::BlockLegacy& setAllowsRunes(bool interference);
1054
1055 MCAPI ::BlockLegacy& setCanBeExtraBlock(bool state);
1056
1057 MCAPI ::BlockLegacy& setCanBeOriginalSurface(bool canBeOriginalSurface);
1058
1059 MCAPI ::BlockLegacy& setCategory(::CreativeItemCategory creativeCategory);
1060
1061 MCAPI ::BlockLegacy& setCreativeGroup(::std::string const& value);
1062
1063 MCAPI ::BlockLegacy& setExperienceDrop(::IntRange dropRange);
1064
1065 MCAPI ::BlockLegacy& setFlammable(::FlameOdds flameOdds, ::BurnOdds burnOdds, ::LavaFlammable lavaFlammable);
1066
1067 MCAPI ::BlockLegacy& setFriction(float f);
1068
1069 MCAPI ::BlockLegacy& setInstrument(::NoteBlockInstrument instrument);
1070
1071 MCAPI ::BlockLegacy& setIsHiddenInCommands(bool isHiddenInCommands);
1072
1073 MCAPI ::BlockLegacy&
1074 setIsValidSpawn(bool (*predicate)(::BlockSource const&, ::Block const&, ::BlockPos, ::br::spawn::EntityType const&)
1075 );
1076
1077 MCAPI ::BlockLegacy& setLightBlock(::Brightness brightness);
1078
1079 MCAPI ::BlockLegacy& setLightEmission(::Brightness brightness);
1080
1081 MCAPI ::BlockLegacy& setMapColor(::mce::Color const& color);
1082
1083 MCAPI ::BlockLegacy& setMinRequiredBaseGameVersion(::BaseGameVersion const& baseGameVersion);
1084
1085 MCAPI ::BlockLegacy& setNameId(::std::string const& id);
1086
1087 MCAPI void setRandomTicking(bool tick) const;
1088
1089 MCAPI ::BlockLegacy& setRequiresCorrectToolForDrops();
1090
1091 MCAPI ::BlockLegacy& setTintMethod(::TintMethod tintMethod);
1092
1093 MCAPI ::BlockLegacy& setTranslucency(float translucency);
1094
1095 MCAPI bool shouldTriggerOnStandOn(::Actor& entity, ::BlockPos const& pos) const;
1096
1097 MCAPI void spawnResources(
1098 ::BlockSource& region,
1099 ::BlockPos const& pos,
1100 ::Block const& block,
1101 ::Randomize& randomize,
1102 ::ResourceDropsContext const& resourceDropsContext
1103 ) const;
1104
1105 MCAPI ::Block const* tryGetStateFromLegacyData(ushort data) const;
1106
1107 MCAPI bool updateTallestCollisionShape(
1108 ::Block const& block,
1109 ::BlockSource const& region,
1110 ::BlockPos const& pos,
1111 ::AABB const& intersectTestBox,
1113 ::AABB& result,
1114 ::Vec3 const& posToMinimizeDistanceToIfMatchingHeight,
1115 float& currentDistanceSqr
1116 ) const;
1117 // NOLINTEND
1118
1119public:
1120 // static functions
1121 // NOLINTBEGIN
1122 MCAPI static ::std::string buildDescriptionIdFromNameInfo(::BlockLegacy::NameInfo const& nameInfo);
1123
1124 MCAPI static ::BlockLegacy::NameInfo extractBlockNameInfo(::std::string const& name);
1125
1126 MCAPI static ::BlockLegacy::HorizontalDirectionBits
1127 getConnectedDirections(::Block const& thisBlock, ::BlockPos const& pos, ::IConstBlockSource const& region);
1128
1129 MCAPI static uchar getPlacementFacingAll(::Actor const& entity, ::BlockPos const& pos, float yRotOffsetDegree);
1130
1131 MCAPI static ::ItemActor* popResource(::BlockSource& region, ::BlockPos const& pos, ::ItemStack const& item);
1132
1133 MCAPI static ::ItemActor*
1134 popResource(::BlockSource& region, ::BlockPos const& pos, ::ItemInstance const& itemInstance);
1135 // NOLINTEND
1136
1137public:
1138 // static variables
1139 // NOLINTBEGIN
1140 MCAPI static ::std::string const& BLOCK_DESCRIPTION_PREFIX();
1141
1142 MCAPI static float const& SIZE_OFFSET();
1143 // NOLINTEND
1144
1145public:
1146 // constructor thunks
1147 // NOLINTBEGIN
1148 MCAPI void* $ctor(::std::string const& nameId, int id, ::Material const& material);
1149 // NOLINTEND
1150
1151public:
1152 // destructor thunk
1153 // NOLINTBEGIN
1154 MCAPI void $dtor();
1155 // NOLINTEND
1156
1157public:
1158 // virtual function thunks
1159 // NOLINTBEGIN
1160 MCAPI ::std::shared_ptr<::BlockActor> $newBlockEntity(::BlockPos const& pos, ::Block const& block) const;
1161
1162 MCAPI ::Block const* $getNextBlockPermutation(::Block const& currentBlock) const;
1163
1164 MCFOLD bool
1165 $hasTag(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::std::string const& tagName) const;
1166
1167 MCAPI ::AABB
1168 $getCollisionShape(::Block const& block, ::IConstBlockSource const&, ::BlockPos const& pos, ::optional_ref<::GetCollisionShapeInterface const>)
1169 const;
1170
1171 MCAPI bool $getCollisionShapeForCamera(
1172 ::AABB& outAABB,
1173 ::Block const& block,
1174 ::IConstBlockSource const& region,
1175 ::BlockPos const& pos
1176 ) const;
1177
1178 MCAPI bool $addCollisionShapes(
1179 ::Block const& block,
1180 ::IConstBlockSource const& region,
1181 ::BlockPos const& pos,
1182 ::AABB const* intersectTestBox,
1183 ::std::vector<::AABB>& inoutBoxes,
1185 ) const;
1186
1187 MCAPI void $addAABBs(
1188 ::Block const& block,
1189 ::IConstBlockSource const& region,
1190 ::BlockPos const& pos,
1191 ::AABB const* intersectTestBox,
1192 ::std::vector<::AABB>& inoutBoxes
1193 ) const;
1194
1195 MCAPI ::AABB const&
1196 $getOutline(::Block const& block, ::IConstBlockSource const&, ::BlockPos const& pos, ::AABB& bufferValue) const;
1197
1198 MCFOLD ::AABB const&
1199 $getVisualShapeInWorld(::Block const& block, ::IConstBlockSource const&, ::BlockPos const&, ::AABB& bufferAABB)
1200 const;
1201
1202 MCAPI ::AABB const& $getVisualShape(::Block const&, ::AABB&) const;
1203
1204 MCAPI ::AABB const& $getUIShape(::Block const& block, ::AABB& bufferAABB) const;
1205
1206 MCAPI bool
1207 $getLiquidClipVolume(::Block const& block, ::BlockSource& region, ::BlockPos const& pos, ::AABB& includeBox) const;
1208
1209 MCAPI bool $isObstructingChests(::BlockSource& region, ::BlockPos const& pos, ::Block const& thisBlock) const;
1210
1211 MCAPI ::Vec3 $randomlyModifyPosition(::BlockPos const& pos, int& seed) const;
1212
1213 MCFOLD ::Vec3 $randomlyModifyPosition(::BlockPos const& pos) const;
1214
1215 MCFOLD void $onProjectileHit(::BlockSource&, ::BlockPos const&, ::Actor const&) const;
1216
1217 MCFOLD void $onLightningHit(::BlockSource& region, ::BlockPos const& pos) const;
1218
1219 MCFOLD bool $liquidCanFlowIntoFromDirection(
1220 uchar flowIntoFacing,
1221 ::std::function<::Block const&(::BlockPos const&)> const& getBlock,
1222 ::BlockPos const& pos
1223 ) const;
1224
1225 MCFOLD bool $hasVariableLighting() const;
1226
1227 MCFOLD bool $isStrippable(::Block const& srcBlock) const;
1228
1229 MCFOLD ::Block const& $getStrippedBlock(::Block const& srcBlock) const;
1230
1231 MCAPI bool $canProvideMultifaceSupport(::Block const& block, uchar face) const;
1232
1233 MCAPI bool $canConnect(::Block const&, uchar toOther, ::Block const& thisBlock) const;
1234
1235 MCFOLD bool $isMovingBlock() const;
1236
1237 MCFOLD ::CopperBehavior const* $tryGetCopperBehavior() const;
1238
1239 MCFOLD bool $isStemBlock() const;
1240
1241 MCFOLD bool $isContainerBlock() const;
1242
1243 MCFOLD bool $isCraftingBlock() const;
1244
1245 MCAPI bool $isLavaBlocking() const;
1246
1247 MCFOLD bool $isFenceBlock() const;
1248
1249 MCFOLD bool $isFenceGateBlock() const;
1250
1251 MCFOLD bool $isThinFenceBlock() const;
1252
1253 MCFOLD bool $isWallBlock() const;
1254
1255 MCFOLD bool $isStairBlock() const;
1256
1257 MCFOLD bool $isSlabBlock() const;
1258
1259 MCFOLD bool $isDoorBlock() const;
1260
1261 MCFOLD bool $isRailBlock() const;
1262
1263 MCFOLD bool $isButtonBlock() const;
1264
1265 MCFOLD bool $isLeverBlock() const;
1266
1267 MCFOLD bool $isCandleCakeBlock() const;
1268
1269 MCFOLD bool $isMultifaceBlock() const;
1270
1271 MCFOLD bool $isSignalSource() const;
1272
1273 MCFOLD bool $isConsumerComponent() const;
1274
1275 MCAPI bool $canBeOriginalSurface() const;
1276
1277 MCFOLD bool $isSilentWhenJumpingOff() const;
1278
1279 MCFOLD bool $isValidAuxValue(int value) const;
1280
1281 MCFOLD bool $canFillAtPos(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
1282
1283 MCFOLD ::Block const& $sanitizeFillBlock(::Block const& block) const;
1284
1285 MCFOLD void $onFillBlock(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
1286
1287 MCFOLD int $getDirectSignal(::BlockSource& region, ::BlockPos const& pos, int dir) const;
1288
1289 MCAPI ::std::optional<::HashedString> $getRequiredMedium() const;
1290
1291 MCFOLD bool
1292 $shouldConnectToRedstone(::BlockSource& region, ::BlockPos const& pos, ::Direction::Type direction) const;
1293
1294 MCFOLD void
1295 $handlePrecipitation(::BlockSource& region, ::BlockPos const& pos, float downfallAmount, float temperature) const;
1296
1297 MCAPI bool $canBeUsedInCommands(::BaseGameVersion const& baseGameVersion) const;
1298
1299 MCFOLD bool $checkIsPathable(::Actor& entity, ::BlockPos const& lastPathPos, ::BlockPos const& pathPos) const;
1300
1301 MCFOLD bool $shouldDispense(::BlockSource& region, ::Container& container) const;
1302
1303 MCFOLD bool $dispense(::BlockSource& region, ::Container& container, int slot, ::Vec3 const& pos, uchar face) const;
1304
1305 MCFOLD void
1306 $transformOnFall(::BlockSource& region, ::BlockPos const& pos, ::Actor* entity, float fallDistance) const;
1307
1308 MCFOLD void $onRedstoneUpdate(::BlockSource& region, ::BlockPos const& pos, int strength, bool isFirstTime) const;
1309
1310 MCFOLD void $onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const;
1311
1312 MCFOLD bool $detachesOnPistonMove(::BlockSource& region, ::BlockPos const& pos) const;
1313
1314 MCFOLD void $movedByPiston(::BlockSource& region, ::BlockPos const& pos) const;
1315
1316 MCFOLD void $onStructureBlockPlace(::BlockSource& region, ::BlockPos const& pos) const;
1317
1318 MCFOLD void $onStructureNeighborBlockPlace(::BlockSource& region, ::BlockPos const& pos) const;
1319
1320 MCFOLD void $setupRedstoneComponent(::BlockSource& region, ::BlockPos const& pos) const;
1321
1322 MCAPI void $updateEntityAfterFallOn(::BlockPos const& pos, ::UpdateEntityAfterFallOnInterface& entity) const;
1323
1324 MCFOLD bool $isBounceBlock() const;
1325
1326 MCFOLD bool $isPreservingMediumWhenPlaced(::BlockLegacy const* medium) const;
1327
1328 MCFOLD bool $isFilteredOut(::BlockRenderLayer) const;
1329
1330 MCFOLD bool $canRenderSelectionOverlay(::BlockRenderLayer) const;
1331
1332 MCFOLD bool $ignoreEntitiesOnPistonMove(::Block const& block) const;
1333
1334 MCFOLD bool
1335 $onFertilized(::BlockSource& region, ::BlockPos const& pos, ::Actor* actor, ::FertilizerType fType) const;
1336
1337 MCFOLD bool $mayConsumeFertilizer(::BlockSource& region) const;
1338
1339 MCFOLD bool $canBeFertilized(::BlockSource& region, ::BlockPos const& pos, ::Block const& aboveBlock) const;
1340
1341 MCFOLD bool $mayPick() const;
1342
1343 MCAPI bool $mayPick(::BlockSource const& region, ::Block const& block, bool liquid) const;
1344
1345 MCFOLD bool $mayPlace(::BlockSource& region, ::BlockPos const& pos, uchar face) const;
1346
1347 MCAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos) const;
1348
1349 MCFOLD bool $mayPlaceOn(::BlockSource& region, ::BlockPos const& pos) const;
1350
1351 MCFOLD bool $tryToPlace(
1352 ::BlockSource& region,
1353 ::BlockPos const& pos,
1354 ::Block const& block,
1355 ::ActorBlockSyncMessage const* syncMsg
1356 ) const;
1357
1358 MCFOLD bool $tryToTill(::BlockSource& region, ::BlockPos const& pos, ::Actor& entity, ::ItemStack& item) const;
1359
1360 MCFOLD bool $breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const;
1361
1362 MCFOLD void
1363 $destroy(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::Actor* entitySource) const;
1364
1365 MCFOLD bool $getIgnoresDestroyPermissions(::Actor& entity, ::BlockPos const& pos) const;
1366
1367 MCFOLD void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
1368
1369 MCFOLD bool $getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const;
1370
1371 MCAPI ::Block const* $playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const;
1372
1373 MCAPI ::ItemInstance $asItemInstance(::Block const&, ::BlockActor const*) const;
1374
1375 MCFOLD void
1376 $spawnAfterBreak(::BlockSource&, ::Block const&, ::BlockPos const&, ::ResourceDropsContext const&) const;
1377
1378 MCAPI ::Block const&
1379 $getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue)
1380 const;
1381
1382 MCAPI int $calcVariant(::BlockSource& region, ::BlockPos const& pos, ::mce::Color const& baseColor) const;
1383
1384 MCFOLD bool $isAttachedTo(::BlockSource& region, ::BlockPos const& pos, ::BlockPos& outAttachedTo) const;
1385
1386 MCFOLD bool $attack(::Player* player, ::BlockPos const& pos) const;
1387
1388 MCAPI bool $shouldTriggerEntityInside(::BlockSource& region, ::BlockPos const& pos, ::Actor& entity) const;
1389
1390 MCFOLD bool $canBeBuiltOver(::BlockSource& region, ::BlockPos const& pos, ::BlockItem const& newItem) const;
1391
1392 MCAPI bool $canBeBuiltOver(::BlockSource& region, ::BlockPos const& pos) const;
1393
1394 MCFOLD void $triggerEvent(::BlockSource& region, ::BlockPos const& pos, int b0, int b1) const;
1395
1396 MCAPI void $executeEvent(
1397 ::BlockSource& region,
1398 ::BlockPos const& pos,
1399 ::Block const& block,
1400 ::std::string const& eventName,
1401 ::Actor& sourceEntity
1402 ) const;
1403
1404 MCAPI ::MobSpawnerData const* $getMobToSpawn(::SpawnConditions const& conditions, ::BlockSource& region) const;
1405
1406 MCAPI bool $shouldStopFalling(::Actor& entity) const;
1407
1408 MCFOLD bool $pushesUpFallingBlocks() const;
1409
1410 MCFOLD bool $canHaveExtraData() const;
1411
1412 MCFOLD bool $hasComparatorSignal() const;
1413
1414 MCFOLD int
1415 $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
1416
1417 MCAPI bool $canSlide(::BlockSource& region, ::BlockPos const& pos) const;
1418
1419 MCFOLD bool $canInstatick() const;
1420
1421 MCFOLD bool $canSpawnAt(::BlockSource const& region, ::BlockPos const& pos) const;
1422
1423 MCFOLD void $notifySpawnedAt(::BlockSource& region, ::BlockPos const& pos) const;
1424
1425 MCFOLD bool $causesFreezeEffect() const;
1426
1427 MCFOLD ::std::string $buildDescriptionId(::Block const&) const;
1428
1429 MCFOLD bool $isAuxValueRelevantForPicking() const;
1430
1431 MCFOLD bool $isSeasonTinted(::Block const& block, ::BlockSource& region, ::BlockPos const& p) const;
1432
1433 MCAPI void $onGraphicsModeChanged(::BlockGraphicsModeChangeContext const& context);
1434
1435 MCAPI float $getShadeBrightness(::Block const& block) const;
1436
1437 MCAPI int $telemetryVariant(::BlockSource& region, ::BlockPos const& pos) const;
1438
1439 MCAPI int $getVariant(::Block const& block) const;
1440
1441 MCFOLD bool $canSpawnOn(::Actor*) const;
1442
1443 MCFOLD ::Block const& $getRenderBlock() const;
1444
1445 MCFOLD uchar $getMappedFace(uchar face, ::Block const& block) const;
1446
1447 MCFOLD ::Flip $getFaceFlip(uchar face, ::Block const& block) const;
1448
1449 MCFOLD void $animateTickBedrockLegacy(::BlockAnimateTickData const&) const;
1450
1451 MCFOLD void $animateTick(::BlockAnimateTickData const&) const;
1452
1453 MCFOLD ::BlockLegacy& $init();
1454
1455 MCAPI ::Brightness $getLightEmission(::Block const&) const;
1456
1457 MCFOLD ::Block const* $tryLegacyUpgrade(ushort) const;
1458
1459 MCFOLD bool $dealsContactDamage(::Actor const& actor, ::Block const& block, bool isPathFinding) const;
1460
1461 MCFOLD ::Block const* $tryGetInfested(::Block const&) const;
1462
1463 MCFOLD ::Block const* $tryGetUninfested(::Block const&) const;
1464
1465 MCFOLD void $_addHardCodedBlockComponents(::Experiments const&);
1466
1467 MCFOLD void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
1468
1469 MCFOLD void $onExploded(::BlockSource& region, ::BlockPos const& pos, ::Actor* entitySource) const;
1470
1471 MCFOLD void $onStandOn(::EntityContext& entity, ::BlockPos const& pos) const;
1472
1473 MCFOLD bool $shouldTickOnSetBlock() const;
1474
1475 MCFOLD void $tick(::BlockSource& region, ::BlockPos const& pos, ::Random& random) const;
1476
1477 MCAPI void $randomTick(::BlockSource& region, ::BlockPos const& pos, ::Random& random) const;
1478
1479 MCFOLD bool $isInteractiveBlock() const;
1480
1481 MCAPI bool $use(::Player& player, ::BlockPos const& pos, uchar face, ::std::optional<::Vec3>) const;
1482
1483 MCFOLD bool $use(::Player&, ::BlockPos const&, uchar) const;
1484
1485 MCFOLD bool $allowStateMismatchOnPlacement(::Block const& clientTarget, ::Block const& serverTarget) const;
1486
1487 MCFOLD bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
1488
1489 MCAPI ::BlockRenderLayer $getRenderLayer(::Block const& block, ::BlockSource&, ::BlockPos const& pos) const;
1490
1491 MCFOLD int $getExtraRenderLayers() const;
1492
1493 MCAPI ::Brightness $getLight(::Block const&) const;
1494
1495 MCFOLD ::Brightness $getEmissiveBrightness(::Block const&) const;
1496
1497 MCFOLD ::mce::Color $getMapColor(::BlockSource&, ::BlockPos const&, ::Block const&) const;
1498
1499 MCFOLD void $_onHitByActivatingAttack(::BlockSource&, ::BlockPos const&, ::Actor*) const;
1500
1501 MCFOLD void $entityInside(::BlockSource&, ::BlockPos const&, ::Actor&) const;
1502 // NOLINTEND
1503
1504public:
1505 // vftables
1506 // NOLINTBEGIN
1507 MCAPI static void** $vftable();
1508 // NOLINTEND
1509};
Definition AABB.h:16
Definition Actor.h:104
Definition BaseGameVersion.h:13
Definition BlockActor.h:32
Definition BlockComponentStorage.h:8
Definition BlockEntityFallOnEvent.h:15
Definition BlockItem.h:23
Definition BlockLegacy.h:88
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition BlockStateGroup.h:13
Definition BlockStateInstance.h:10
Definition BlockState.h:11
Definition ITrait.h:13
Definition Block.h:36
Definition Container.h:30
Definition CopperBehavior.h:13
Definition DefinitionEvent.h:17
Definition DefinitionTrigger.h:10
Definition EntityContext.h:16
Definition Experiments.h:14
Definition GetCollisionShapeInterface.h:13
Definition HashedString.h:5
Definition HitResult.h:19
Definition IConstBlockSource.h:24
Definition IResourceDropsStrategy.h:13
Definition ItemActor.h:27
Definition ItemInstance.h:16
Definition ItemStack.h:25
Definition Material.h:8
Definition MobSpawnerData.h:16
Definition NetEaseBlockComponentStorage.h:5
Definition Player.h:119
Definition Random.h:16
Definition Randomize.h:13
Definition RenderParams.h:30
Definition ScriptBlockCustomComponentsFinalizer.h:5
Definition SemVersion.h:15
Definition SpawnConditions.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition optional_ref.h:10
Definition ActorBlockSyncMessage.h:10
Definition BlockAnimateTickData.h:5
Definition BlockComponentDescription.h:20
Definition BlockGraphicsModeChangeContext.h:5
Definition BlockLegacy.h:205
Definition BlockLegacy.h:194
Definition BlockLegacy.h:164
Definition BlockLegacy.h:311
Definition BlockLegacy.h:244
Definition Brightness.h:8
Definition CommandName.h:5
Definition IntRange.h:11
Definition NewBlockID.h:8
Definition ResourceDropsContext.h:5
Definition ResourceDrops.h:10
Definition UpdateEntityAfterFallOnInterface.h:13
Definition EntityType.h:15
Definition context.h:5