LeviLamina
Loading...
Searching...
No Matches
ComposterBlock.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
11// auto generated forward declare list
12// clang-format off
13class AABB;
14class BaseGameVersion;
15class Block;
16class BlockPos;
17class BlockSource;
18class Container;
20class HitResult;
22class ItemStack;
23class ItemStackBase;
24class Level;
25class Vec3;
26namespace BlockEvents { class BlockPlaceEvent; }
27namespace BlockEvents { class BlockPlayerInteractEvent; }
28namespace BlockEvents { class BlockQueuedTickEvent; }
29// clang-format on
30
31class ComposterBlock : public ::BlockType {
32public:
33 // ComposterBlock inner types define
34 enum class FillLevel : int {
35 Min = 0,
36 Max = 7,
37 Ready = 8,
38 Count = 9,
39 };
40
41public:
42 // prevent constructor by default
43 ComposterBlock();
44
45public:
46 // virtual functions
47 // NOLINTBEGIN
48 virtual void onRemove(::BlockSource& region, ::BlockPos const& pos) const /*override*/;
49
50 virtual void onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const /*override*/;
51
52 virtual bool isInteractiveBlock() const /*override*/;
53
54 virtual bool hasComparatorSignal() const /*override*/;
55
56 virtual int getComparatorSignal(::BlockSource& block, ::BlockPos const&, ::Block const&, uchar) const /*override*/;
57
58 virtual ::HitResult clip(
59 ::Block const& block,
60 ::BlockSource const& region,
61 ::BlockPos const& pos,
62 ::Vec3 const& A,
63 ::Vec3 const& B,
64 ::ShapeType shapeType,
66 ) const /*override*/;
67
68 virtual bool addCollisionShapes(
69 ::Block const& block,
70 ::IConstBlockSource const& region,
71 ::BlockPos const& pos,
72 ::AABB const* intersectTestBox,
73 ::std::vector<::AABB>& inoutBoxes,
75 ) const /*override*/;
76
77 virtual void addAABBs(
78 ::Block const& block,
79 ::IConstBlockSource const& region,
80 ::BlockPos const& pos,
81 ::AABB const* intersectTestBox,
82 ::std::vector<::AABB>& inoutBoxes
83 ) const /*override*/;
84
85 virtual bool canProvideSupport(::Block const& face, uchar type, ::BlockSupportType) const /*override*/;
86
87 virtual int getVariant(::Block const& block) const /*override*/;
88
89 virtual bool breaksFallingBlocks(::Block const& version, ::BaseGameVersion const) const /*override*/;
90 // NOLINTEND
91
92public:
93 // member functions
94 // NOLINTBEGIN
95 MCAPI ComposterBlock(::std::string const& nameId, int id);
96
97 MCAPI void _emitBoneMeal(::Level& region, ::BlockSource& pos, ::BlockPos const&) const;
98
99 MCAPI void onPlace(::BlockEvents::BlockPlaceEvent& eventData) const;
100
101 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
102
103 MCAPI void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
104 // NOLINTEND
105
106public:
107 // static functions
108 // NOLINTBEGIN
109 MCAPI static ::std::unordered_map<uint64, schar> const& _getCompostableItems();
110
111 MCAPI static bool addItem(
112 ::Container& fromContainer,
113 int slot,
114 ::ItemStack& item,
115 ::BlockSource& region,
116 ::Block const& block,
117 ::BlockPos const& pos
118 );
119
120 MCAPI static bool addItems(
121 ::Container& fromContainer,
122 int slot,
123 ::ItemStack& item,
124 int amount,
125 ::BlockSource& region,
126 ::Block const& block,
127 ::BlockPos const& pos
128 );
129
130 MCAPI static int
131 addItems(::ItemStack const& item, int amount, ::BlockSource& region, ::Block const& block, ::BlockPos const& pos);
132
133 MCAPI static void empty(::BlockSource& region, ::Block const& composter, ::BlockPos const& pos);
134
135 MCAPI static ::ItemStack extractItem(::BlockSource& region, ::Block const& composter, ::BlockPos const& pos);
136
137 MCAPI static ::Block const* getComposterAt(::BlockSource& region, ::BlockPos const& pos);
138
139 MCAPI static schar getFillChance(::ItemStackBase const& item);
140 // NOLINTEND
141
142public:
143 // static variables
144 // NOLINTBEGIN
145 MCAPI static ::BaseGameVersion const& COMPOSTER_DOESNT_BREAK_FALLING_BLOCK_VERSION();
146 // NOLINTEND
147
148public:
149 // constructor thunks
150 // NOLINTBEGIN
151 MCAPI void* $ctor(::std::string const& nameId, int id);
152 // NOLINTEND
153
154public:
155 // virtual function thunks
156 // NOLINTBEGIN
157 MCAPI void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
158
159 MCAPI void $onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const;
160
161 MCFOLD bool $isInteractiveBlock() const;
162
163 MCFOLD bool $hasComparatorSignal() const;
164
165 MCAPI int $getComparatorSignal(::BlockSource& block, ::BlockPos const&, ::Block const&, uchar) const;
166
167 MCFOLD ::HitResult $clip(
168 ::Block const& block,
169 ::BlockSource const& region,
170 ::BlockPos const& pos,
171 ::Vec3 const& A,
172 ::Vec3 const& B,
173 ::ShapeType shapeType,
175 ) const;
176
177 MCFOLD bool $addCollisionShapes(
178 ::Block const& block,
179 ::IConstBlockSource const& region,
180 ::BlockPos const& pos,
181 ::AABB const* intersectTestBox,
182 ::std::vector<::AABB>& inoutBoxes,
184 ) const;
185
186 MCAPI void $addAABBs(
187 ::Block const& block,
188 ::IConstBlockSource const& region,
189 ::BlockPos const& pos,
190 ::AABB const* intersectTestBox,
191 ::std::vector<::AABB>& inoutBoxes
192 ) const;
193
194 MCAPI bool $canProvideSupport(::Block const& face, uchar type, ::BlockSupportType) const;
195
196 MCFOLD int $getVariant(::Block const& block) const;
197
198 MCAPI bool $breaksFallingBlocks(::Block const& version, ::BaseGameVersion const) const;
199
200
201 // NOLINTEND
202
203public:
204 // vftables
205 // NOLINTBEGIN
206 MCAPI static void** $vftable();
207 // NOLINTEND
208};
Definition AABB.h:18
Definition BaseGameVersion.h:13
Definition BlockPlaceEvent.h:18
Definition BlockPlayerInteractEvent.h:20
Definition BlockQueuedTickEvent.h:18
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Block.h:69
Definition Container.h:34
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:19
Definition IConstBlockSource.h:24
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Level.h:255
Definition Vec3.h:10
Definition optional_ref.h:10