How to Creating a scalable auto-adjusting size inventory #41
-
Hi there, I am facing an issue related to the Inventory interface in our project. Currently, we have an implementation called VirtualInventory that does not include the width and height properties. However, the VirtualInventory does have a My goal is to create a custom Inventory implementation that can automatically adjust its size based on the items it contains. I'm seeking guidance on how to achieve this effectively. Any suggestions or code examples on how to approach this problem would be greatly appreciated. Thank you in advance for your assistance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
VirtualInventory
is backed by a one-dimensionalItemStack[]
. You can resize it by callingVirtualInventory#resize
. If this doesn't suit your needs, you can also implementInventory
yourself