Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ContainerController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/containers/controllers/ItemPlaceType.h"
7#include "mc/world/containers/controllers/ItemSetType.h"
8
9// auto generated forward declare list
10// clang-format off
11class ContainerModel;
13class ItemInstance;
14class ItemStack;
15class ItemStackBase;
16class Recipes;
18// clang-format on
19
21public:
22 // member variables
23 // NOLINTBEGIN
24 ::ll::TypedStorage<8, 16, ::std::weak_ptr<::ContainerModel>> mContainerModel;
25 ::ll::TypedStorage<1, 1, bool> mDrop;
26 // NOLINTEND
27
28public:
29 // virtual functions
30 // NOLINTBEGIN
31 virtual ~ContainerController() = default;
32
33 virtual ::ItemInstance const& getRecipeItem(int index) const;
34
35 virtual bool canRemove(int slot, int removeCount) const;
36
37 virtual bool isItemAllowed(::ItemStackBase const& item) const;
38
39 virtual bool isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
40
41 virtual int getBackgroundStyle(int slot, bool inventoryContainsItem) const;
42
43 virtual ::ItemSetType _canSet(
45 int modelSlot,
46 ::ItemStackBase const& item,
47 ::ItemTransferAmount transferAmount
48 ) const;
49
50 virtual int
51 _getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
52
53 virtual bool _canRemove(int modelSlot, int removeCount) const;
54
55 virtual void _onItemChanged(int modelSlot);
56 // NOLINTEND
57
58public:
59 // member functions
60 // NOLINTBEGIN
61#ifdef LL_PLAT_C
62 MCNAPI bool canConsume(int modelSlot, int removeCount) const;
63
64 MCNAPI bool canDestroy(int modelSlot, int removeCount) const;
65
66 MCNAPI bool canDrop(int modelSlot, int removeCount) const;
67
68 MCNAPI ::ItemSetType canSet(
70 int modelSlot,
71 ::ItemStackBase const& item,
72 ::ItemTransferAmount transferAmount,
73 bool allowSwap
74 ) const;
75
76 MCNAPI int
77 getAvailableAddCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& fillItem) const;
78
79 MCNAPI int getAvailableAutoPlaceCount(
81 int slot,
82 ::ItemStackBase const& fillItem,
83 bool allowClobber
84 ) const;
85
86 MCNAPI ::ItemStack const& getItemStack(int slot) const;
87
88 MCNAPI ::ItemStack removeItem(int slot, int removeCount);
89
90 MCNAPI bool setItem(
92 int slot,
93 ::ItemStack& stack,
94 ::ItemPlaceType type,
95 bool allowSwap
96 );
97#endif
98 // NOLINTEND
99
100public:
101 // virtual function thunks
102 // NOLINTBEGIN
103#ifdef LL_PLAT_C
104 MCNAPI ::ItemInstance const& $getRecipeItem(int index) const;
105
106 MCNAPI bool $canRemove(int slot, int removeCount) const;
107
108 MCNAPI bool $isItemAllowed(::ItemStackBase const& item) const;
109
110 MCNAPI bool $isItemFiltered(::Recipes const& recipes, ::ItemStackBase const& item) const;
111
112 MCNAPI int $getBackgroundStyle(int slot, bool inventoryContainsItem) const;
113
114 MCNAPI ::ItemSetType $_canSet(
116 int modelSlot,
117 ::ItemStackBase const& item,
118 ::ItemTransferAmount transferAmount
119 ) const;
120
121 MCNAPI int
122 $_getAvailableSetCount(::ContainerScreenContext const& context, int modelSlot, ::ItemStackBase const& item) const;
123
124 MCNAPI bool $_canRemove(int modelSlot, int removeCount) const;
125
126 MCNAPI void $_onItemChanged(int modelSlot);
127#endif
128
129
130 // NOLINTEND
131};
Definition ContainerController.h:20
Definition ContainerModel.h:23
Definition ContainerScreenContext.h:16
Definition ItemInstance.h:15
Definition ItemStackBase.h:45
Definition ItemStack.h:26
Definition Recipes.h:39
Definition ItemTransferAmount.h:5
Definition context.h:5