LeviLamina
Loading...
Searching...
No Matches
ContainerComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/AutomaticID.h"
7#include "mc/deps/shared_types/legacy/ContainerType.h"
8#include "mc/world/ContainerCloseListener.h"
9#include "mc/world/ContainerContentChangeListener.h"
10#include "mc/world/inventory/FillingContainer.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class BlockSource;
16class CompoundTag;
17class DataLoadHelper;
18class Dimension;
20class ItemActor;
21class ItemStack;
22class Level;
23class Player;
24class Vec3;
26// clang-format on
27
28class ContainerComponent : public ::ContainerContentChangeListener, public ::ContainerCloseListener {
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<8, 440, ::FillingContainer> mContainer;
33 ::ll::TypedStorage<8, 8, ::Actor*> mListenerShim;
34 ::ll::TypedStorage<1, 1, bool> mCanBeSiphonedFrom;
35 ::ll::TypedStorage<1, 1, bool> mPrivate;
36 ::ll::TypedStorage<1, 1, bool> mRestrictToOwner;
37 ::ll::TypedStorage<8, 32, ::std::string> mLootTable;
38 ::ll::TypedStorage<4, 4, int> mLootTableSeed;
39 // NOLINTEND
40
41public:
42 // prevent constructor by default
43 ContainerComponent& operator=(ContainerComponent const&);
44 ContainerComponent(ContainerComponent const&);
45 ContainerComponent();
46
47public:
48 // virtual functions
49 // NOLINTBEGIN
50 virtual void containerContentChanged(int iSlot) /*override*/;
51
52 virtual void containerClosed(::Actor& actor) /*override*/;
53
54 virtual ~ContainerComponent() /*override*/;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCAPI ContainerComponent(::ContainerComponent&& other);
61
62 MCAPI bool _tryMoveInItem(::ItemStack& item, int slot, int face, int itemCount);
63
64 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
65
66 MCAPI bool addItem(::ItemActor& entity);
67
68 MCAPI bool canOpenContainer(::Actor const& containerActor, ::Player& player) const;
69
70 MCAPI int countItemsOfType(::ItemStack const& item) const;
71
72 MCAPI void dropContents(::BlockSource& region, ::Vec3 const& pos, bool randomizeDrop);
73
74 MCAPI void initFromDefinition(::Actor& actor, ::ContainerDescription const& desc);
75
76 MCAPI bool isEmpty() const;
77
78 MCAPI bool openContainer(::Actor& containerActor, ::Player& player);
79
80 MCAPI ::ContainerComponent& operator=(::ContainerComponent&& other);
81
82 MCAPI void readAdditionalSaveData(::Actor&, ::CompoundTag const& tag, ::DataLoadHelper&);
83
84 MCAPI void rebuildContainer(
85 ::Actor& owner,
86 ::SharedTypes::Legacy::ContainerType type,
87 int size,
88 bool canBesiphonedFrom,
89 int,
90 bool isPrivate
91 );
92
93 MCAPI void removeItemsOfType(::ItemStack const& item, int count);
94
95 MCAPI void setCustomName(::std::string const& name);
96
97 MCAPI bool setItem(int slot, ::ItemStack const& item);
98
99 MCAPI void unpackLootTable(::Level& level, ::DimensionType dimensionId);
100 // NOLINTEND
101
102public:
103 // constructor thunks
104 // NOLINTBEGIN
105 MCAPI void* $ctor(::ContainerComponent&& other);
106 // NOLINTEND
107
108public:
109 // destructor thunk
110 // NOLINTBEGIN
111 MCAPI void $dtor();
112 // NOLINTEND
113
114public:
115 // virtual function thunks
116 // NOLINTBEGIN
117 MCAPI void $containerContentChanged(int iSlot);
118
119 MCAPI void $containerClosed(::Actor& actor);
120
121
122 // NOLINTEND
123
124public:
125 // vftables
126 // NOLINTBEGIN
128
129 MCNAPI static void** $vftableForContainerCloseListener();
130 // NOLINTEND
131};
Definition Actor.h:105
Definition BlockSource.h:68
Definition CompoundTag.h:23
Definition ContainerCloseListener.h:10
static MCAPI void ** $vftableForContainerContentChangeListener()
static MCAPI void ** $vftableForContainerCloseListener()
Definition ContainerContentChangeListener.h:5
Definition DataLoadHelper.h:20
Definition Dimension.h:85
Definition FillingContainer.h:17
Definition ItemActor.h:29
Definition ItemStack.h:26
Definition Level.h:249
Definition Player.h:125
Definition Vec3.h:10
Definition ContainerDescription.h:14