Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI ComposterBlock(::std::string const& nameId, int id);
97
98 MCNAPI void _emitBoneMeal(::Level&, ::BlockSource& region, ::BlockPos const& pos) const;
99
100 MCNAPI void onPlace(::BlockEvents::BlockPlaceEvent& eventData) const;
101
102 MCNAPI void tick(::BlockEvents::BlockQueuedTickEvent& eventData) const;
103
104 MCNAPI 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 MCNAPI 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 MCNAPI static int
123 addItems(::ItemStack const& item, int amount, ::BlockSource& region, ::Block const& block, ::BlockPos const& pos);
124
125 MCNAPI static void empty(::BlockSource& region, ::Block const& composter, ::BlockPos const& pos);
126
127 MCNAPI 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 MCNAPI static ::BaseGameVersion const& COMPOSTER_DOESNT_BREAK_FALLING_BLOCK_VERSION();
136 // NOLINTEND
137
138public:
139 // constructor thunks
140 // NOLINTBEGIN
141 MCNAPI void* $ctor(::std::string const& nameId, int id);
142 // NOLINTEND
143
144public:
145 // virtual function thunks
146 // NOLINTBEGIN
147 MCNAPI void $onRemove(::BlockSource& region, ::BlockPos const& pos) const;
148
149 MCNAPI void $onMove(::BlockSource& region, ::BlockPos const& from, ::BlockPos const& to) const;
150
151 MCNAPI bool $isInteractiveBlock() const;
152
153 MCNAPI bool $hasComparatorSignal() const;
154
155 MCNAPI int
156 $getComparatorSignal(::BlockSource& region, ::BlockPos const& pos, ::Block const& block, uchar dir) const;
157
158 MCNAPI ::HitResult $clip(
159 ::Block const& block,
160 ::BlockSource const& region,
161 ::BlockPos const& pos,
162 ::Vec3 const& A,
163 ::Vec3 const& B,
164 ::ShapeType shapeType,
166 ) const;
167
169 ::Block const& block,
170 ::IConstBlockSource const& region,
171 ::BlockPos const& pos,
172 ::AABB const* intersectTestBox,
173 ::std::vector<::AABB>& inoutBoxes,
175 ) const;
176
177 MCNAPI void $addAABBs(
178 ::Block const& block,
179 ::IConstBlockSource const& region,
180 ::BlockPos const& pos,
181 ::AABB const* intersectTestBox,
182 ::std::vector<::AABB>& inoutBoxes
183 ) const;
184
185 MCNAPI bool $canProvideSupport(::Block const&, uchar face, ::BlockSupportType type) const;
186
187 MCNAPI int $getVariant(::Block const& block) const;
188
189 MCNAPI bool $breaksFallingBlocks(::Block const& block, ::BaseGameVersion const version) const;
190
191
192 // NOLINTEND
193
194public:
195 // vftables
196 // NOLINTBEGIN
197 MCNAPI static void** $vftable();
198 // NOLINTEND
199};
Definition AABB.h:18
Definition BaseGameVersion.h:8
Definition BlockPlaceEvent.h:16
Definition BlockPlayerInteractEvent.h:18
Definition BlockQueuedTickEvent.h:16
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Block.h:42
static MCAPI bool addItems(::Container &fromContainer, int slot, ::ItemStack &item, int amount, ::BlockSource &region, ::Block const &block, ::BlockPos const &pos)
MCAPI::HitResult $clip(::Block const &block, ::BlockSource const &region, ::BlockPos const &pos, ::Vec3 const &A, ::Vec3 const &B, ::ShapeType shapeType, ::optional_ref<::GetCollisionShapeInterface const > entity) const
static MCAPI ::BaseGameVersion const & COMPOSTER_DOESNT_BREAK_FALLING_BLOCK_VERSION()
MCAPI void * $ctor(::std::string const &nameId, int id)
MCAPI int $getVariant(::Block const &block) const
MCAPI bool $breaksFallingBlocks(::Block const &block, ::BaseGameVersion const version) const
static MCAPI void ** $vftable()
MCAPI void $onRemove(::BlockSource &region, ::BlockPos const &pos) const
MCAPI ComposterBlock(::std::string const &nameId, int id)
MCAPI bool $addCollisionShapes(::Block const &block, ::IConstBlockSource const &region, ::BlockPos const &pos, ::AABB const *intersectTestBox, ::std::vector<::AABB > &inoutBoxes, ::optional_ref<::GetCollisionShapeInterface const > entity) const
static MCAPI void empty(::BlockSource &region, ::Block const &composter, ::BlockPos const &pos)
MCAPI int $getComparatorSignal(::BlockSource &region, ::BlockPos const &pos, ::Block const &block, uchar dir) const
static MCAPI int addItems(::ItemStack const &item, int amount, ::BlockSource &region, ::Block const &block, ::BlockPos const &pos)
MCAPI void $addAABBs(::Block const &block, ::IConstBlockSource const &region, ::BlockPos const &pos, ::AABB const *intersectTestBox, ::std::vector<::AABB > &inoutBoxes) const
MCAPI void _emitBoneMeal(::Level &, ::BlockSource &region, ::BlockPos const &pos) const
MCAPI void onPlace(::BlockEvents::BlockPlaceEvent &eventData) const
MCAPI void tick(::BlockEvents::BlockQueuedTickEvent &eventData) const
MCAPI void use(::BlockEvents::BlockPlayerInteractEvent &eventData) const
MCAPI void $onMove(::BlockSource &region, ::BlockPos const &from, ::BlockPos const &to) const
MCAPI bool $isInteractiveBlock() const
MCAPI bool $canProvideSupport(::Block const &, uchar face, ::BlockSupportType type) const
static MCAPI ::ItemStack extractItem(::BlockSource &region, ::Block const &composter, ::BlockPos const &pos)
MCAPI bool $hasComparatorSignal() const
Definition Container.h:36
Definition GetCollisionShapeInterface.h:13
Definition HitResult.h:18
Definition IConstBlockSource.h:25
Definition ItemStackBase.h:45
Definition ItemStack.h:26
Definition Level.h:255
Definition Vec3.h:10
Definition optional_ref.h:10