-
Notifications
You must be signed in to change notification settings - Fork 3
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
Individual person data by server #21
Comments
I feel like this might be out of scope for the library, and should be implemented by the developer using this library, using metadata. |
How can this be implemented by the client dev? |
In the metadata, and by performing checks on the metadata when determining if some is a friend or not.
No. There's no good way to retain compatibility between clients without either forcing the server-based system on them, making the entire library depend on minecraft and having the user install a separate mod for the mixins needed for this. |
Okay I get what you mean now. Saving that in meta data will just get way too complicated. Use case: |
In the metadata. It won't get too complicated. In fact, it's extremely easy to do: // this code is called when a new friend is added
JsonObject meta = new JsonObject();
meta.add("server", Minecraft.getMinecraft().currentServerData.address);
GameProfilePerson person = new GameProfilePerson(gameProfile, value, meta);
UniversalFriends.addPerson(person); // when looping through friends
UniversalFriends.selector().metadata(meta -> {
if (meta.has("server") {
return meta.get("server").getAsString().equals(Minecraft.getMinecraft().currentServerData.address);
}
return false;
}.selectMatchingAll().forEach(person -> {
// perform some action on this person
}); |
I didn't mean hard to implement. I meant complicated if you store even more values. Of course a client can implement that but my train of thought is that certain attributs have a hirachy. Merging the hirachy might complicate things since you might loose data for example. use case: By complicated I mean the way you would be trying to fix this issue. For instance you could save the meta data in a hirachy too. But other clients dont have that. And where would you store variables such as lifetime. Putting it within the sub metadata will make it disappear for other clients when they dont adapt. Besides this will make it hard to oversee what metadata variables exist. I also just notice that this might be a bigger problem than just stated. |
maybe that won't be as easy. but IMO it should be possible to have different friends for different servers. I get that not many players need this but when there are players that play on multiple servers and maybe go full hostile on one it might not be great to have marked your friend as an enemy on another server where you want to be more friendly.
The text was updated successfully, but these errors were encountered: