Networking rework, further refactoring

This commit is contained in:
William278 committed 2023-03-02 22:51:50 +00:00
1 parent 1cebdac9b8
commit 4c90e5498c
88 files changed
+1116 -1364

No files matched your search

@@ -0,0 +1,46 @@
package net.william278.huskhomes.user;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
/**
* Represents a user who has data saved in the database
*/
public class User {
@NotNull
private final UUID uuid;
@NotNull
private final String username;
/**
* Get a user from a {@link UUID} and username
*
* @param uuid Minecraft account {@link UUID} of the player
* @param username Username of the player
*/
public User(@NotNull UUID uuid, @NotNull String username) {
this.uuid = uuid;
this.username = username;
}
@Override
public boolean equals(@NotNull Object obj) {
if (obj instanceof User user) {
return user.getUuid().equals(getUuid());
}
return super.equals(obj);
}
@NotNull
public UUID getUuid() {
return uuid;
}
@NotNull
public String getUsername() {
return username;
}
}