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& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const
57 /*override*/;
58
59 virtual ::HitResult clip(
60 ::Block const& block,
61 ::BlockSource const& region,
62 ::BlockPos const& pos,
63 ::Vec3 const& A,
64 ::Vec3 const& B,
65 ::ShapeType shapeType,
67 ) const /*override*/;
68
69 virtual bool addCollisionShapes(
70 ::Block const& block,
71 ::IConstBlockSource const& region,
72 ::BlockPos const& pos,
73 ::AABB const* intersectTestBox,
74 ::std::vector<::AABB>& inoutBoxes,
76 ) const /*override*/;
77
78 virtual void addAABBs(
79 ::Block const& block,
80 ::IConstBlockSource const& region,
81 ::BlockPos const& pos,
82 ::AABB const* intersectTestBox,
83 ::std::vector<::AABB>& inoutBoxes
84 ) const /*override*/;
85
86 virtual bool canProvideSupport(::Block const&, uchar face, ::BlockSupportType type) const /*override*/;
87
88 virtual int getVariant(::Block const& block) const /*override*/;
89
90 virtual bool breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const /*override*/;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCAPI ComposterBlock(::std::string const& nameId, int id);
97
98 MCAPI void _emitBoneMeal(::Level&, ::BlockSource& region, ::BlockPos const& pos) const;
99
100 MCAPI void onPlace(::BlockEvents::BlockPlaceEvent& eventData) const;
101
102 MCAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
103
104 MCAPI void use(::BlockEvents::BlockPlayerInteractEvent& eventData) const;
105 // NOLINTEND
106
107public:
108 // static functions
109 // NOLINTBEGIN
110 MCAPI static ::std::unordered_map<uint64, schar> const& _getCompostableItems();
111
112 MCAPI static bool addItems(
113 ::Container& fromContainer,
114 int slot,
115 ::ItemStack& item,
116 int amount,
117 ::BlockSource& region,
118 ::Block const& block,
119 ::BlockPos const& pos
120 );
121
122 MCAPI static int
123 addItems(::ItemStack const& item, int amount, ::BlockSource& region, ::Block const& block, ::BlockPos const& pos);
124
125 MCAPI static void empty(::BlockSource& region, ::Block const& composter, ::BlockPos const& pos);
126
127 MCAPI static ::ItemStack extractItem(::BlockSource& region, ::Block const& composter, ::BlockPos const& pos);
128
129 MCAPI static schar getFillChance(::ItemStackBase const& item);
130 // NOLINTEND
131
132public:
133 // static variables
134 // NOLINTBEGIN
135 MCAPI static ::BaseGameVersion const& COMPOSTER_DOESNT_BREAK_FALLING_BLOCK_VERSION();
136 // NOLINTEND
137
138public:
139 // constructor thunks
140 // NOLINTBEGIN
141 MCAPI void* $ctor(::std::string const& nameId, int id);
142 // NOLINTEND
143
144public:
145 // virtual function thunks
146 // NOLINTBEGIN
147 MCAPI void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
148
149 MCAPI void $onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const;
150
151 MCFOLD bool $isInteractiveBlock() const;
152
153 MCFOLD bool $hasComparatorSignal() const;
154
155 MCAPI int $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
156
157 MCFOLD ::HitResult $clip(
158 ::Block const& block,
159 ::BlockSource const& region,
160 ::BlockPos const& pos,
161 ::Vec3 const& A,
162 ::Vec3 const& B,
163 ::ShapeType shapeType,
165 ) const;
166
167 MCFOLD bool $addCollisionShapes(
168 ::Block const& block,
169 ::IConstBlockSource const& region,
170 ::BlockPos const& pos,
171 ::AABB const* intersectTestBox,
172 ::std::vector<::AABB>& inoutBoxes,
174 ) const;
175
176 MCAPI void $addAABBs(
177 ::Block const& block,
178 ::IConstBlockSource const& region,
179 ::BlockPos const& pos,
180 ::AABB const* intersectTestBox,
181 ::std::vector<::AABB>& inoutBoxes
182 ) const;
183
184 MCAPI bool $canProvideSupport(::Block const&, uchar face, ::BlockSupportType type) const;
185
186 MCFOLD int $getVariant(::Block const& block) const;
187
188 MCAPI bool $breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const;
189
190
191 // NOLINTEND
192
193public:
194 // vftables
195 // NOLINTBEGIN
196 MCAPI static void** $vftable();
197 // NOLINTEND
198};
Definition AABB.h:18
Definition BaseGameVersion.h:8
Definition BlockPlaceEvent.h:16
Definition BlockPlayerInteractEvent.h:18
Definition BlockQueuedTickEvent.h:16
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition Container.h:35
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:18
Definition IConstBlockSource.h:25
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Level.h:254
Definition Vec3.h:10
Definition optional_ref.h:10