TurtyWurty Posted August 8, 2020 Posted August 8, 2020 So I have a tile entity which has several 'pages' of slots, and you move to the next page using the forward page and back page buttons. This mostly works apart from the fact that slots seem to only be created when the container is opened. So this means when I press the button, I have to close and re-open the container in order for the container to show the next page of slots. So I was wondering how I would go about causing it to show the next page of slots and hide the current page when I press the button without having to close and re-open the container. I have been trying to look at the Creative Inventory code as well as the Stone-cutter code, but sadly I haven't managed to find anything that works. Thanks in advance. Quote
TurtyWurty Posted August 8, 2020 Author Posted August 8, 2020 (edited) 31 minutes ago, diesieben07 said: When you change slots you have to do it on client and server (as the server needs the correct positions of the slots as well). So you'll have to send a packet to the server when changing pages and shuffle the slots around there as well. But how do I actually change the slots? Currently what I am doing to make it page dependent is just (page number * number of slots per page) + index. Edited August 8, 2020 by TurtyWurty Quote
TurtyWurty Posted August 8, 2020 Author Posted August 8, 2020 (edited) 12 minutes ago, diesieben07 said: You can either change the slots themselves (i.e. make them point at a different inventory slot), but I am not sure how feasible it is. You can also just add all slots and just move them around, i.e. move the ones that are not on the current page off-screen (i.e. negative x/y positions). This one might not be viable if you have a lot of slots. Yea, I have 104 slots per page, so I don't imagine the second option would be a great idea. But by the first option, do you mean to just change the slots index? If so, how would I even go about doing that? Edited August 8, 2020 by TurtyWurty 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.