Nyko Posted April 16, 2021 Posted April 16, 2021 As already stated in the title, I would like to know if there is an easy way to combine ItemStacks? My problem at the moment is that I have a list with ItemStacks and want to combine them, which means if the list contains 10 times of stone with a count of 10. form that I want to make a list with 2 times of stone from it which means the count of the items in total are the same so i have two stack with the count 64 and 36. is this possible/ is there a simple way to do that? Quote
kiou.23 Posted April 16, 2021 Posted April 16, 2021 there isn't a function that does that already. however writing your own helper function shouldn't be that hard don't forget to handle the case when the ItemStacks contain different Items, or Items with non-64 maximum stack sizes 1 Quote
Nyko Posted April 16, 2021 Author Posted April 16, 2021 On 4/16/2021 at 4:09 PM, kiou.23 said: there isn't a function that does that already. however writing your own helper function shouldn't be that hard don't forget to handle the case when the ItemStacks contain different Items, or Items with non-64 maximum stack sizes Expand On 4/16/2021 at 5:02 PM, diesieben07 said: Look at ItemStackHandler#insertItem for an example of how to do this. Expand thanks for the good ideas Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.