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