Closed ghost closed 5 years ago
Thanks, sounds very promising! I will test this tomorrow if I have time. Thank you very much, this will be very helpful for other plugin authors :)
I took a quick look into your changes and it seems like a brilliant idea. I will post a resource update in a few days, thanks again
I am not sure if we should create a new method for this or just update the existing method. Suggestions?
That's totally up to you. If you do use the existing method you would need to split everything after this line into their own methods because it's different.
Thanks for the great help, it will make the API much more useful. I will be happy to mention your contribution in the next changelog/update notes at SpigotMC. Please tell your account URL if you would like me to link your profile in the next update notes.
I don't use my Spigot account often but you can mention my GitHub link if you'd like or a link to the issue.
Alright, I'll post the update tomorrow or in a few days.
Thanks, it's now integrated in the existing function
I noticed what you meant about items not stacking when using
setItem
. So my only solution would to be stacking the items before sorting.At first I was going to create my own method of stacking items but figured I wouldn't reinvent the wheel because
Inventory.addItem
already does exactly that.So I ended up using
Bukkit.createInventory
to create a temp inventory with a null holder and a size of 54 (which should fit most needs) and returning the contents of that inventory to be using in the sorting.I still end up using
setItem
because we want it to stay within thestartSlot
andendSlot
range.I tested this multiple times and didn't have problems.
A fix for https://github.com/JEFF-Media-GbR/Spigot-ChestSort/issues/5