LeviLamina
Loading...
Searching...
No Matches
CrafterBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/level/block/actor/DispenserBlockActor.h"
7
8// auto generated forward declare list
9// clang-format off
11class BlockPos;
12class BlockSource;
13class CompoundTag;
15class DataLoadHelper;
16class ILevel;
17class ItemInstance;
18class ItemStack;
19class Level;
20class Recipe;
21class SaveContext;
22// clang-format on
23
24class CrafterBlockActor : public ::DispenserBlockActor {
25public:
26 // CrafterBlockActor inner types declare
27 // clang-format off
28 class LruCache;
29 // clang-format on
30
31 // CrafterBlockActor inner types define
32 class LruCache {
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 24, ::std::vector<uint64>> mRecencyOrderedIndexes;
37 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::CraftingContainer, ::std::vector<::ItemInstance>>>>
38 mCachedValues;
39 // NOLINTEND
40 };
41
42public:
43 // member variables
44 // NOLINTBEGIN
45 ::ll::TypedStorage<4, 4, ::std::bitset<9>> mDisabledSlots;
46 ::ll::TypedStorage<8, 48, ::CrafterBlockActor::LruCache> mCraftedRecipesCache;
47 ::ll::TypedStorage<4, 4, int> mTicksLeftInCraftingState;
48 // NOLINTEND
49
50public:
51 // prevent constructor by default
52 CrafterBlockActor();
53
54public:
55 // virtual functions
56 // NOLINTBEGIN
57 virtual ::std::string getName() const /*override*/;
58
59 virtual bool canPushInItem(int slot, int item, ::ItemStack const&) const /*override*/;
60
61 virtual bool isSlotDisabled(int slot) const /*override*/;
62
63 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
64
65 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
66
67 virtual void tick(::BlockSource& region) /*override*/;
68
69 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
70
71 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource&) /*override*/;
72 // NOLINTEND
73
74public:
75 // member functions
76 // NOLINTBEGIN
77 MCAPI explicit CrafterBlockActor(::BlockPos pos);
78
79#ifdef LL_PLAT_C
80 MCAPI ::std::bitset<9> const& getDisabledSlots() const;
81#endif
82
83 MCAPI int getDisabledSlotsCount() const;
84
85 MCAPI void onDisabledSlotToggleRequested(::BlockSource& region, int slot, bool shouldDisable);
86
87 MCAPI void setToCraftingVisualState(::BlockSource& region);
88
89 MCAPI bool tryMoveItemsIntoContainer(::BlockSource& region, ::std::vector<::ItemInstance>& items);
90
91 MCAPI void unsetCraftingVisualState(::BlockSource& region);
92 // NOLINTEND
93
94public:
95 // static functions
96 // NOLINTBEGIN
97 MCAPI static ::std::vector<::Recipe const*>
98 _getRecipesForCraftingGrid(::Level& level, ::CraftingContainer& craftingContainer);
99
100 MCAPI static ::std::vector<::ItemInstance> getCraftableItem(::CraftingContainer& craftingGrid, ::Level& level);
101 // NOLINTEND
102
103public:
104 // constructor thunks
105 // NOLINTBEGIN
106 MCAPI void* $ctor(::BlockPos pos);
107 // NOLINTEND
108
109public:
110 // virtual function thunks
111 // NOLINTBEGIN
112 MCAPI ::std::string $getName() const;
113
114 MCAPI bool $canPushInItem(int slot, int item, ::ItemStack const&) const;
115
116 MCAPI bool $isSlotDisabled(int slot) const;
117
118 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
119
120 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
121
122 MCAPI void $tick(::BlockSource& region);
123
124 MCAPI ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
125
126 MCAPI void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource&);
127
128
129 // NOLINTEND
130
131public:
132 // vftables
133 // NOLINTBEGIN
134 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
135
136 MCAPI static void** $vftableForContainer();
137 // NOLINTEND
138};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition CrafterBlockActor.h:32
Definition CraftingContainer.h:14
Definition DataLoadHelper.h:20
Definition ILevel.h:219
Definition ItemInstance.h:15
Definition ItemStack.h:35
Definition Level.h:255
Definition Recipe.h:32
Definition SaveContext.h:5
STL namespace.