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