LeviLamina
Loading...
Searching...
No Matches
WallBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/optional_ref.h"
7#include "mc/world/level/ShapeType.h"
8#include "mc/world/level/block/BlockSupportType.h"
9#include "mc/world/level/block/BlockType.h"
10#include "mc/world/level/block/WallConnectionType.h"
11
12// auto generated forward declare list
13// clang-format off
14class AABB;
15class Actor;
16class BaseGameVersion;
17class Block;
18class BlockPos;
19class BlockSource;
21class HitResult;
23class Material;
24class Player;
25class Vec3;
26namespace BlockEvents { class BlockPlaceEvent; }
27namespace BlockEvents { class BlockQueuedTickEvent; }
28// clang-format on
29
30class WallBlock : public ::BlockType {
31public:
32 // prevent constructor by default
33 WallBlock();
34
35public:
36 // virtual functions
37 // NOLINTBEGIN
38 virtual ::Block const&
39 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
40 /*override*/;
41
42 virtual void onStructureBlockPlace(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
43
44 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
45 /*override*/;
46
47 virtual ::AABB const&
48 getVisualShapeInWorld(::Block const& block, ::IConstBlockSource const& bufferAABB, ::BlockPos const&, ::AABB&) const
49 /*override*/;
50
51 virtual ::AABB getCollisionShape(
52 ::Block const& block,
53 ::IConstBlockSource const& region,
54 ::BlockPos const& pos,
56 ) const /*override*/;
57
58 virtual ::AABB const& getOutline(
59 ::Block const& block,
60 ::IConstBlockSource const& region,
61 ::BlockPos const& pos,
62 ::AABB& bufferValue
63 ) const /*override*/;
64
65 virtual bool canProvideSupport(::Block const& face, uchar type, ::BlockSupportType) const /*override*/;
66
67 virtual bool isWallBlock() const /*override*/;
68
69 virtual bool breaksFallingBlocks(::Block const& version, ::BaseGameVersion const) const /*override*/;
70
71 virtual ::HitResult clip(
72 ::Block const& block,
73 ::BlockSource const& region,
74 ::BlockPos const& pos,
75 ::Vec3 const& A,
76 ::Vec3 const& B,
77 ::ShapeType shapeType,
79 ) const /*override*/;
80
81 virtual ::Block const* playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const
82 /*override*/;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
88 MCAPI WallBlock(::std::string const& nameId, int id, ::BlockType const& baseBlock);
89
90 MCAPI WallBlock(::std::string const& nameId, int id, ::Material const& material);
91
92 MCAPI ::WallConnectionType
93 _desiredConnectionState(::BlockSource& region, ::BlockPos const& pos, uchar neighbor) const;
94
95 MCAPI bool _shouldBePost(::BlockSource& region, ::BlockPos const& pos, ::Block const& block) const;
96
97 MCAPI bool _shouldUpdateConnectionStates(::BlockSource& region, ::BlockPos const& pos) const;
98
99 MCAPI bool _tryAddToTickingQueue(::BlockSource& region, ::BlockPos const& pos) const;
100
101 MCAPI void onPlaceBase(::BlockEvents::BlockPlaceEvent& eventData) const;
102
103 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
104
105 MCAPI void tryFixWallStates(::BlockSource& region, ::BlockPos const& pos, int updateFlags) const;
106 // NOLINTEND
107
108public:
109 // static variables
110 // NOLINTBEGIN
111 MCAPI static float const& POST_HEIGHT();
112
113 MCAPI static float const& POST_WIDTH();
114
115 MCAPI static ::BaseGameVersion const& WALL_DOESNT_BREAK_FALLING_BLOCK_VERSION();
116
117 MCAPI static float const& WALL_HEIGHT();
118
119 MCAPI static float const& WALL_WIDTH();
120 // NOLINTEND
121
122public:
123 // constructor thunks
124 // NOLINTBEGIN
125 MCAPI void* $ctor(::std::string const& nameId, int id, ::BlockType const& baseBlock);
126
127 MCAPI void* $ctor(::std::string const& nameId, int id, ::Material const& material);
128 // NOLINTEND
129
130public:
131 // virtual function thunks
132 // NOLINTBEGIN
133 MCAPI ::Block const& $getPlacementBlock(
134 ::Actor const& by,
135 ::BlockPos const& pos,
136 uchar face,
137 ::Vec3 const& clickPos,
138 int itemValue
139 ) const;
140
141 MCAPI void $onStructureBlockPlace(::BlockSource& region, ::BlockPos const& pos) const;
142
143 MCAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
144
145 MCAPI ::AABB const& $getVisualShapeInWorld(
146 ::Block const& block,
147 ::IConstBlockSource const& bufferAABB,
148 ::BlockPos const&,
149 ::AABB&
150 ) const;
151
152 MCAPI ::AABB $getCollisionShape(
153 ::Block const& block,
154 ::IConstBlockSource const& region,
155 ::BlockPos const& pos,
157 ) const;
158
159 MCFOLD ::AABB const& $getOutline(
160 ::Block const& block,
161 ::IConstBlockSource const& region,
162 ::BlockPos const& pos,
163 ::AABB& bufferValue
164 ) const;
165
166 MCFOLD bool $canProvideSupport(::Block const& face, uchar type, ::BlockSupportType) const;
167
168 MCFOLD bool $isWallBlock() const;
169
170 MCAPI bool $breaksFallingBlocks(::Block const& version, ::BaseGameVersion const) const;
171
172 MCFOLD ::HitResult $clip(
173 ::Block const& block,
174 ::BlockSource const& region,
175 ::BlockPos const& pos,
176 ::Vec3 const& A,
177 ::Vec3 const& B,
178 ::ShapeType shapeType,
180 ) const;
181
182 MCAPI ::Block const* $playerWillDestroy(::Player& player, ::BlockPos const& pos, ::Block const& block) const;
183
184
185 // NOLINTEND
186
187public:
188 // vftables
189 // NOLINTBEGIN
190 MCAPI static void** $vftable();
191 // NOLINTEND
192};
Definition AABB.h:18
Definition Actor.h:125
Definition BaseGameVersion.h:13
Definition BlockPlaceEvent.h:18
Definition BlockQueuedTickEvent.h:18
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:19
Definition IConstBlockSource.h:24
Definition Material.h:8
Definition Player.h:137
Definition Vec3.h:10
Definition optional_ref.h:10