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