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