LeviLamina
Loading...
Searching...
No Matches
BlockMultiBlockComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/v1_26_20/block/MultiBlockPart.h"
7#include "mc/platform/brstd/function_ref.h"
8#include "mc/world/level/block/components/IBlockComponent.h"
9
10// auto generated forward declare list
11// clang-format off
12class AABB;
13class Block;
14class BlockPos;
15class BlockSource;
16class CircuitSystem;
17struct BlockPart;
18namespace BlockEvents { class BlockBreakEvent; }
19// clang-format on
20
21class BlockMultiBlockComponent : public ::IBlockComponent {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<1, 1, uchar> mDirection;
26 ::ll::TypedStorage<1, 1, uchar> mPartCount;
27 // NOLINTEND
28
29public:
30 // prevent constructor by default
31 BlockMultiBlockComponent();
32
33public:
34 // member functions
35 // NOLINTBEGIN
36 MCAPI BlockMultiBlockComponent(uchar partCount, uchar direction);
37
38 MCAPI bool canSurvive(::BlockSource const& region, ::Block const& block, ::BlockPos const& pos) const;
39
40 MCAPI bool forEachPart(::Block const& part, ::brstd::function_ref<bool(::BlockPart const&)> callback) const;
41
42 MCAPI bool forEachPartInWorldSpace(
43 ::Block const& part,
44 ::BlockPos const& partPos,
45 ::brstd::function_ref<bool(::BlockPart const&)> callback
46 ) const;
47
48 MCFOLD uchar getDirection() const;
49
50#ifdef LL_PLAT_C
51 MCAPI ::BlockPos getDistanceToMultiBlockEnd(::Block const& part) const;
52
53 MCAPI ::BlockPos getDistanceToMultiBlockStart(::Block const& part) const;
54
55 MCAPI ::AABB getOutlineShape(::Block const& part, ::BlockPos const& partWorldPos) const;
56#endif
57
58 MCFOLD uchar getPartCount() const;
59
60 MCAPI bool isMultiBlockStart(::Block const& part) const;
61
62 MCAPI bool mayPlace(::BlockSource& region, ::Block const& block, ::BlockPos const& pos) const;
63
64 MCAPI void onEvent(::BlockEvents::BlockBreakEvent& event) const;
65 // NOLINTEND
66
67public:
68 // static functions
69 // NOLINTBEGIN
70 MCAPI static ::SharedTypes::v1_26_20::MultiBlockPart getMultiBlockPartId(::Block const& part);
71
72 MCAPI static void onPlace(::BlockSource& region, ::Block const& placementBlock, ::BlockPos const& pos);
73
74 MCAPI static void
75 setupRedstoneConsumerComponent(::Block const& block, ::BlockPos const& pos, ::CircuitSystem& circuitSystem);
76 // NOLINTEND
77
78public:
79 // constructor thunks
80 // NOLINTBEGIN
81 MCAPI void* $ctor(uchar partCount, uchar direction);
82 // NOLINTEND
83};
Definition AABB.h:18
Definition BlockBreakEvent.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition CircuitSystem.h:16
Definition function_ref.h:60
Definition BlockPart.h:14
Definition IBlockComponent.h:5