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

find_empty_slots tag #2485

Merged
merged 5 commits into from
Jun 10, 2023

Conversation

BreadcrumbIsTaken
Copy link
Contributor

<InventoryTag.find_empty_slots>

Returns the index of each empty slot in an inventory.

Requested by Krilliant

return new ListTag();
}
ListTag indexes = new ListTag(object.getContents().length);
// Denizen starts at 1
Copy link
Member

Choose a reason for hiding this comment

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

This comment is stating the obvious and does not need to be here

// Denizen starts at 1
int index = 1;
for (ItemStack itemStack : object.getContents()) {
if (itemStack == null) {
Copy link
Member

Choose a reason for hiding this comment

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

should || type == air, I don't think there's any guarantee that air items have to become null.

@BreadcrumbIsTaken
Copy link
Contributor Author

Done 👍


// <--[tag]
// @attribute <InventoryTag.find_empty_slots>
// @returns ListTag(Number)
Copy link
Member

Choose a reason for hiding this comment

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

this should just be ListTag

@mcmonkey4eva mcmonkey4eva merged commit faa9d0f into DenizenScript:dev Jun 10, 2023
1 check passed
@BreadcrumbIsTaken BreadcrumbIsTaken deleted the find_empty_slots branch June 10, 2023 23:28
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.

None yet

2 participants