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/BlockActor.h"
14#include "mc/world/level/block/actor/BlockActorType.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 ::BlockActor, 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 ::ItemStack const& getItem(int index) const /*override*/;
76
77 virtual void setItem(int slot, ::ItemStack const& item) /*override*/;
78
79 virtual ::std::string getName() const /*override*/;
80
81 virtual int getMaxStackSize() const /*override*/;
82
83 virtual int getContainerSize() const /*override*/;
84
85 virtual void onRemoved(::BlockSource&) /*override*/;
86
87 virtual void startOpen(::Actor& actor) /*override*/;
88
89 virtual void stopOpen(::Actor& actor) /*override*/;
90
91 virtual bool canPushInItem(int slot, int face, ::ItemStack const& item) const /*override*/;
92
93 virtual bool canPullOutItem(int slot, int face, ::ItemStack const& item) const /*override*/;
94
95 virtual ::Container* getContainer() /*override*/;
96
97 virtual ::Container const* getContainer() const /*override*/;
98
99 virtual void load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper) /*override*/;
100
101 virtual void onCustomTagLoadDone(::BlockSource& region) /*override*/;
102
103 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
104
105 virtual void tick(::BlockSource& region) /*override*/;
106
107 virtual void onNeighborChanged(::BlockSource& region, ::BlockPos const& position) /*override*/;
108
109 virtual void onMove() /*override*/;
110
111 virtual void serverInitItemStackIds(
112 int containerSlot,
113 int count,
114 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
115 ) /*override*/;
116
117 virtual void fixupOnLoad(::LevelChunk& lc) /*override*/;
118
119 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource& region) /*override*/;
120
121 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
122
123 virtual ~FurnaceBlockActor() /*override*/;
124 // NOLINTEND
125
126public:
127 // member functions
128 // NOLINTBEGIN
129 MCAPI FurnaceBlockActor(
130 ::BlockActorType blockActorType,
131 ::BlockPos const& pos,
132 ::HashedString const& recipeTag,
133 ::SharedTypes::Legacy::LevelSoundEvent smeltSound,
134 ::SharedTypes::Legacy::ContainerType containerType,
135 int burnInterval,
136 ::Block const& unlitFurnace,
137 ::Block const& litFurnace
138 );
139
140 MCAPI void _tryBroadcastBurnSound(::BlockSource& region);
141
142 MCAPI void burn(::Recipes const& recipes);
143
144 MCAPI bool canBurn(::Recipes const& recipes);
145
146 MCAPI void checkForAlternativeFuelAchievement(::BlockSource& region, ::ItemStack const& item);
147
148 MCAPI void checkForSmeltEverythingAchievement(::BlockSource& region);
149
150 MCAPI int withdrawStoredXPReward();
151 // NOLINTEND
152
153public:
154 // static functions
155 // NOLINTBEGIN
156 MCAPI static float _getXPRewardMultiplier(::ItemStackBase const& item);
157
158 MCAPI static int getAvailableFuelSetCount(int slot, ::ItemStackBase const& item);
159
160 MCAPI static float getBurnDuration(::ItemStackBase const& itemInstance, float burnInterval);
161
162 MCAPI static float getItemBurnDuration(::Item const& item, float burnInterval);
163
164 MCAPI static int getXPRewardFromSmeltingItems(::ItemStackBase const& item, int numItemsSmelted);
165
166 MCAPI_C static bool isItemAllowedInFuelSlot(int slot, ::ItemStackBase const& item, int amount);
167 // NOLINTEND
168
169public:
170 // static variables
171 // NOLINTBEGIN
172 MCAPI static ::std::string const& BURN_DURATION_KEY();
173
174 MCAPI static int const& BURN_INTERVAL();
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& CUSTOM_NAME_KEY();
181
182 MCAPI static float const& DEFAULT_SMELTING_TIME();
183
184 MCAPI static ::std::string const& FILTERED_CUSTOM_NAME_KEY();
185
186 MCAPI static ::std::string const& ITEMS_LIST_KEY();
187
188 MCAPI static ::std::string const& LAST_FUEL_KEY();
189
190 MCAPI static ::std::string const& SLOT_KEY();
191
192 MCAPI static ::std::string const& STORED_XP_DEPRECATED_KEY();
193
194 MCAPI static ::std::string const& STORED_XP_KEY();
195 // NOLINTEND
196
197public:
198 // constructor thunks
199 // NOLINTBEGIN
200 MCAPI void* $ctor(
201 ::BlockActorType blockActorType,
202 ::BlockPos const& pos,
203 ::HashedString const& recipeTag,
204 ::SharedTypes::Legacy::LevelSoundEvent smeltSound,
205 ::SharedTypes::Legacy::ContainerType containerType,
206 int burnInterval,
207 ::Block const& unlitFurnace,
208 ::Block const& litFurnace
209 );
210 // NOLINTEND
211
212public:
213 // destructor thunk
214 // NOLINTBEGIN
215 MCAPI void $dtor();
216 // NOLINTEND
217
218public:
219 // virtual function thunks
220 // NOLINTBEGIN
221 MCFOLD ::ItemStack const& $getItem(int index) const;
222
223 MCAPI void $setItem(int slot, ::ItemStack const& item);
224
225 MCAPI ::std::string $getName() const;
226
227 MCFOLD int $getMaxStackSize() const;
228
229 MCFOLD int $getContainerSize() const;
230
231 MCFOLD void $onRemoved(::BlockSource&);
232
233 MCAPI void $startOpen(::Actor& actor);
234
235 MCAPI void $stopOpen(::Actor& actor);
236
237 MCAPI bool $canPushInItem(int slot, int face, ::ItemStack const& item) const;
238
239 MCAPI bool $canPullOutItem(int slot, int face, ::ItemStack const& item) const;
240
241 MCFOLD ::Container* $getContainer();
242
243 MCFOLD ::Container const* $getContainer() const;
244
245 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
246
247 MCAPI void $onCustomTagLoadDone(::BlockSource& region);
248
249 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
250
251 MCAPI void $tick(::BlockSource& region);
252
253 MCAPI void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
254
255 MCFOLD void $onMove();
256
257 MCAPI void $serverInitItemStackIds(
258 int containerSlot,
259 int count,
260 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
261 );
262
263 MCAPI void $fixupOnLoad(::LevelChunk& lc);
264
265 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
266
267 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
268
269
270 // NOLINTEND
271
272public:
273 // vftables
274 // NOLINTBEGIN
275 MCAPI static void** $vftableForContainer();
276
277 MCAPI static void** $vftableForBlockActor();
278 // NOLINTEND
279};
Definition Actor.h:105
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition Block.h:43
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition HashedString.h:5
Definition ILevel.h:214
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Item.h:69
Definition LevelChunk.h:79
Definition Recipes.h:35
Definition SaveContext.h:5