32 ::ll::TypedStorage<4, 4, ::SparseContainerBackingSetType const> mBackingSetType;
33 ::ll::TypedStorage<8, 8, ::Container&> mBackingContainer;
34 ::ll::TypedStorage<8, 64, ::std::unordered_map<int, ::ItemStack>> mItems;
35 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ISparseContainerSetListener>> mNetManagerSetter;
36 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IPlayerContainerSetter>> mPlayerSetter;
40 ::std::unordered_map<::ContainerEnumName, ::std::function<void(
int,
::ItemStack const&,
::ItemStack const&)>>>
41 mItemNetworkChangedCallbacks;
45 ::std::unordered_map<::ContainerEnumName, ::std::function<bool(
int,
::ItemStackBase const&,
int)>>>
46 mItemAllowedInSlotCallbacks;
47 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::function<bool(
::ItemStackBase const&)>>>
48 mItemAllowedToAddCallbacks;
52 ::std::unordered_map<::ContainerEnumName, ::std::function<int(
int,
::ItemStackBase const&)>>>
53 mAvailableSetCountCallbacks;
54 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::function<bool(
int)>>>
55 mValidSlotForContainerCallbacks;
56 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::function<bool(
::ItemStackBase const&)>>>
57 mItemAllowedToRemoveCallbacks;
58 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ContainerEnumName, ::std::function<bool(
::ItemStackBase const&)>>>
59 mItemAllowedInContainerCallbacks;
60 ::ll::TypedStorage<1, 1, bool const> mIsClientSide;
61 ::ll::TypedStorage<1, 1, bool const> mIsItemStackNetManagerEnabled;
66 SparseContainer& operator=(SparseContainer
const&);
67 SparseContainer(SparseContainer
const&);
74 virtual ~SparseContainer() =
default;
76 virtual ~SparseContainer() ;
79 virtual ::ItemStack
const& getItem(
int index)
const ;
81 virtual int getContainerSize()
const ;
83 virtual int getMaxStackSize()
const ;
85 virtual void containerContentChanged(
int slot) ;
87 virtual void setItem(
int slot,
::ItemStack const& item) ;
89 virtual void serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>) ;
91 virtual void startOpen(
::Actor& actor) ;
93 virtual void stopOpen(
::Actor& actor) ;
95 virtual void removeItem(
int slot,
int count) ;
101 MCAPI_C
int _getAvailableAddCount(
103 ::ContainerEnumName name,
108 _isItemAllowedInSlot(::ContainerEnumName name,
int slot,
::ItemStackBase const& item,
int amount)
const;
112 MCAPI_C
void _setBackingContainerSlot(
int slot,
::ItemStack const& newItem);
114 MCAPI_C
void addAvailableSetCountCallback(
115 ::ContainerEnumName name,
116 ::std::function<
int(
int,
::ItemStackBase const&)> availableSetCountCallback
119 MCAPI_C
void addItemAllowedInSlotCallback(
120 ::ContainerEnumName name,
121 ::std::function<
bool(
int,
::ItemStackBase const&,
int)> itemAllowedCallback
124 MCAPI_C
void addItemAllowedToAddCallback(
125 ::ContainerEnumName name,
129 MCAPI_C
void addItemAllowedToRemoveCallback(
130 ::ContainerEnumName name,
134 MCAPI_C
void addValidSlotForContainerCallback(
135 ::ContainerEnumName name,
136 ::std::function<
bool(
int)> validSlotForContainerCallback
139 MCAPI_C ::ItemAddType canAdd(
147 MCAPI_C
bool canRemove(::ContainerEnumName name,
int slot,
int amount)
const;
149 MCAPI_C ::ItemSetType canSet(
157 MCAPI_C
int getAvailableSetCount(
164 MCAPI_C
bool isValidSlot(::ContainerEnumName name,
int slot)
const;
171 ::Container& backingContainer,
172 ::SparseContainerBackingSetType backingSetType,
174 bool isItemStackNetManagerEnabled,
175 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
176 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
190 MCAPI ::ItemStack
const& $getItem(
int index)
const;
192 MCAPI
int $getContainerSize()
const;
194 MCAPI
int $getMaxStackSize()
const;
196 MCFOLD
void $containerContentChanged(
int slot);
198 MCAPI
void $setItem(
int slot,
::ItemStack const& item);
200 MCFOLD
void $serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>);
202 MCAPI
void $startOpen(
::Actor& actor);
204 MCAPI
void $stopOpen(
::Actor& actor);
206 MCFOLD
void $removeItem(
int slot,
int count);
215 MCAPI
static void** $vftableForContainerContentChangeListener();
217 MCAPI
static void** $vftableForContainer();
Definition ContainerContentChangeListener.h:5
Definition ContainerScreenContext.h:17