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 index) const /*override*/;
68
69 virtual void setItem(int modelSlot, ::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 MCAPI_C void fromItem(::ItemStack const& item);
90
91 MCAPI void tryAddItem(::Player& player);
92 // NOLINTEND
93
94public:
95 // static functions
96 // NOLINTBEGIN
97 MCAPI static ::std::optional<::std::array<::std::string, 4>> _tryGetSherdsFromItem(::ItemStackBase const& item);
98
99 MCAPI_C static ::std::string getDelimitedConcatenatedSherdNames(::CompoundTag const* userData);
100
101 MCAPI static void removeDefaultSherdsFromUserData(::ItemStackBase& itemInstance);
102
103 MCAPI_C static void
104 saveSherdsToItemForInventoryRendering(::ItemStack& itemInstance, ::std::string const& screenSherdNames);
105
106 MCAPI static void
107 saveSherdsToTag(::CompoundTag& tag, ::std::array<::std::string, 4> const& sherds, bool forceSaveDefaultSherds);
108
109 MCAPI static ::std::optional<::std::array<::std::string, 4>> tryGetSherdsFromTag(::CompoundTag const& tag);
110 // NOLINTEND
111
112public:
113 // static variables
114 // NOLINTBEGIN
115 MCAPI static ::std::array<::std::string, 4> const& DEFAULT_SHERD_LIST();
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121 MCAPI void* $ctor(::BlockPos const& pos);
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
127 MCAPI void $load(::ILevel& level, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
128
129 MCAPI bool $save(::CompoundTag& tag, ::SaveContext const& saveContext) const;
130
131 MCAPI void $tick(::BlockSource& region);
132
133 MCAPI void
134 $serverInitItemStackIds(int containerSlot, int, ::std::function<void(int, ::ItemStack const&)> onNetIdChanged);
135
136 MCFOLD int $getContainerSize() const;
137
138 MCFOLD int $getMaxStackSize() const;
139
140 MCFOLD ::ItemStack const& $getItem(int index) const;
141
142 MCAPI void $setItem(int modelSlot, ::ItemStack const& item);
143
144 MCFOLD ::std::unique_ptr<::BlockActorDataPacket> $_getUpdatePacket(::BlockSource&);
145
146 MCFOLD void $_onUpdatePacket(::CompoundTag const& data, ::BlockSource& region);
147
148
149 // NOLINTEND
150
151public:
152 // vftables
153 // NOLINTBEGIN
154 MCNAPI static void** $vftableForContainer();
155
157 // NOLINTEND
158};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
static MCAPI void ** $vftableForRandomizableBlockActorContainerBase()
static MCAPI void ** $vftableForContainer()
Definition ILevel.h:214
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Player.h:125
Definition RandomizableBlockActorContainer.h:16
Definition SaveContext.h:5