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 onNetIdChanged,
60 ::std::function<void(int, ::ItemStack const&)>
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 item, ::ItemStack const&) /*override*/;
70
71 virtual ::std::unique_ptr<::BlockActorDataPacket> _getUpdatePacket(::BlockSource&) /*override*/;
72
73 virtual void _onUpdatePacket(::CompoundTag const& data, ::BlockSource& region) /*override*/;
74 // NOLINTEND
75
76public:
77 // member functions
78 // NOLINTBEGIN
79 MCAPI explicit DecoratedPotBlockActor(::BlockPos const& pos);
80
81 MCAPI void _onInsertFailFeedback(::BlockSource& region, ::Player& player);
82
83 MCAPI void _onInsertFeedback(::BlockSource& region, ::ItemStack const& newContainedItem, ::Player& player);
84
85 MCAPI void _setContainedItem(::ItemStack const& item);
86
87#ifdef LL_PLAT_C
88 MCAPI void fromItem(::ItemStack const& item);
89
90 MCFOLD ::DecoratedPotAnimation getAnimation() const;
91
92 MCAPI float getAnimationProgress(float frameAlpha) const;
93#endif
94
95 MCFOLD ::std::array<::std::string, 4> const& getSherdNames() const;
96
97 MCAPI void tryAddItem(::Player& player);
98 // NOLINTEND
99
100public:
101 // static functions
102 // NOLINTBEGIN
103 MCAPI static bool _areDefaultSherds(::std::array<::std::string, 4> const& sherds);
104
105#ifdef LL_PLAT_C
106 MCAPI static ::std::string getDelimitedConcatenatedSherdNames(::CompoundTag const* userData);
107#endif
108
109 MCAPI static void removeDefaultSherdsFromUserData(::ItemStackBase& itemInstance);
110
111#ifdef LL_PLAT_C
112 MCAPI static void
113 saveSherdsToItemForInventoryRendering(::ItemStack& itemInstance, ::std::string const& screenSherdNames);
114#endif
115
116 MCAPI static void
117 saveSherdsToTag(::CompoundTag& tag, ::std::array<::std::string, 4> const& sherds, bool forceSaveDefaultSherds);
118
119 MCAPI static ::DecoratedPotBlockActor* tryGet(::BlockSource& region, ::BlockPos const& pos);
120
121 MCAPI static ::std::optional<::std::array<::std::string, 4>> tryGetSherdsFromTag(::CompoundTag const& tag);
122 // NOLINTEND
123
124public:
125 // static variables
126 // NOLINTBEGIN
127 MCAPI static ::std::array<::std::string, 4> const& DEFAULT_SHERD_LIST();
128 // NOLINTEND
129
130public:
131 // constructor thunks
132 // NOLINTBEGIN
133 MCAPI void* $ctor(::BlockPos const& pos);
134 // NOLINTEND
135
136public:
137 // virtual function thunks
138 // NOLINTBEGIN
139 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
140
141 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
142
143 MCAPI void $tick(::BlockSource& region);
144
145 MCAPI void
146 $serverInitItemStackIds(int containerSlot, int onNetIdChanged, ::std::function<void(int, ::ItemStack const&)>);
147
148 MCFOLD int $getContainerSize() const;
149
150 MCFOLD int $getMaxStackSize() const;
151
152 MCFOLD ::ItemStack const& $getItem(int) const;
153
154 MCAPI void $setItem(int item, ::ItemStack const&);
155
156 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
157
158 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
159
160
161 // NOLINTEND
162
163public:
164 // vftables
165 // NOLINTBEGIN
166 MCAPI static void** $vftableForContainer();
167
168 MCAPI static void** $vftableForRandomizableBlockActorContainerBase();
169 // NOLINTEND
170};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition ILevel.h:219
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Player.h:137
Definition SaveContext.h:5