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&);
73 virtual ~SparseContainer() =
default;
75 virtual ::ItemStack
const& getItem(
int slot)
const ;
77 virtual int getContainerSize()
const ;
79 virtual int getMaxStackSize()
const ;
81 virtual void containerContentChanged(
int slot) ;
83 virtual void setItem(
int slot,
::ItemStack const& item) ;
85 virtual void serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>) ;
87 virtual void startOpen(
::Actor& actor) ;
89 virtual void stopOpen(
::Actor& actor) ;
91 virtual void removeItem(
int slot,
int count) ;
98 MCNAPI SparseContainer(
99 ::Container& backingContainer,
100 ::SparseContainerBackingSetType backingSetType,
102 bool isItemStackNetManagerEnabled,
103 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
104 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
109 MCNAPI
void addAvailableSetCountCallback(
110 ::ContainerEnumName name,
111 ::std::function<
int(
int,
::ItemStackBase const&)> availableSetCountCallback
114 MCNAPI
void addItemAllowedInContainerCallback(
115 ::ContainerEnumName name,
119 MCNAPI
void addItemAllowedInSlotCallback(
120 ::ContainerEnumName name,
121 ::std::function<
bool(
int,
::ItemStackBase const&,
int)> itemAllowedCallback
124 MCNAPI
void addItemAllowedToAddCallback(
125 ::ContainerEnumName name,
129 MCNAPI
void addItemAllowedToRemoveCallback(
130 ::ContainerEnumName name,
136 ::ContainerEnumName name,
141 MCNAPI
void addValidSlotForContainerCallback(
142 ::ContainerEnumName name,
143 ::std::function<
bool(
int)> validSlotForContainerCallback
146 MCNAPI ::ItemAddType canAdd(
154 MCAPI
bool canRemove(::ContainerEnumName name,
int slot,
int amount)
const;
156 MCNAPI ::ItemSetType canSet(
166 MCNAPI
int getAvailableAddCount(
168 ::ContainerEnumName name,
173 MCNAPI
int getAvailableSetCount(
189 ::Container& backingContainer,
190 ::SparseContainerBackingSetType backingSetType,
192 bool isItemStackNetManagerEnabled,
193 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
194 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
203 MCNAPI ::ItemStack
const& $getItem(
int slot)
const;
205 MCNAPI
int $getContainerSize()
const;
207 MCNAPI
int $getMaxStackSize()
const;
209 MCNAPI
void $containerContentChanged(
int slot);
211 MCNAPI
void $setItem(
int slot,
::ItemStack const& item);
213 MCNAPI
void $serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>);
215 MCNAPI
void $startOpen(
::Actor& actor);
217 MCNAPI
void $stopOpen(
::Actor& actor);
219 MCNAPI
void $removeItem(
int slot,
int count);
Definition ContainerContentChangeListener.h:5
Definition ContainerScreenContext.h:16