-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use the PagedComponent #3
Comments
Looks right, except the part where you define the pages manually in the component. All compontens get assigned a page, x and y automatically based on your pattern provided. A version that would fix the component might look like this: <component type="paged" id="container" y="1" width="9" height="1" interactions="true"
pattern="0,1,2,3,4,5,6,7,8">
<fill-empty type="item" material="GLASS_PANE">
<on-click type="action">[message] Nothing here</on-click>
</fill-empty>
<component type="item" material="EMERALD_BLOCK" name="§eItem 1">
<on-click type="action">[message] Page 1</on-click>
</component>
<component type="item" material="REDSTONE_BLOCK" name="§eItem 2">
<on-click type="action">[message] Page 2</on-click>
</component>
</component> Btw sorry for the bad code style, I'm on mobile and it's not that great to edit code on there. Basically what the component does, it takes your all items you give it in the body and places them in the slots you defined in the pattern attribute. When the last slot in the pattern is reached, it will create a new page and start assigning the items to the pattern from the beginning again |
All you have to do is adjust the pattern. Take a look at a chest UI with the slots. Then you can change the order of the slots / remove slots / add other slots |
Um... whitch pattern? Btw when it has nine items, it will switch to next page when I clicked Next Button. Is it normal? |
The property pattern. In the example you sent above, it's set to 0,1,2,3,4,5,6,7,8 You mean the page is empty with just nine components? If that's the case, I'll have to see and fix that |
Alright. Good the see that it kinda works. Once I'm home from work I'll take a look at it and see if I can fix it |
I fixed this problem in Pull Request It caused because when adding the last item, the |
Alright, thanks. I'll take a look at it |
Okay, approved & merged the pull request. Thanks for fixing it again. You can close the issue if you no longer need something |
There is still have problem here |
Can you send me the gui file that produced this gui? I'll take a look at it |
The gui code is same as this |
I fixed this in Pull Request with details because maybe it will have better solution |
Oh, thank you. I'll take a look at it. I've got stuck in a rabbit hole of fixing the paged component's api, as the code for the paged component isn't really that great. |
Fixed it based on your observations with a cleaner implementation |
Besides, could I share this plugin to mcbbs.net, a Minecraft forum in China? I will forward the download link to Github |
Yeah, sure. As long as it stays free and open source you should be able to do it form the license side. For me it wouldn't be an issue too |
Is this code correct?
The text was updated successfully, but these errors were encountered: