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

Add support for removing one element from a list #293

Open
Fusezion opened this issue Aug 15, 2024 · 0 comments
Open

Add support for removing one element from a list #293

Fusezion opened this issue Aug 15, 2024 · 0 comments

Comments

@Fusezion
Copy link

Currently under the NBTList#remove method you're using

while((id = this.indexOf(o)) != -1) {
    this.remove(id);
}

While this can normally be fine this sucks when you're removing a string from a string list tag where duplicates are likely to be more apparent causing issues where the tag is just completely empty when you only wanted to removed one element.

I wouldn't call this a bug but should likely be treated as one when the javadocs explicitly state that it "Removes the first occurrence of the specified element from this list" (Copied form List interface)

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

No branches or pull requests

1 participant