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 // NOLINTEND
75
76public:
77 // member functions
78 // NOLINTBEGIN
79 MCAPI explicit DecoratedPotBlockActor(::BlockPos const& pos);
80
81 MCAPI void _setContainedItem(::ItemStack const& item);
82
83#ifdef LL_PLAT_C
84 MCAPI void fromItem(::ItemStack const& item);
85#endif
86
87 MCAPI void tryAddItem(::Player& player);
88 // NOLINTEND
89
90public:
91 // static functions
92 // NOLINTBEGIN
93 MCAPI static bool _areDefaultSherds(::std::array<::std::string, 4> const& sherds);
94
95#ifdef LL_PLAT_C
96 MCAPI static ::std::string getDelimitedConcatenatedSherdNames(::CompoundTag const* userData);
97#endif
98
99 MCAPI static void removeDefaultSherdsFromUserData(::ItemStackBase& itemInstance);
100
101#ifdef LL_PLAT_C
102 MCAPI static void
103 saveSherdsToItemForInventoryRendering(::ItemStack& itemInstance, ::std::string const& screenSherdNames);
104#endif
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 MCAPI ::ItemStack const& $getItem(int) const;
141
142 MCAPI void $setItem(int, ::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
155
156 MCNAPI static void** $vftable();
157
158 MCNAPI static void** $vftableForBlockActor();
159
161
163 // NOLINTEND
164};
Definition BlockActorDataPacket.h:19
Definition BlockPos.h:21
Definition BlockSource.h:71
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
static MCAPI void ** $vftableForIVanillaMainBlockActorComponent()
static MCAPI void ** $vftableForBlockActor()
static MCAPI void ** $vftable()
static MCAPI void ** $vftableForIVanillaTickBlockActorComponent()
static MCAPI void ** $vftableForIVanillaRenderBlockActorComponent()
Definition ILevel.h:220
Definition ItemStackBase.h:44
Definition ItemStack.h:24
Definition Player.h:128
Definition RandomizableBlockActorContainer.h:16
Definition SaveContext.h:5