LeviLamina
Loading...
Searching...
No Matches
CropBlock.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/deps/core/utility/optional_ref.h"
8#include "mc/world/item/FertilizerType.h"
9#include "mc/world/level/block/CropGrowthTarget.h"
10#include "mc/world/level/block/CropParams.h"
11#include "mc/world/level/block/CropPlacementSurface.h"
12#include "mc/world/level/block/FoliageBlock.h"
13
14// auto generated forward declare list
15// clang-format off
16class AABB;
17class Actor;
18class Block;
19class BlockActor;
20class BlockPos;
21class BlockSource;
24class ItemInstance;
25namespace BlockEvents { class ActorInternalEvent; }
26namespace BlockEvents { class BlockRandomTickEvent; }
27// clang-format on
28
29class CropBlock : public ::FoliageBlock {
30public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<8, 296, ::CropParams> mCropParams;
34 ::ll::TypedStorage<4, 4, ::CropPlacementSurface> mPlacementSurfaceType;
35 ::ll::TypedStorage<8, 48, ::HashedString> mCustomPlacementTag;
36 ::ll::TypedStorage<4, 4, ::CropGrowthTarget> mGrowthTargetType;
37 ::ll::TypedStorage<8, 32, ::std::string> mGrowthTargetFeatureName;
38 // NOLINTEND
39
40public:
41 // prevent constructor by default
42 CropBlock();
43
44public:
45 // virtual functions
46 // NOLINTBEGIN
47 virtual bool mayPlaceOn(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
48
49 virtual void neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const
50 /*override*/;
51
52 virtual bool canSurvive(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
53
54 virtual int getVariant(::Block const& block) const /*override*/;
55
56 virtual ::ItemInstance asItemInstance(::Block const&, ::BlockActor const*) const /*override*/;
57
58 virtual ::AABB getCollisionShape(
59 ::Block const&,
61 ::BlockPos const&,
63 ) const /*override*/;
64
65 virtual ::AABB const& getOutline(
66 ::Block const& block,
67 ::IConstBlockSource const& region,
68 ::BlockPos const& pos,
69 ::AABB& bufferValue
70 ) const /*override*/;
71
72 virtual bool
73 hasTag(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::std::string const& tagName) const
74 /*override*/;
75
76 virtual ::ItemInstance const getBaseSeed() const;
77
78 virtual bool
79 onFertilized(::BlockSource& region, ::BlockPos const& pos, ::Actor* actor, ::FertilizerType fType) const
80 /*override*/;
81
82 virtual bool canBeFertilized(::BlockSource& region, ::BlockPos const& pos, ::Block const& aboveBlock) const
83 /*override*/;
84
85 virtual ::Block const& setGrowth(
86 ::BlockSource& region,
87 ::BlockPos const& pos,
88 ::Block const& baseBlock,
89 ushort newGrowth,
90 int updateFlags
91 ) const /*override*/;
92
93 virtual ~CropBlock() /*override*/;
94 // NOLINTEND
95
96public:
97 // member functions
98 // NOLINTBEGIN
99 MCAPI CropBlock(::std::string const& nameId, int id, ::CropParams params);
100
101 MCAPI bool
102 _placeFeature(::BlockSource& region, ::BlockPos const& pos, ::Block const& baseBlock, int updateFlags) const;
103
104 MCAPI void onEvent(::BlockEvents::ActorInternalEvent& event) const;
105
106 MCAPI void randomTick(::BlockEvents::BlockRandomTickEvent& eventData) const;
107 // NOLINTEND
108
109public:
110 // constructor thunks
111 // NOLINTBEGIN
112 MCAPI void* $ctor(::std::string const& nameId, int id, ::CropParams params);
113 // NOLINTEND
114
115public:
116 // destructor thunk
117 // NOLINTBEGIN
118 MCAPI void $dtor();
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCAPI bool $mayPlaceOn(::BlockSource& region, ::BlockPos const& pos) const;
125
126 MCAPI void $neighborChanged(::BlockSource& region, ::BlockPos const& pos, ::BlockPos const& neighborPos) const;
127
128 MCAPI bool $canSurvive(::BlockSource& region, ::BlockPos const& pos) const;
129
130 MCAPI int $getVariant(::Block const& block) const;
131
132 MCAPI ::ItemInstance $asItemInstance(::Block const&, ::BlockActor const*) const;
133
134 MCFOLD ::AABB $getCollisionShape(
135 ::Block const&,
136 ::IConstBlockSource const&,
137 ::BlockPos const&,
139 ) const;
140
141 MCAPI ::AABB const& $getOutline(
142 ::Block const& block,
143 ::IConstBlockSource const& region,
144 ::BlockPos const& pos,
145 ::AABB& bufferValue
146 ) const;
147
148 MCAPI bool
149 $hasTag(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, ::std::string const& tagName) const;
150
151 MCAPI ::ItemInstance const $getBaseSeed() const;
152
153 MCAPI bool
154 $onFertilized(::BlockSource& region, ::BlockPos const& pos, ::Actor* actor, ::FertilizerType fType) const;
155
156 MCAPI bool $canBeFertilized(::BlockSource& region, ::BlockPos const& pos, ::Block const& aboveBlock) const;
157
158 MCAPI ::Block const& $setGrowth(
159 ::BlockSource& region,
160 ::BlockPos const& pos,
161 ::Block const& baseBlock,
162 ushort newGrowth,
163 int updateFlags
164 ) const;
165
166
167 // NOLINTEND
168
169public:
170 // vftables
171 // NOLINTBEGIN
172 MCAPI static void** $vftable();
173 // NOLINTEND
174};
Definition AABB.h:18
Definition Actor.h:113
Definition BlockActor.h:29
Definition ActorInternalEvent.h:17
Definition BlockRandomTickEvent.h:16
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition FoliageBlock.h:21
Definition GetCollisionShapeInterface.h:13
Definition IConstBlockSource.h:25
Definition ItemInstance.h:15
Definition optional_ref.h:10
Definition CropParams.h:8