Files
HuskHomes/common/src/main/java/net/william278/huskhomes/player/UserData.java
T
2022-05-24 02:13:03 +01:00

45 lines
1.3 KiB
Java

package net.william278.huskhomes.player;
import org.jetbrains.annotations.NotNull;
import java.util.UUID;
/**
* Extension of a {@link User} that contains persistently-stored additional user data
* (home slots, teleport ignoring status & rtp cooldown)
*/
public class UserData extends User {
/**
* The number of slots this user has consumed (bought) in total, used for economy checks
*/
public int homeSlots;
/**
* Whether this user is ignoring incoming /tpa and /tpahere requests
*/
public boolean isIgnoringTeleports;
/**
* A timestamp indicating when the user can use the /rtp command next
*/
public long rtpCooldown;
public UserData(@NotNull UUID uuid, @NotNull String username,
int homeSlots, boolean isIgnoringTeleports, long rtpCooldown) {
super(uuid, username);
this.homeSlots = homeSlots;
this.isIgnoringTeleports = isIgnoringTeleports;
this.rtpCooldown = rtpCooldown;
}
public UserData(@NotNull User user,
int homeSlots, boolean isIgnoringTeleports, long rtpCooldown) {
super(user.uuid, user.username);
this.homeSlots = homeSlots;
this.isIgnoringTeleports = isIgnoringTeleports;
this.rtpCooldown = rtpCooldown;
}
}