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