August 9, 20223 yr Author 1 hour ago, Luis_ST said: I'm not sure what's the problem everything works how i think it should. When I turn on the menu, the items that I have in the hotbar appear in 9 slots form my capability, and I want more space Edited August 9, 20223 yr by Squander
August 9, 20223 yr 15 minutes ago, Squander said: When I turn on the menu, the items that I have in the hotbar appear in 9 slots form my capability Please post a screenshot, so i can try to reproduce this.
August 9, 20223 yr Author 17 minutes ago, Luis_ST said: Please post a screenshot, so i can try to reproduce this.
August 9, 20223 yr Is the code in your Git repo up to date? How did you open the Backpack? Did you tried a new World?
August 9, 20223 yr Author This is not a backpack, I open it with an event (only for the test) in the ClickBlock class 3 minutes ago, Luis_ST said: Is the code in your Git repo up to date? How did you open the Backpack? Did you tried a new World? Edited August 9, 20223 yr by Squander
August 9, 20223 yr 1 hour ago, Squander said: and I want more space I'll guess you mean the size of the ExtraStorageInventory, in your case the size is set in AttachCapabilities where you create ExtraStorageInventory, and in ClickBlock where you send the size to the client. If you change these values and handle the new Slot size in your ExtraStorageMenu you can expands the ExtraStorage. Note if you change the value you need to create a new World. 1 hour ago, Squander said: When I turn on the menu, the items that I have in the hotbar appear in 9 slots form my capability Finally i found your issue, as D7 already told you can not use ITEM_HANDLER_CAPABILITY but this include IItemHandler. Due you use IItemHandler for your Capability it always return the already attached IItemHandler (the player inventory). The steps to solve this problem are easy: Create a new interface which extends IItemHandler Implement this interface in your ExtraStorageInventory Use this interface for your Capability and the LazyOptional
August 9, 20223 yr Author 17 minutes ago, Luis_ST said: I'll guess you mean the size of the ExtraStorageInventory, in your case the size is set in AttachCapabilities where you create ExtraStorageInventory, and in ClickBlock where you send the size to the client. If you change these values and handle the new Slot size in your ExtraStorageMenu you can expands the ExtraStorage. Note if you change the value you need to create a new World. Finally i found your issue, as D7 already told you can not use ITEM_HANDLER_CAPABILITY but this include IItemHandler. Due you use IItemHandler for your Capability it always return the already attached IItemHandler (the player inventory). The steps to solve this problem are easy: Create a new interface which extends IItemHandler Implement this interface in your ExtraStorageInventory Use this interface for your Capability and the LazyOptional Does my IItemHandler extension interface need to be registered with RegisterCapabilityEvent?
August 9, 20223 yr Just now, Squander said: Does my IItemHandler extension interface need to be registered with RegisterCapabilityEvent? Yes
August 9, 20223 yr Author 1 hour ago, diesieben07 said: Prefer composition over inheritance. Make a class that has an IItemHandler field and use it as your capability instead of extending IitemHandler. Should I assign a new instance to the IItemHandler field
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.