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
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&);
46
47public:
48 // virtual functions
49 // NOLINTBEGIN
50 // vIndex: 0
51 virtual void containerContentChanged(int iSlot) /*override*/;
52
53 // vIndex: 0
54 virtual void containerClosed(::Player& player) /*override*/;
55
56 // vIndex: 1
57 virtual ~ContainerComponent() /*override*/;
58 // NOLINTEND
59
60public:
61 // member functions
62 // NOLINTBEGIN
64
65 MCAPI bool _tryMoveInItem(::ItemStack& item, int slot, int face, int itemCount);
66
67 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
68
69 MCAPI bool addItem(::ItemActor& entity);
70
71 MCAPI bool canOpenContainer(::Actor const& containerActor, ::Player& player) const;
72
73 MCAPI int countItemsOfType(::ItemStack const& item) const;
74
75 MCAPI void dropContents(::BlockSource& region, ::Vec3 const& pos, bool randomizeDrop);
76
77 MCAPI void initFromDefinition(::Actor& actor, ::ContainerDescription const& desc);
78
79 MCAPI bool isEmpty() const;
80
81 MCAPI bool openContainer(::Actor& containerActor, ::Player& player);
82
83 MCAPI ::ContainerComponent& operator=(::ContainerComponent&& other);
84
85 MCAPI void readAdditionalSaveData(::Actor&, ::CompoundTag const& tag, ::DataLoadHelper&);
86
87 MCAPI void rebuildContainer(
88 ::Actor& owner,
89 ::SharedTypes::Legacy::ContainerType type,
90 int size,
91 bool canBesiphonedFrom,
92 int,
93 bool isPrivate
94 );
95
96 MCAPI void removeItemsOfType(::ItemStack const& item, int count);
97
98 MCAPI void setCustomName(::std::string const& name);
99
100 MCAPI bool setItem(int slot, ::ItemStack const& item);
101
102 MCAPI void unpackLootTable(::Level& level, ::DimensionType dimensionId);
103 // NOLINTEND
104
105public:
106 // constructor thunks
107 // NOLINTBEGIN
108 MCAPI void* $ctor(::ContainerComponent&& other);
109 // NOLINTEND
110
111public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCAPI void $dtor();
115 // NOLINTEND
116
117public:
118 // virtual function thunks
119 // NOLINTBEGIN
120 MCAPI void $containerContentChanged(int iSlot);
121
122 MCAPI void $containerClosed(::Player& player);
123 // NOLINTEND
124
125public:
126 // vftables
127 // NOLINTBEGIN
129
130 MCNAPI static void** $vftableForContainerCloseListener();
131 // NOLINTEND
132};
Definition Actor.h:103
Definition AutomaticID.h:6
Definition BlockSource.h:67
Definition CompoundTag.h:13
Definition ContainerCloseListener.h:10
Definition ContainerComponent.h:28
static MCAPI void ** $vftableForContainerContentChangeListener()
static MCAPI void ** $vftableForContainerCloseListener()
Definition ContainerContentChangeListener.h:5
Definition DataLoadHelper.h:20
Definition Dimension.h:83
Definition FillingContainer.h:16
Definition ItemActor.h:27
Definition ItemStack.h:25
Definition Level.h:238
Definition Player.h:119
Definition Vec3.h:10
Definition ContainerDescription.h:14