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 ::ItemStack const& getItem(int slot) 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 bool canBurn(::Recipes const& recipes);
141
142 MCAPI void checkForAlternativeFuelAchievement(::BlockSource& region, ::ItemStack const& item);
143
144 MCAPI void checkForSmeltEverythingAchievement(::BlockSource& region);
145
146 MCAPI bool isEmptiedByHopper(::BlockSource& region);
147
148 MCAPI void onFurnaceBlockRemoved(::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 bool isItemAllowedInFuelSlot(int slot, ::ItemStackBase const& item, int amount);
165 // NOLINTEND
166
167public:
168 // static variables
169 // NOLINTBEGIN
170 MCAPI static ::std::string const& BURN_DURATION_KEY();
171
172 MCAPI static ::std::string const& BURN_TIME_KEY();
173
174 MCAPI static ::std::string const& COOK_TIME_KEY();
175
176 MCAPI static ::std::string const& FILTERED_CUSTOM_NAME_KEY();
177
178 MCAPI static ::std::string const& ITEMS_LIST_KEY();
179
180 MCAPI static ::std::string const& LAST_FUEL_KEY();
181
182 MCAPI static ::std::string const& SLOT_KEY();
183
184 MCAPI static ::std::string const& STORED_XP_DEPRECATED_KEY();
185
186 MCAPI static ::std::string const& STORED_XP_KEY();
187 // NOLINTEND
188
189public:
190 // constructor thunks
191 // NOLINTBEGIN
192 MCAPI void* $ctor(
193 ::BlockActorType blockActorType,
194 ::BlockPos const& pos,
195 ::HashedString const& recipeTag,
196 ::SharedTypes::Legacy::LevelSoundEvent smeltSound,
197 ::SharedTypes::Legacy::ContainerType containerType,
198 int burnInterval,
199 ::Block const& unlitFurnace,
200 ::Block const& litFurnace
201 );
202 // NOLINTEND
203
204public:
205 // destructor thunk
206 // NOLINTBEGIN
207 MCAPI void $dtor();
208 // NOLINTEND
209
210public:
211 // virtual function thunks
212 // NOLINTBEGIN
213 MCFOLD ::ItemStack const& $getItem(int slot) const;
214
215 MCAPI void $setItem(int slot, ::ItemStack const& item);
216
217 MCAPI ::std::string $getName() const;
218
219 MCFOLD int $getMaxStackSize() const;
220
221 MCFOLD int $getContainerSize() const;
222
223 MCFOLD void $onRemoved(::BlockSource&);
224
225 MCAPI void $startOpen(::Actor& actor);
226
227 MCAPI void $stopOpen(::Actor& actor);
228
229 MCAPI bool $canPushInItem(int slot, int face, ::ItemStack const& item) const;
230
231 MCAPI bool $canPullOutItem(int slot, int face, ::ItemStack const& item) const;
232
233 MCFOLD ::Container* $getContainer();
234
235 MCFOLD ::Container const* $getContainer() const;
236
237 MCAPI void $load(::ILevel& level, ::CompoundTag const& base, ::DataLoadHelper& dataLoadHelper);
238
239 MCAPI void $onCustomTagLoadDone(::BlockSource& region);
240
241 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
242
243 MCAPI void $tick(::BlockSource& region);
244
245 MCAPI void $onNeighborChanged(::BlockSource& region, ::BlockPos const& position);
246
247 MCFOLD void $onMove();
248
249 MCAPI void $serverInitItemStackIds(
250 int containerSlot,
251 int count,
252 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
253 );
254
255 MCAPI void $fixupOnLoad(::LevelChunk& lc);
256
257 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource& region);
258
259 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
260
261
262 // NOLINTEND
263
264public:
265 // vftables
266 // NOLINTBEGIN
268
269 MCAPI static void** $vftableForBlockActor();
270
272
273 MCNAPI static void** $vftable();
274
276 // NOLINTEND
277};
Definition Actor.h:114
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
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:220
Definition ItemStackBase.h:44
Definition ItemStack.h:24
Definition Item.h:71
Definition LevelChunk.h:75
Definition Recipes.h:35
Definition SaveContext.h:5
static MCAPI void ** $vftableForBlockActor()