Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI ContainerComponent(::ContainerComponent&& other);
58
59 MCNAPI bool _tryMoveInItem(::ItemStack& item, int slot, int face, int itemCount);
60
61 MCNAPI void addAdditionalSaveData(::CompoundTag& tag) const;
62
63 MCNAPI bool addItem(::ItemStack& item, int face, int itemCount);
64
65 MCNAPI bool canOpenContainer(::Actor const& containerActor, ::Player& player) const;
66
67 MCNAPI int countItemsOfType(::ItemStack const& item) const;
68
69 MCAPI void dropContents(::BlockSource& region, ::Vec3 const& pos, bool randomizeDrop);
70
71 MCNAPI void dropSlotContent(::BlockSource& region, ::Vec3 const& pos, bool randomizeDrop, int slot);
72
73 MCNAPI int getEmptySlotsCount() const;
74
75 MCNAPI void initFromDefinition(::Actor& actor, ::ContainerDescription const& desc);
76
77 MCNAPI bool isEmpty() const;
78
79 MCAPI bool openContainer(::Actor& containerActor, ::Player& player);
80
81 MCNAPI ::ContainerComponent& operator=(::ContainerComponent&& other);
82
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 MCNAPI void removeItemsOfType(::ItemStack const& item, int count);
95
96 MCNAPI 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 MCNAPI void setLootTable(::std::string const& lootTable, int lootTableSeed);
102
103 MCNAPI void unpackLootTable(::Level& level, ::DimensionType dimensionId, ::Actor& owner);
104 // NOLINTEND
105
106public:
107 // constructor thunks
108 // NOLINTBEGIN
109 MCNAPI void* $ctor(::ContainerComponent&& other);
110 // NOLINTEND
111
112public:
113 // destructor thunk
114 // NOLINTBEGIN
115 MCNAPI void $dtor();
116 // NOLINTEND
117
118public:
119 // virtual function thunks
120 // NOLINTBEGIN
121 MCNAPI void $containerContentChanged(int iSlot);
122
123 MCNAPI 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:116
Definition BlockSource.h:72
Definition CompoundTag.h:18
Definition ContainerCloseListener.h:10
MCAPI void readAdditionalSaveData(::Actor &, ::CompoundTag const &tag, ::DataLoadHelper &)
MCAPI ContainerComponent(::ContainerComponent &&other)
MCAPI void * $ctor(::ContainerComponent &&other)
MCAPI int countItemsOfType(::ItemStack const &item) const
MCAPI::ContainerComponent & operator=(::ContainerComponent &&other)
MCAPI void $containerClosed(::Actor &actor)
MCAPI void initFromDefinition(::Actor &actor, ::ContainerDescription const &desc)
MCAPI void addAdditionalSaveData(::CompoundTag &tag) const
MCAPI void serverInitItemStackIds(int containerSlot, int count, ::std::function< void(int, ::ItemStack const &)> onNetIdChanged)
MCAPI void $dtor()
MCAPI void unpackLootTable(::Level &level, ::DimensionType dimensionId, ::Actor &owner)
MCAPI void $containerContentChanged(int iSlot)
MCAPI bool addItem(::ItemStack &item, int face, int itemCount)
static MCAPI void ** $vftableForContainerContentChangeListener()
MCAPI void setLootTable(::std::string const &lootTable, int lootTableSeed)
MCAPI void dropSlotContent(::BlockSource &region, ::Vec3 const &pos, bool randomizeDrop, int slot)
MCAPI bool _tryMoveInItem(::ItemStack &item, int slot, int face, int itemCount)
MCAPI int getEmptySlotsCount() const
static MCAPI void ** $vftableForContainerCloseListener()
MCAPI bool canOpenContainer(::Actor const &containerActor, ::Player &player) const
MCAPI bool isEmpty() const
MCAPI void removeItemsOfType(::ItemStack const &item, int count)
Definition ContainerContentChangeListener.h:5
Definition DataLoadHelper.h:20
Definition ItemStack.h:26
Definition Level.h:255
Definition Player.h:131
Definition Vec3.h:10
Definition ContainerDescription.h:14
Definition DimensionType.h:5