Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
SpeleothemBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/block/FallingBlock.h"
7#include "mc/world/level/block/SpeleothemThickness.h"
8
9// auto generated forward declare list
10// clang-format off
11class AABB;
12class Actor;
13class Block;
14class BlockPos;
15class BlockSource;
16class HashedString;
17class Vec3;
18namespace BlockEvents { class BlockEntityFallOnEvent; }
19namespace BlockEvents { class BlockQueuedTickEvent; }
20namespace BlockEvents { class BlockRandomTickEvent; }
21namespace mce { class Color; }
22// clang-format on
23
24class SpeleothemBlock : public ::FallingBlock {
25public:
26 // SpeleothemBlock inner types define
27 enum class DealsFallDamage : uchar {
28 No = 0,
29 Yes = 1,
30 };
31
32 enum class GrowsStalagmite : uchar {
33 No = 0,
34 Yes = 1,
35 };
36
37public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<8, 8, ::HashedString const&> mBlockToGrowOn;
41 ::ll::TypedStorage<4, 4, int> mMaxLength;
42 ::ll::TypedStorage<1, 1, ::SpeleothemBlock::GrowsStalagmite> mGrowsStalagmite;
43 ::ll::TypedStorage<4, 4, float> mGrowthProbability;
44 // NOLINTEND
45
46public:
47 // prevent constructor by default
48 SpeleothemBlock& operator=(SpeleothemBlock const&);
49 SpeleothemBlock(SpeleothemBlock const&);
50 SpeleothemBlock();
51
52public:
53 // virtual functions
54 // NOLINTBEGIN
55 virtual ::mce::Color getDustColor(::Block const&) const /*override*/;
56
57 virtual ::std::string getDustParticleName(::Block const&) const /*override*/;
58
59 virtual int getVariant(::Block const& block) const /*override*/;
60
61 virtual ::Block const&
62 getPlacementBlock(::Actor const& by, ::BlockPos const& pos, uchar face, ::Vec3 const& clickPos, int itemValue) const
63 /*override*/;
64
65 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
66
67 virtual bool mayPlace(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
68
69 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
70 /*override*/;
71
72 virtual bool canGrow(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& stalactiteTipPos) const;
73
74 virtual ::Block const& getInitialDefaultState() /*override*/;
75
76 virtual ::AABB const& getVisualShape(::Block const& block, ::AABB& bufferAABB) const /*override*/;
77
78 virtual void onLand(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
79
80 virtual void onProjectileHit(::BlockSource& region, ::BlockPos const& pos, ::Actor const& projectile) const
81 /*override*/;
82
83 virtual bool falling() const /*override*/;
84
85 virtual void
86 startFalling(::BlockSource& region, ::BlockPos const& pos, ::Block const& oldBlock, bool creative) const
87 /*override*/;
88
89 virtual void randomTick(::BlockEvents::BlockRandomTickEvent& eventData) const;
90
91 virtual bool _canGrow(::Block const& rootBlock, ::Block const& aboveRootLiquidBlock) const;
92
93 virtual bool _isValidTipGrowPos(::BlockSource& region, ::BlockPos const& growPos, uchar growDirection) const;
94
95 virtual void _createSpeleothem(
96 ::BlockSource& region,
97 ::BlockPos const& pos,
98 uchar direction,
99 ::SpeleothemThickness thickness
100 ) const;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
107 ::std::string const& nameId,
108 int id,
109 ::HashedString const& blockToGrowOn,
110 int maxLength,
111 ::SpeleothemBlock::GrowsStalagmite growsStalagmite,
112 float growthProbability,
113 ::SpeleothemBlock::DealsFallDamage dealsFallDamage
114 );
115
116 MCNAPI ::SpeleothemThickness _calculateSpeleothemThickness(
117 ::BlockSource& region,
118 ::BlockPos const& pos,
119 uchar tipDirection,
120 bool mergeOpposingTips
121 ) const;
122
123 MCNAPI bool _canTipGrow(::BlockSource& region, ::BlockPos const& tipPos) const;
124
125 MCNAPI void _createMergedTips(::BlockSource& region, ::Block const& tipBlock, ::BlockPos const& tipPos) const;
126
127 MCNAPI ::std::optional<::BlockPos>
128 _findRootBlock(::BlockSource& region, ::BlockPos const& pos, int maxSearchLength) const;
129
130 MCNAPI ::std::optional<::BlockPos>
131 _findTip(::BlockSource& region, ::BlockPos const& pos, uchar searchDirection, int maxSearchLength, bool) const;
132
133 MCNAPI void _grow(::BlockSource& region, ::BlockPos const& growFromPos, uchar growToDirection) const;
134
135 MCNAPI void _growStalagmiteBelow(::BlockSource& region, ::BlockPos const& growIntoPos) const;
136
137 MCNAPI void growStalactite(::BlockSource& region, ::BlockPos const& pos) const;
138
139 MCNAPI void growStalagmite(::BlockSource& region, ::BlockPos const& pos) const;
140
141 MCNAPI void onFallOn(::BlockEvents::BlockEntityFallOnEvent& eventData) const;
142
143 MCNAPI void tick(::BlockEvents::BlockQueuedTickEvent const& eventData) const;
144 // NOLINTEND
145
146public:
147 // static functions
148 // NOLINTBEGIN
149 MCNAPI static bool _isTip(::Block const& block, bool includeMergedTip);
150
151 MCNAPI static bool isSpeleothemWithDirection(::Block const& block, uchar tipDirection);
152 // NOLINTEND
153
154public:
155 // constructor thunks
156 // NOLINTBEGIN
157 MCNAPI void* $ctor(
158 ::std::string const& nameId,
159 int id,
160 ::HashedString const& blockToGrowOn,
161 int maxLength,
162 ::SpeleothemBlock::GrowsStalagmite growsStalagmite,
163 float growthProbability,
164 ::SpeleothemBlock::DealsFallDamage dealsFallDamage
165 );
166 // NOLINTEND
167
168public:
169 // virtual function thunks
170 // NOLINTBEGIN
171 MCNAPI ::mce::Color $getDustColor(::Block const&) const;
172
173 MCNAPI ::std::string $getDustParticleName(::Block const&) const;
174
175 MCNAPI int $getVariant(::Block const& block) const;
176
177 MCNAPI ::Block const& $getPlacementBlock(
178 ::Actor const& by,
179 ::BlockPos const& pos,
180 uchar face,
181 ::Vec3 const& clickPos,
182 int itemValue
183 ) const;
184
185 MCNAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
186
187 MCNAPI bool $mayPlace(::BlockSource& region, ::BlockPos const& pos) const;
188
189 MCNAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
190
191 MCNAPI bool $canGrow(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& stalactiteTipPos) const;
192
193 MCNAPI ::Block const& $getInitialDefaultState();
194
195 MCNAPI ::AABB const& $getVisualShape(::Block const& block, ::AABB& bufferAABB) const;
196
197 MCNAPI void $onLand(::BlockSource& region, ::BlockPos const& pos) const;
198
199 MCNAPI void $onProjectileHit(::BlockSource& region, ::BlockPos const& pos, ::Actor const& projectile) const;
200
201 MCNAPI bool $falling() const;
202
203 MCNAPI void
204 $startFalling(::BlockSource& region, ::BlockPos const& pos, ::Block const& oldBlock, bool creative) const;
205
207
208 MCNAPI bool $_canGrow(::Block const& rootBlock, ::Block const& aboveRootLiquidBlock) const;
209
210 MCNAPI bool $_isValidTipGrowPos(::BlockSource& region, ::BlockPos const& growPos, uchar growDirection) const;
211
213 ::BlockSource& region,
214 ::BlockPos const& pos,
215 uchar direction,
216 ::SpeleothemThickness thickness
217 ) const;
218
219
220 // NOLINTEND
221
222public:
223 // vftables
224 // NOLINTBEGIN
225 MCNAPI static void** $vftable();
226 // NOLINTEND
227};
Definition AABB.h:18
Definition Actor.h:116
Definition BlockEntityFallOnEvent.h:17
Definition BlockQueuedTickEvent.h:16
Definition BlockRandomTickEvent.h:16
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
Definition FallingBlock.h:19
Definition HashedString.h:5
MCAPI void $randomTick(::BlockEvents::BlockRandomTickEvent &eventData) const
MCAPI void _createMergedTips(::BlockSource &region, ::Block const &tipBlock, ::BlockPos const &tipPos) const
MCAPI void $_createSpeleothem(::BlockSource &region, ::BlockPos const &pos, uchar direction, ::SpeleothemThickness thickness) const
MCAPI::std::string $getDustParticleName(::Block const &) const
MCAPI int $getVariant(::Block const &block) const
MCAPI void $onProjectileHit(::BlockSource &region, ::BlockPos const &pos, ::Actor const &projectile) const
MCAPI ::std::optional<::BlockPos > _findRootBlock(::BlockSource &region, ::BlockPos const &pos, int maxSearchLength) const
MCAPI bool $falling() const
MCAPI void _growStalagmiteBelow(::BlockSource &region, ::BlockPos const &growIntoPos) const
MCAPI bool $mayPlace(::BlockSource &region, ::BlockPos const &pos) const
static MCAPI bool _isTip(::Block const &block, bool includeMergedTip)
MCAPI bool $_isValidTipGrowPos(::BlockSource &region, ::BlockPos const &growPos, uchar growDirection) const
MCAPI bool $canGrow(::BlockSource &region, ::BlockPos const &pos, ::BlockPos const &stalactiteTipPos) const
MCAPI bool $canSurvive(::BlockSource &region, ::BlockPos const &pos) const
MCAPI::SpeleothemThickness _calculateSpeleothemThickness(::BlockSource &region, ::BlockPos const &pos, uchar tipDirection, bool mergeOpposingTips) const
static MCAPI bool isSpeleothemWithDirection(::Block const &block, uchar tipDirection)
MCAPI bool $_canGrow(::Block const &rootBlock, ::Block const &aboveRootLiquidBlock) const
MCAPI void * $ctor(::std::string const &nameId, int id, ::HashedString const &blockToGrowOn, int maxLength, ::SpeleothemBlock::GrowsStalagmite growsStalagmite, float growthProbability, ::SpeleothemBlock::DealsFallDamage dealsFallDamage)
MCAPI::Block const & $getPlacementBlock(::Actor const &by, ::BlockPos const &pos, uchar face, ::Vec3 const &clickPos, int itemValue) const
MCAPI bool _canTipGrow(::BlockSource &region, ::BlockPos const &tipPos) const
MCAPI void growStalagmite(::BlockSource &region, ::BlockPos const &pos) const
MCAPI ::std::optional<::BlockPos > _findTip(::BlockSource &region, ::BlockPos const &pos, uchar searchDirection, int maxSearchLength, bool) const
MCAPI void $onLand(::BlockSource &region, ::BlockPos const &pos) const
MCAPI::mce::Color $getDustColor(::Block const &) const
MCAPI::AABB const & $getVisualShape(::Block const &block, ::AABB &bufferAABB) const
MCAPI SpeleothemBlock(::std::string const &nameId, int id, ::HashedString const &blockToGrowOn, int maxLength, ::SpeleothemBlock::GrowsStalagmite growsStalagmite, float growthProbability, ::SpeleothemBlock::DealsFallDamage dealsFallDamage)
MCAPI void growStalactite(::BlockSource &region, ::BlockPos const &pos) const
MCAPI void onFallOn(::BlockEvents::BlockEntityFallOnEvent &eventData) const
MCAPI void tick(::BlockEvents::BlockQueuedTickEvent const &eventData) const
MCAPI void $neighborChanged(::BlockSource &region, ::BlockPos const &pos, ::BlockPos const &neighborPos) const
MCAPI::Block const & $getInitialDefaultState()
static MCAPI void ** $vftable()
MCAPI void $startFalling(::BlockSource &region, ::BlockPos const &pos, ::Block const &oldBlock, bool creative) const
MCAPI void _grow(::BlockSource &region, ::BlockPos const &growFromPos, uchar growToDirection) const
Definition Vec3.h:10
Definition Color.h:13