Skip to content
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

creative items changes #1014

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

creative items changes #1014

wants to merge 3 commits into from

Conversation

FDUTCH
Copy link
Contributor

@FDUTCH FDUTCH commented Feb 13, 2025

No description provided.

@FDUTCH
Copy link
Contributor Author

FDUTCH commented Mar 1, 2025

^

@FDUTCH
Copy link
Contributor Author

FDUTCH commented Mar 20, 2025

@TwistedAsylumMC this pr is still waiting for you -_-

// creativeItemStacks holds a list of all item stacks that were registered to the creative inventory using
// RegisterItem.
creativeItemStacks []Item
// items holds a list of all item stacks that were registered to the creative inventory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not item stacks at this point

Comment on lines -57 to -60
// RegisterItem registers an item as a creative item, exposing it in the creative inventory.
func RegisterItem(item Item) {
creativeItemStacks = append(creativeItemStacks, item)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why this was removed, as I said on discord:
I dont really know how we should do this, we need a way for people to register their own groups but also inject into vanilla groups

Comment on lines +173 to +174
// itemByIndex returns creative item by index.
func itemByIndex(groups []creative.Group, index int) (item.Stack, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Name and documentation could be better here, document how it works and the case where it returns an error

for _, group := range creative.Groups() {
func creativeContent(creativeGroups []creative.Group) ([]protocol.CreativeGroup, []protocol.CreativeItem) {
groups := make([]protocol.CreativeGroup, 0, len(creativeGroups))
it := make([]protocol.CreativeItem, 0, len(creativeGroups)*10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you multiplying by 10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants