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

[Feature]: Removed old friends when copy/pasting configuration #268

Open
TheDiscordian opened this issue Feb 16, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@TheDiscordian
Copy link
Contributor

Feature description

Currently when copying a configuration from one locked block to another new friends are appended, but old ones are not removed. For updating all the boxes in a building, it'd be much nicer if the old friends were also removed (the behaviour I expected).

Unsure if this should be a configurable setting, or the behaviour simply changed.

@TheDiscordian TheDiscordian added the enhancement New feature or request label Feb 16, 2024
@spnda
Copy link
Owner

spnda commented Feb 17, 2024

Hmm, reading the code this is actually what's supposed to happen.

/**
* Set a new list of FriendHandler for the friends list.
*/
public void setFriends(@NotNull final List<FriendHandler> friends) {
container.removeKey(friendNbtKey);
friends.forEach(this::addFriend);
}

I've talked to the author of NBT-API and he says this seems like wrong behavior. I think the code will have to be refactored a bit and perhaps that could fix it again? I'll do some tests tomorrow and see if I can fix this.

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

No branches or pull requests

2 participants