LeviLamina
Loading...
Searching...
No Matches
FurnaceBlockActor.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/shared_types/legacy/ContainerType.h"
8#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
9#include "mc/legacy/ActorUniqueID.h"
10#include "mc/world/Container.h"
11#include "mc/world/item/ItemInstance.h"
12#include "mc/world/item/ItemStack.h"
13#include "mc/world/level/block/actor/BlockActorType.h"
14#include "mc/world/level/block/actor/VanillaBlockActor.h"
15
16// auto generated forward declare list
17// clang-format off
18class Actor;
19class Block;
21class BlockPos;
22class BlockSource;
23class CompoundTag;
24class DataLoadHelper;
25class ILevel;
26class Item;
27class ItemStackBase;
28class LevelChunk;
29class Recipes;
30class SaveContext;
31// clang-format on
32
33class FurnaceBlockActor : public ::VanillaBlockActor, public ::Container {
34public:
35 // FurnaceBlockActor inner types define
36 enum : int {
37 SlotIngredient = 0,
38 SlotFuel = 1,
39 SlotResult = 2,
40 NumItems = 3,
41 };
42
43public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<4, 4, int> mLitTime;
47 ::ll::TypedStorage<4, 4, int> mLitDuration;
48 ::ll::TypedStorage<4, 4, int> mCookingProgress;
49 ::ll::TypedStorage<4, 4, uint> mStoredXP;
50 ::ll::TypedStorage<8, 456, ::ItemStack[3]> mItems;
51 ::ll::TypedStorage<1, 3, bool[3]> mDirty;
52 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorUniqueID>> mActors;
53 ::ll::TypedStorage<8, 48, ::HashedString const> mRecipeTag;
54 ::ll::TypedStorage<4, 4, int const> mBurnInterval;
55 ::ll::TypedStorage<1, 1, bool> mOpenByLocalPlayer;
56 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mSmeltSoundEvent;
57 ::ll::TypedStorage<4, 4, int> mSoundTick;
58 ::ll::TypedStorage<4, 4, int> mSoundTickTarget;
59 ::ll::TypedStorage<8, 8, ::Block const&> mUnlitFurnace;
60 ::ll::TypedStorage<8, 8, ::Block const&> mLitFurnace;
61 ::ll::TypedStorage<8, 128, ::ItemInstance> mLastFuelItem;
62 ::ll::TypedStorage<1, 1, bool> mNoDrop;
63 ::ll::TypedStorage<1, 1, bool> mNeedsLitStateFixup;
64 // NOLINTEND
65
66public:
67 // prevent constructor by default
68 FurnaceBlockActor& operator=(FurnaceBlockActor const&);
69 FurnaceBlockActor(FurnaceBlockActor const&);
70 FurnaceBlockActor();
71
72public:
73 // virtual functions
74 // NOLINTBEGIN
75 virtual bool isTypeOrDerived(::BlockActorType type) const /*override*/;
76
77 virtual ::ItemStack const& getItem(int slot) const /*override*/;
78
79 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
80
81 virtual ::std::string getName() const /*override*/;
82
83 virtual int getMaxStackSize() const /*override*/;
84
85 virtual int getContainerSize() const /*override*/;
86
87 virtual void onRemoved(::BlockSource&) /*override*/;
88
89 virtual void startOpen(::Actor& actor) /*override*/;
90
91 virtual void stopOpen(::Actor& actor) /*override*/;
92
93 virtual bool canPushInItem(int slot, int face, ::ItemStack const& item) const /*override*/;
94
95 virtual bool canPullOutItem(int slot, int face, ::ItemStack const& item) const /*override*/;
96
97 virtual ::Container* getContainer() /*override*/;
98
99 virtual ::Container const* getContainer() const /*override*/;
100
101 virtual void load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper) /*override*/;
102
103 virtual void onCustomTagLoadDone(::BlockSource& region) /*override*/;
104
105 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
106
107 virtual void tick(::BlockSource& region) /*override*/;
108
109 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const& position) /*override*/;
110
111 virtual void onMove() /*override*/;
112
113 virtual void serverInitItemStackIds(
114 int containerSlot,
115 int count,
116 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
117 ) /*override*/;
118
119 virtual void fixupOnLoad(::LevelChunk& lc) /*override*/;
120
121 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region) /*override*/;
122
123 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
124
125 virtual ~FurnaceBlockActor() /*override*/;
126 // NOLINTEND
127
128public:
129 // member functions
130 // NOLINTBEGIN
131 MCAPI FurnaceBlockActor(
132 ::BlockActorType blockActorType,
133 ::BlockPos const& pos,
134 ::HashedString const& recipeTag,
135 ::SharedTypes::Legacy::LevelSoundEvent smeltSound,
136 ::SharedTypes::Legacy::ContainerType containerType,
137 int burnInterval,
138 ::Block const& unlitFurnace,
139 ::Block const& litFurnace
140 );
141
142 MCAPI bool canBurn(::Recipes const& recipes);
143
144 MCAPI void checkForAlternativeFuelAchievement(::BlockSource& region, ::ItemStack const& item);
145
146 MCAPI void checkForSmeltEverythingAchievement(::BlockSource& region);
147
148 MCAPI bool isEmptiedByHopper(::BlockSource& region);
149
150 MCAPI void onFurnaceBlockRemoved(::BlockSource& region);
151
152 MCAPI int withdrawStoredXPReward();
153 // NOLINTEND
154
155public:
156 // static functions
157 // NOLINTBEGIN
158 MCAPI static float _getXPRewardMultiplier(::ItemStackBase const& item);
159
160 MCAPI static int getAvailableFuelSetCount(int slot, ::ItemStackBase const& item);
161
162 MCAPI static float getBurnDuration(::ItemStackBase const& itemInstance, float burnInterval);
163
164 MCAPI static float getItemBurnDuration(::Item const& item, float burnInterval);
165
166 MCAPI static int getXPRewardFromSmeltingItems(::ItemStackBase const& item, int numItemsSmelted);
167
168 MCAPI static bool isItemAllowedInFuelSlot(int slot, ::ItemStackBase const& item, int amount);
169 // NOLINTEND
170
171public:
172 // static variables
173 // NOLINTBEGIN
174 MCAPI static ::std::string const& BURN_DURATION_KEY();
175
176 MCAPI static ::std::string const& BURN_TIME_KEY();
177
178 MCAPI static ::std::string const& COOK_TIME_KEY();
179
180 MCAPI static ::std::string const& FILTERED_CUSTOM_NAME_KEY();
181
182 MCAPI static ::std::string const& ITEMS_LIST_KEY();
183
184 MCAPI static ::std::string const& LAST_FUEL_KEY();
185
186 MCAPI static ::std::string const& SLOT_KEY();
187
188 MCAPI static ::std::string const& STORED_XP_DEPRECATED_KEY();
189
190 MCAPI static ::std::string const& STORED_XP_KEY();
191 // NOLINTEND
192
193public:
194 // constructor thunks
195 // NOLINTBEGIN
196 MCAPI void* $ctor(
197 ::BlockActorType blockActorType,
198 ::BlockPos const& pos,
199 ::HashedString const& recipeTag,
200 ::SharedTypes::Legacy::LevelSoundEvent smeltSound,
201 ::SharedTypes::Legacy::ContainerType containerType,
202 int burnInterval,
203 ::Block const& unlitFurnace,
204 ::Block const& litFurnace
205 );
206 // NOLINTEND
207
208public:
209 // destructor thunk
210 // NOLINTBEGIN
211 MCAPI void $dtor();
212 // NOLINTEND
213
214public:
215 // virtual function thunks
216 // NOLINTBEGIN
217 MCAPI bool $isTypeOrDerived(::BlockActorType type) const;
218
219 MCFOLD ::ItemStack const& $getItem(int slot) const;
220
221 MCAPI void $setItem(int slot, ::ItemStack const& item);
222
223 MCAPI ::std::string $getName() const;
224
225 MCFOLD int $getMaxStackSize() const;
226
227 MCFOLD int $getContainerSize() const;
228
229 MCFOLD void $onRemoved(::BlockSource&);
230
231 MCAPI void $startOpen(::Actor& actor);
232
233 MCAPI void $stopOpen(::Actor& actor);
234
235 MCAPI bool $canPushInItem(int slot, int face, ::ItemStack const& item) const;
236
237 MCAPI bool $canPullOutItem(int slot, int face, ::ItemStack const& item) const;
238
239 MCFOLD ::Container* $getContainer();
240
241 MCFOLD ::Container const* $getContainer() const;
242
243 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
244
245 MCAPI void $onCustomTagLoadDone(::BlockSource& region);
246
247 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
248
249 MCAPI void $tick(::BlockSource& region);
250
251 MCAPI void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
252
253 MCFOLD void $onMove();
254
255 MCAPI void $serverInitItemStackIds(
256 int containerSlot,
257 int count,
258 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
259 );
260
261 MCAPI void $fixupOnLoad(::LevelChunk& lc);
262
263 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
264
265 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
266
267
268 // NOLINTEND
269
270public:
271 // vftables
272 // NOLINTBEGIN
274
275 MCAPI static void** $vftableForBlockActor();
276
278
279 MCNAPI static void** $vftable();
280
282 // NOLINTEND
283};
Definition Actor.h:113
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
static MCAPI void ** $vftableForIVanillaMainBlockActorComponent()
static MCAPI void ** $vftable()
static MCAPI void ** $vftableForIVanillaTickBlockActorComponent()
static MCAPI void ** $vftableForIVanillaRenderBlockActorComponent()
Definition HashedString.h:5
Definition ILevel.h:221
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Item.h:71
Definition LevelChunk.h:77
Definition Recipes.h:37
Definition SaveContext.h:5