Posted April 29, 20205 yr I've got a custom player inventory set up and good to go, I'm setting up a multi-tabbed survival inventory but am having trouble hiding certain slots depending on the tab currently clicked. So there are 3 tabs: one of them is the default survival, one of them has the crafting slots, and the other has slots for player armor, as well as slots that reference my itemhandler. Currently, if player is in tab 0, I draw the normal 3x9 player inventory slots and don't draw the crafting, custom, or armor slots, and also mask them when the mouse is interacted with. Then when they press tabs 1 or 2, the others are drawn. I've recreated the default player inventory perfectly, but when my mouse click method is called on slots that reference my custom item handler using windowClick, not the default player inventory slots, there's a class cast exception with the item handler. What are my options here? EDIT: Make sure you implement the correct classes when creating your slots for your registered item handlers, and override the correct methods. Edited April 30, 20205 yr by Turtledove
April 30, 20205 yr Author So as it turns out I wasn't actually using my itemhandler capability, I'd been calling the vanilla one, which was why it was acting weird, another silly mistake. But now that I am using it, calling windowClick causes a class cast exception with my ItemHandler. Huh. Edited April 30, 20205 yr by Turtledove
April 30, 20205 yr Author Did a bit more digging and I think I found the problem, I forgot to override some of my methods.
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.