-
Notifications
You must be signed in to change notification settings - Fork 152
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
base: master
Are you sure you want to change the base?
creative items changes #1014
Conversation
^ |
@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. |
There was a problem hiding this comment.
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
// RegisterItem registers an item as a creative item, exposing it in the creative inventory. | ||
func RegisterItem(item Item) { | ||
creativeItemStacks = append(creativeItemStacks, item) | ||
} |
There was a problem hiding this comment.
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
// itemByIndex returns creative item by index. | ||
func itemByIndex(groups []creative.Group, index int) (item.Stack, error) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
No description provided.