New method for instantiating User objects

This commit is contained in:
William278 committed 2023-03-24 12:45:56 +00:00
1 parent 8d8420541d
commit 9fd3a0988d
3 files changed
+14 -9

No files matched your search

@@ -21,11 +21,16 @@ public class User {
* @param uuid Minecraft account {@link UUID} of the player
* @param username Username of the player
*/
public User(@NotNull UUID uuid, @NotNull String username) {
protected User(@NotNull UUID uuid, @NotNull String username) {
this.uuid = uuid;
this.username = username;
}
@NotNull
public static User of(@NotNull UUID uuid, @NotNull String username) {
return new User(uuid, username);
}
@Override
public boolean equals(@NotNull Object obj) {
if (obj instanceof User user) {