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 MCAPI SparseContainer(
99 ::Container& backingContainer,
100 ::SparseContainerBackingSetType backingSetType,
102 bool isItemStackNetManagerEnabled,
103 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
104 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
107 MCAPI
int _getAvailableAddCount(
109 ::ContainerEnumName name,
115 MCAPI
void addAvailableSetCountCallback(
116 ::ContainerEnumName name,
117 ::std::function<
int(
int,
::ItemStackBase const&)> availableSetCountCallback
120 MCAPI
void addItemAllowedInContainerCallback(
121 ::ContainerEnumName name,
125 MCAPI
void addItemAllowedInSlotCallback(
126 ::ContainerEnumName name,
127 ::std::function<
bool(
int,
::ItemStackBase const&,
int)> itemAllowedCallback
130 MCAPI
void addItemAllowedToAddCallback(
131 ::ContainerEnumName name,
135 MCAPI
void addItemAllowedToRemoveCallback(
136 ::ContainerEnumName name,
141 MCAPI
void addItemNetworkChangedCallback(
142 ::ContainerEnumName name,
147 MCAPI
void addValidSlotForContainerCallback(
148 ::ContainerEnumName name,
149 ::std::function<
bool(
int)> validSlotForContainerCallback
152 MCAPI ::ItemAddType canAdd(
160 MCAPI
bool canRemove(::ContainerEnumName name,
int slot,
int amount)
const;
162 MCAPI ::ItemSetType canSet(
172 MCAPI
int getAvailableAddCount(
174 ::ContainerEnumName name,
179 MCAPI
int getAvailableSetCount(
187 MCAPI
void removeItemNetworkChangedCallback(::ContainerEnumName name);
195 ::Container& backingContainer,
196 ::SparseContainerBackingSetType backingSetType,
198 bool isItemStackNetManagerEnabled,
199 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
200 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
209 MCAPI ::ItemStack
const& $getItem(
int slot)
const;
211 MCAPI
int $getContainerSize()
const;
213 MCAPI
int $getMaxStackSize()
const;
215 MCFOLD
void $containerContentChanged(
int slot);
217 MCAPI
void $setItem(
int slot,
::ItemStack const& item);
219 MCFOLD
void $serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>);
221 MCAPI
void $startOpen(
::Actor& actor);
223 MCAPI
void $stopOpen(
::Actor& actor);
225 MCFOLD
void $removeItem(
int slot,
int count);
Definition ContainerContentChangeListener.h:5
Definition ContainerScreenContext.h:16