Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
PistonBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/Direction.h"
7#include "mc/world/level/block/ActorBlockBase.h"
8#include "mc/world/level/block/BlockSupportType.h"
9#include "mc/world/level/block/BlockType.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
14class BaseGameVersion;
15class Block;
16class BlockPos;
17class BlockSource;
19class Vec3;
20namespace BlockEvents { class BlockPlaceEvent; }
21namespace BlockEvents { class BlockQueuedTickEvent; }
22namespace BlockEvents { class BlockStateChangeEvent; }
23// clang-format on
24
25class PistonBlock : public ::ActorBlock {
26public:
27 // PistonBlock inner types define
28 enum class Type : int {
29 Normal = 0,
30 Sticky = 1,
31 };
32
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<4, 4, ::PistonBlock::Type> mType;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
41 PistonBlock();
42
43public:
44 // virtual functions
45 // NOLINTBEGIN
46 virtual void setupRedstoneComponent(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
47
48 virtual bool requiresLegacyRedstoneSetup() const /*override*/;
49
50 virtual ::Block const&
51 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
52 /*override*/;
53
54 virtual bool canProvideSupport(::Block const&, uchar, ::BlockSupportType) const /*override*/;
55
56 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
57 /*override*/;
58
59 virtual bool getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const
60 /*override*/;
61
62 virtual bool
63 shouldConnectToRedstone(::BlockSource& region, ::BlockPos const& pos, ::Direction::Type direction) const
64 /*override*/;
65
66 virtual bool isValidAuxValue(int value) const /*override*/;
67
68 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
69
70 virtual int getVariant(::Block const& block) const /*override*/;
71
72 virtual uchar getMappedFace(uchar face, ::Block const& block) const /*override*/;
73
74 virtual bool breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const /*override*/;
75
76 virtual bool pushesUpFallingBlocks() const /*override*/;
77 // NOLINTEND
78
79public:
80 // member functions
81 // NOLINTBEGIN
82 MCNAPI PistonBlock(::std::string const& nameId, int id, ::PistonBlock::Type isSticky);
83
84 MCNAPI void _onStateChange(::BlockEvents::BlockStateChangeEvent const& eventData) const;
85
86 MCNAPI void onPlace(::BlockEvents::BlockPlaceEvent& eventData) const;
87
88 MCFOLD void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
89 // NOLINTEND
90
91public:
92 // static variables
93 // NOLINTBEGIN
94 MCAPI static ::std::add_lvalue_reference_t<::BlockPos const[]> ARM_DIRECTION_OFFSETS();
95 // NOLINTEND
96
97public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCNAPI void* $ctor(::std::string const& nameId, int id, ::PistonBlock::Type isSticky);
101 // NOLINTEND
102
103public:
104 // virtual function thunks
105 // NOLINTBEGIN
106 MCNAPI void $setupRedstoneComponent(::BlockSource& region, ::BlockPos const& pos) const;
107
108 MCNAPI bool $requiresLegacyRedstoneSetup() const;
109
110 MCNAPI ::Block const& $getPlacementBlock(
111 ::Actor const& by,
112 ::BlockPos const& pos,
113 uchar face,
114 ::Vec3 const& clickPos,
115 int itemValue
116 ) const;
117
118 MCNAPI bool $canProvideSupport(::Block const&, uchar, ::BlockSupportType) const;
119
120 MCNAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
121
122 MCNAPI bool $getSecondPart(::IConstBlockSource const& region, ::BlockPos const& pos, ::BlockPos& out) const;
123
124 MCNAPI bool
125 $shouldConnectToRedstone(::BlockSource& region, ::BlockPos const& pos, ::Direction::Type direction) const;
126
127 MCNAPI bool $isValidAuxValue(int value) const;
128
129 MCNAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
130
131 MCNAPI int $getVariant(::Block const& block) const;
132
133 MCNAPI uchar $getMappedFace(uchar face, ::Block const& block) const;
134
135 MCNAPI bool $breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const;
136
137 MCNAPI bool $pushesUpFallingBlocks() const;
138
139
140 // NOLINTEND
141
142public:
143 // vftables
144 // NOLINTBEGIN
145 MCNAPI static void** $vftable();
146 // NOLINTEND
147};
Definition Actor.h:116
Definition BaseGameVersion.h:8
Definition BlockPlaceEvent.h:16
Definition BlockQueuedTickEvent.h:16
Definition BlockStateChangeEvent.h:17
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
Definition IConstBlockSource.h:25
MCAPI void $neighborChanged(::BlockSource &region, ::BlockPos const &pos, ::BlockPos const &neighborPos) const
MCAPI bool $breaksFallingBlocks(::Block const &block, ::BaseGameVersion const version) const
MCAPI void $setupRedstoneComponent(::BlockSource &region, ::BlockPos const &pos) const
MCAPI bool $getSecondPart(::IConstBlockSource const &region, ::BlockPos const &pos, ::BlockPos &out) const
MCAPI void onPlace(::BlockEvents::BlockPlaceEvent &eventData) const
MCAPI PistonBlock(::std::string const &nameId, int id, ::PistonBlock::Type isSticky)
MCAPI bool $isValidAuxValue(int value) const
MCAPI void * $ctor(::std::string const &nameId, int id, ::PistonBlock::Type isSticky)
MCAPI void _onStateChange(::BlockEvents::BlockStateChangeEvent const &eventData) const
MCAPI bool $pushesUpFallingBlocks() const
MCAPI bool $canSurvive(::BlockSource &region, ::BlockPos const &pos) const
MCAPI bool $shouldConnectToRedstone(::BlockSource &region, ::BlockPos const &pos, ::Direction::Type direction) const
MCAPI uchar $getMappedFace(uchar face, ::Block const &block) const
MCAPI bool $canProvideSupport(::Block const &, uchar, ::BlockSupportType) const
static MCAPI void ** $vftable()
MCAPI bool $requiresLegacyRedstoneSetup() const
MCAPI::Block const & $getPlacementBlock(::Actor const &by, ::BlockPos const &pos, uchar face, ::Vec3 const &clickPos, int itemValue) const
MCAPI int $getVariant(::Block const &block) const
Definition Vec3.h:10