mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 20:00:46 +00:00
[trunk] New base class for User for storing all data.
More data for future use. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1143 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
46e6276c63
commit
3908443717
1 changed files with 91 additions and 1 deletions
|
@ -42,8 +42,11 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||||
ignoredPlayers = getIgnoredPlayers();
|
ignoredPlayers = getIgnoredPlayers();
|
||||||
godmode = getGodModeEnabled();
|
godmode = getGodModeEnabled();
|
||||||
muted = getMuted();
|
muted = getMuted();
|
||||||
|
muteTimeout = _getMuteTimeout();
|
||||||
jailed = getJailed();
|
jailed = getJailed();
|
||||||
|
jailTimeout = _getJailTimeout();
|
||||||
|
lastLogin = _getLastLogin();
|
||||||
|
lastLogout = _getLastLogout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getMoney() {
|
public double getMoney() {
|
||||||
|
@ -239,6 +242,10 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||||
return config.getStringList("mail", new ArrayList<String>());
|
return config.getStringList("mail", new ArrayList<String>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getMails() {
|
||||||
|
return mails;
|
||||||
|
}
|
||||||
|
|
||||||
public void setMails(List<String> mails) {
|
public void setMails(List<String> mails) {
|
||||||
if (mails == null) {
|
if (mails == null) {
|
||||||
config.removeProperty("mail");
|
config.removeProperty("mail");
|
||||||
|
@ -384,6 +391,22 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long muteTimeout;
|
||||||
|
|
||||||
|
private long _getMuteTimeout() {
|
||||||
|
return config.getLong("timestamps.mute", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMuteTimeout() {
|
||||||
|
return muteTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMuteTimeout(long time) {
|
||||||
|
muteTimeout = time;
|
||||||
|
config.setProperty("timestamps.mute", time);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
private boolean jailed;
|
private boolean jailed;
|
||||||
|
|
||||||
private boolean getJailed() {
|
private boolean getJailed() {
|
||||||
|
@ -406,6 +429,73 @@ public abstract class UserData extends PlayerExtension implements IConf {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long jailTimeout;
|
||||||
|
|
||||||
|
private long _getJailTimeout() {
|
||||||
|
return config.getLong("timestamps.jail", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getJailTimeout() {
|
||||||
|
return jailTimeout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJailTimeout(long time) {
|
||||||
|
jailTimeout = time;
|
||||||
|
config.setProperty("timestamps.jail", time);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getBanReason() {
|
||||||
|
return config.getString("ban.reason");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBanReason(String reason) {
|
||||||
|
config.setProperty("ban.reason", reason);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getBanTimeout() {
|
||||||
|
return config.getLong("ban.timeout", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBanTimeout(long time) {
|
||||||
|
config.setProperty("ban.timeout", time);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
private long lastLogin;
|
||||||
|
|
||||||
|
private long _getLastLogin() {
|
||||||
|
return config.getLong("timestamps.login", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getLastLogin() {
|
||||||
|
return lastLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastLogin(long time) {
|
||||||
|
lastLogin = time;
|
||||||
|
config.setProperty("timestamps.login", time);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
private long lastLogout;
|
||||||
|
|
||||||
|
private long _getLastLogout() {
|
||||||
|
return config.getLong("timestamps.logout", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getLastLogout() {
|
||||||
|
return lastLogout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLastLogout(long time) {
|
||||||
|
lastLogout = time;
|
||||||
|
config.setProperty("timestamps.logout", time);
|
||||||
|
config.save();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateConfig() {
|
private void updateConfig() {
|
||||||
if (config.hasProperty("home") && !config.hasProperty("home.default")) {
|
if (config.hasProperty("home") && !config.hasProperty("home.default")) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
Loading…
Reference in a new issue