LeviLamina
Loading...
Searching...
No Matches
DecoratedPotBlockActor.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/item/ItemStack.h"
7#include "mc/world/level/block/actor/DecoratedPotAnimation.h"
8#include "mc/world/level/block/actor/RandomizableBlockActorContainer.h"
9
10// auto generated forward declare list
11// clang-format off
13class BlockPos;
14class BlockSource;
15class CompoundTag;
16class DataLoadHelper;
17class ILevel;
18class ItemStackBase;
19class Player;
20class SaveContext;
21// clang-format on
22
23class DecoratedPotBlockActor : public ::RandomizableBlockActorContainer {
24public:
25 // DecoratedPotBlockActor inner types define
26 enum class PotFace : uint64 {
27 Back = 0,
28 Left = 1,
29 Right = 2,
30 Front = 3,
31 };
32
33 using SherdList = ::std::array<::std::string, 4>;
34
35public:
36 // member variables
37 // NOLINTBEGIN
38 ::ll::TypedStorage<8, 128, ::std::array<::std::string, 4>> mSherdItemNames;
39 ::ll::TypedStorage<8, 152, ::ItemStack> mContainedItem;
40 ::ll::TypedStorage<1, 1, ::DecoratedPotAnimation> mAnimation;
41 ::ll::TypedStorage<4, 4, int> mAnimationTick;
42 // NOLINTEND
43
44public:
45 // prevent constructor by default
46 DecoratedPotBlockActor();
47
48public:
49 // virtual functions
50 // NOLINTBEGIN
51 virtual void load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
52
53 virtual bool save(::CompoundTag& tag, ::SaveContext const& saveContext) const /*override*/;
54
55 virtual void tick(::BlockSource& region) /*override*/;
56
57 virtual void serverInitItemStackIds(
58 int containerSlot,
59 int,
60 ::std::function<void(int, ::ItemStack const&)> onNetIdChanged
61 ) /*override*/;
62
63 virtual int getContainerSize() const /*override*/;
64
65 virtual int getMaxStackSize() const /*override*/;
66
67 virtual ::ItemStack const& getItem(int) const /*override*/;
68
69 virtual void setItem(int, ::ItemStack const& item) /*override*/;
70
71 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
72
73 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
74
75 virtual ~DecoratedPotBlockActor() /*override*/ = default;
76 // NOLINTEND
77
78public:
79 // member functions
80 // NOLINTBEGIN
81 MCAPI explicit DecoratedPotBlockActor(::BlockPos const& pos);
82
83 MCAPI void _onInsertFailFeedback(::BlockSource& region, ::Player& player);
84
85 MCAPI void _onInsertFeedback(::BlockSource& region, ::ItemStack const& newContainedItem, ::Player& player);
86
87 MCAPI void _setContainedItem(::ItemStack const& item);
88
89#ifdef LL_PLAT_C
90 MCAPI void fromItem(::ItemStack const& item);
91#endif
92
93 MCAPI void tryAddItem(::Player& player);
94 // NOLINTEND
95
96public:
97 // static functions
98 // NOLINTBEGIN
99 MCAPI static ::std::optional<::std::array<::std::string, 4>> _tryGetSherdsFromItem(::ItemStackBase const& item);
100
101#ifdef LL_PLAT_C
102 MCAPI static ::std::string getDelimitedConcatenatedSherdNames(::CompoundTag const* userData);
103#endif
104
105 MCAPI static void removeDefaultSherdsFromUserData(::ItemStackBase& itemInstance);
106
107#ifdef LL_PLAT_C
108 MCAPI static void
109 saveSherdsToItemForInventoryRendering(::ItemStack& itemInstance, ::std::string const& screenSherdNames);
110#endif
111
112 MCAPI static void
113 saveSherdsToTag(::CompoundTag& tag, ::std::array<::std::string, 4> const& sherds, bool forceSaveDefaultSherds);
114
115 MCAPI static ::std::optional<::std::array<::std::string, 4>> tryGetSherdsFromTag(::CompoundTag const& tag);
116 // NOLINTEND
117
118public:
119 // static variables
120 // NOLINTBEGIN
121 MCAPI static ::std::array<::std::string, 4> const& DEFAULT_SHERD_LIST();
122 // NOLINTEND
123
124public:
125 // constructor thunks
126 // NOLINTBEGIN
127 MCAPI void* $ctor(::BlockPos const& pos);
128 // NOLINTEND
129
130public:
131 // virtual function thunks
132 // NOLINTBEGIN
133 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
134
135 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
136
137 MCAPI void $tick(::BlockSource& region);
138
139 MCAPI void
140 $serverInitItemStackIds(int containerSlot, int, ::std::function<void(int, ::ItemStack const&)> onNetIdChanged);
141
142 MCFOLD int $getContainerSize() const;
143
144 MCFOLD int $getMaxStackSize() const;
145
146 MCFOLD ::ItemStack const& $getItem(int) const;
147
148 MCAPI void $setItem(int, ::ItemStack const& item);
149
150 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
151
152 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
153
154
155 // NOLINTEND
156
157public:
158 // vftables
159 // NOLINTBEGIN
160 MCAPI static void** $vftableForContainer();
161
162 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
163 // NOLINTEND
164};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:19
Definition BlockSource.h:71
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition ILevel.h:218
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Player.h:129
Definition RandomizableBlockActorContainer.h:16
Definition SaveContext.h:5