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 slot)
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) ;
102 MCAPI SparseContainer(
103 ::Container& backingContainer,
104 ::SparseContainerBackingSetType backingSetType,
106 bool isItemStackNetManagerEnabled,
107 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
108 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
111 MCAPI
int _getAvailableAddCount(
113 ::ContainerEnumName name,
117 MCAPI
bool _isItemAllowedInSlot(::ContainerEnumName name,
int slot,
::ItemStackBase const& item,
int amount)
const;
123 MCAPI
void _setBackingContainerSlot(
int slot,
::ItemStack const& newItem);
125 MCAPI
void addAvailableSetCountCallback(
126 ::ContainerEnumName name,
127 ::std::function<
int(
int,
::ItemStackBase const&)> availableSetCountCallback
130 MCAPI
void addItemAllowedInSlotCallback(
131 ::ContainerEnumName name,
132 ::std::function<
bool(
int,
::ItemStackBase const&,
int)> itemAllowedCallback
135 MCAPI
void addItemAllowedToAddCallback(
136 ::ContainerEnumName name,
140 MCAPI
void addItemAllowedToRemoveCallback(
141 ::ContainerEnumName name,
145 MCAPI
void addValidSlotForContainerCallback(
146 ::ContainerEnumName name,
147 ::std::function<
bool(
int)> validSlotForContainerCallback
150 MCAPI ::ItemAddType canAdd(
158 MCAPI
bool canRemove(::ContainerEnumName name,
int slot,
int amount)
const;
160 MCAPI ::ItemSetType canSet(
168 MCAPI
int getAvailableSetCount(
175 MCAPI
bool isValidSlot(::ContainerEnumName name,
int slot)
const;
184 ::Container& backingContainer,
185 ::SparseContainerBackingSetType backingSetType,
187 bool isItemStackNetManagerEnabled,
188 ::std::unique_ptr<::ISparseContainerSetListener> netManagerSetter,
189 ::std::unique_ptr<::IPlayerContainerSetter> playerSetter
204 MCAPI ::ItemStack
const& $getItem(
int slot)
const;
206 MCAPI
int $getContainerSize()
const;
208 MCAPI
int $getMaxStackSize()
const;
210 MCFOLD
void $containerContentChanged(
int slot);
212 MCAPI
void $setItem(
int slot,
::ItemStack const& item);
214 MCFOLD
void $serverInitItemStackIds(
int,
int, ::std::function<
void(
int,
::ItemStack const&)>);
216 MCAPI
void $startOpen(
::Actor& actor);
218 MCAPI
void $stopOpen(
::Actor& actor);
220 MCFOLD
void $removeItem(
int slot,
int count);
229 MCAPI
static void** $vftableForContainerContentChangeListener();
231 MCAPI
static void** $vftableForContainer();
Definition ContainerContentChangeListener.h:5
Definition ContainerScreenContext.h:17