public class UserData extends Object
Constructor and Description |
---|
UserData(org.bukkit.OfflinePlayer player,
DemographicsData demData)
Creates a new UserData object with the variables inside a OfflinePlayer
object.
|
UserData(org.bukkit.entity.Player player,
DemographicsData demData)
Creates a new UserData object with the variables inside a Player object.
|
UserData(UserData data)
Creates a new UserData object with copied values.
|
UserData(UUID uuid,
long reg,
org.bukkit.Location loc,
boolean op,
org.bukkit.GameMode lastGM,
DemographicsData demData,
String name,
boolean online)
Creates a new UserData object with given values and default values.
|
Modifier and Type | Method and Description |
---|---|
void |
access()
Accesses the UserData object to protect it from being cleared.
|
void |
addIpAddress(InetAddress ip)
Adds an to the ips Set if it is not null or the set doesn't contain it.
|
void |
addIpAddresses(Collection<InetAddress> addIps)
Adds multiple ips to the ips set if they're not null.
|
void |
addLocation(org.bukkit.Location loc)
Adds a location to the locations list.
|
void |
addLocations(Collection<org.bukkit.Location> addLocs)
Adds multiple locations to the locations list.
|
boolean |
addNickname(String nick)
Adds a nickname to the nicknames Set.
|
void |
addNicknames(Collection<String> addNicks)
Adds nicknames to the nicknames Set.
|
void |
addPlayerKill(KillData kill)
Add a Killdata to player's kills list.
|
void |
addSession(SessionData session)
Adds a new SessionData to the sessions list.
|
void |
addSessions(Collection<SessionData> sessions)
Adds SessionData objects to the sessions list.
|
boolean |
equals(Object obj) |
SessionData |
getCurrentSession()
Gets the current session.
|
int |
getDeaths()
Get how many times the player has died.
|
DemographicsData |
getDemData()
Get the DemographicsData of the user.
|
Map<org.bukkit.GameMode,Long> |
getGmTimes()
Get the GMTimes Map.
|
Set<InetAddress> |
getIps()
Get the InetAddress Set.
|
org.bukkit.GameMode |
getLastGamemode()
Get the last Gamemode that the user was seen in.
|
long |
getLastGmSwapTime()
Get the last time a Gamemode time was updated.
|
String |
getLastNick()
Get the last nickname the user has set.
|
long |
getLastPlayed()
Get the Epoch millisecond the player was last seen.
|
org.bukkit.Location |
getLocation()
Used to get the latest location.
|
List<org.bukkit.Location> |
getLocations()
Get the list of all locations inside the UserData object.
|
int |
getLoginTimes()
Get how many times the player has logged in.
|
int |
getMobKills()
Get how many mob kills the player has.
|
String |
getName()
Get the username of the player.
|
Set<String> |
getNicknames()
Get the nickname String Set.
|
List<KillData> |
getPlayerKills()
Get the player kills list.
|
long |
getPlayTime()
Get the playtime in milliseconds.
|
long |
getRegistered()
Get the Epoch millisecond the player registered.
|
List<SessionData> |
getSessions()
Get the sessions of a player.
|
int |
getTimesKicked()
Get how many times the player has been kicked.
|
UUID |
getUuid()
Used to get the UUID of the player.
|
boolean |
isAccessed()
Checks whether or not the UserData object is accessed by different save
processes.
|
boolean |
isBanned()
Is the user Banned?
|
boolean |
isOnline()
Is the player online?
|
boolean |
isOp()
Is the user Operator?
|
void |
setAllGMTimes(long survivalTime,
long creativeTime,
long adventureTime,
long spectatorTime)
Set every GameMode's millisecond value.
|
void |
setClearAfterSave(boolean clearAfterSave)
Set wether or not the object should be cleared from cache after it has
been saved.
|
void |
setCurrentSession(SessionData session)
Sets the current session.
|
void |
setDeaths(int deaths)
Set how many times the player has died.
|
void |
setDemData(DemographicsData demData)
Set the DemographicsData of the user.
|
void |
setGMTime(org.bukkit.GameMode gm,
long time)
Set a specific GameMode's millisecond value.
|
void |
setGmTimes(Map<org.bukkit.GameMode,Long> gmTimes)
Set the GM Times map containing playtime in each gamemode.
|
void |
setIps(Set<InetAddress> ips)
Set the ips set.
|
void |
setIsOp(boolean isOp)
Set whether or not player is op.
|
void |
setLastGamemode(org.bukkit.GameMode lastGamemode)
Set the last gamemode the user was seen in.
|
void |
setLastGmSwapTime(long lastGmSwapTime)
Set the last time a Gamemode time was updated.
|
void |
setLastNick(String lastNick)
Set the last nickname the user has set.
|
void |
setLastPlayed(long lastPlayed)
Set the time the user was last seen.
|
void |
setLocation(org.bukkit.Location location)
Set the current location.
|
void |
setLocations(List<org.bukkit.Location> locations)
Set the list of locations the user has been in.
|
void |
setLoginTimes(int loginTimes)
Set how many times the user has logged in.
|
void |
setMobKills(int mobKills)
Get how many mob kills the player has.
|
void |
setName(String name)
Set the username of the user.
|
void |
setNicknames(Set<String> nicknames)
Set the nicknames set.
|
void |
setPlayerKills(List<KillData> playerKills)
Set the playerkills list.
|
void |
setPlayTime(long playTime)
Set the time the user has been playing.
|
void |
setRegistered(long registered)
Set the time the user was registered.
|
void |
setTimesKicked(int timesKicked)
Set how many times the user has been kicked.
|
void |
setUuid(UUID uuid)
Set the UUID.
|
boolean |
shouldClearAfterSave()
Check wether or not the object should be cleared from cache after it has
been saved.
|
void |
stopAccessing()
Stops accessing the object so that it can now be cleared.
|
String |
toString() |
void |
updateBanned(boolean isBanned)
Changes the value of isBanned.
|
public UserData(UUID uuid, long reg, org.bukkit.Location loc, boolean op, org.bukkit.GameMode lastGM, DemographicsData demData, String name, boolean online)
uuid
- UUID of the playerreg
- Epoch millisecond the player registered.loc
- Current Location in a world.op
- Is the player op? (true/false)lastGM
- last GameMode the player was seen in.demData
- Demographics data.name
- Name of the player.online
- Is the player online?public UserData(org.bukkit.entity.Player player, DemographicsData demData)
player
- Player object.demData
- Demographics data.public UserData(org.bukkit.OfflinePlayer player, DemographicsData demData)
player
- OfflinePlayer object.demData
- Demographics data.public UserData(UserData data)
data
- UserData to copy into the new object.public void addIpAddress(InetAddress ip)
ip
- InetAddress of the player.public void addIpAddresses(Collection<InetAddress> addIps)
addIps
- a Collection of InetAddresses the player has logged from.public void addLocation(org.bukkit.Location loc)
loc
- Location of the player.public void addLocations(Collection<org.bukkit.Location> addLocs)
addLocs
- Collection of Locations.public boolean addNickname(String nick)
nick
- Displayname of the player.public void addNicknames(Collection<String> addNicks)
addNicks
- Collection of nicknames.public void setGMTime(org.bukkit.GameMode gm, long time)
gm
- GameMode.time
- Milliseconds spent in the gamemode.public void setAllGMTimes(long survivalTime, long creativeTime, long adventureTime, long spectatorTime)
survivalTime
- ms spent in SURVIVALcreativeTime
- ms spent in CREATIVEadventureTime
- ms spent in ADVENTUREspectatorTime
- ms spent in SPECTATORpublic void addSession(SessionData session)
session
- SessionData objectpublic void addSessions(Collection<SessionData> sessions)
sessions
- Collection of SessionData objects.public void setCurrentSession(SessionData session)
session
- SessionData object, no restrictions.public SessionData getCurrentSession()
public void updateBanned(boolean isBanned)
isBanned
- Is the player banned?public boolean isAccessed()
public void access()
public void stopAccessing()
public UUID getUuid()
public org.bukkit.Location getLocation()
public List<org.bukkit.Location> getLocations()
public Set<InetAddress> getIps()
public Set<String> getNicknames()
public long getRegistered()
public long getLastPlayed()
public long getPlayTime()
public int getLoginTimes()
public int getTimesKicked()
public Map<org.bukkit.GameMode,Long> getGmTimes()
public long getLastGmSwapTime()
public org.bukkit.GameMode getLastGamemode()
public boolean isOp()
public boolean isBanned()
public DemographicsData getDemData()
public String getName()
public void setUuid(UUID uuid)
uuid
- UUIDpublic void setLocation(org.bukkit.Location location)
location
- a location in the world.public void setLocations(List<org.bukkit.Location> locations)
locations
- a list of Locations.public void setIps(Set<InetAddress> ips)
ips
- ips of the user.public void setNicknames(Set<String> nicknames)
nicknames
- nicknames of the user.public void setRegistered(long registered)
registered
- Epoch millisecond of register time.public void setLastPlayed(long lastPlayed)
lastPlayed
- Epoch millisecond of last seen moment.public void setPlayTime(long playTime)
playTime
- Time in ms.public void setLoginTimes(int loginTimes)
loginTimes
- 0 to Int.MAXpublic void setTimesKicked(int timesKicked)
timesKicked
- 0 to Int.MAXpublic void setGmTimes(Map<org.bukkit.GameMode,Long> gmTimes)
gmTimes
- Map containing SURVIVAL, CREATIVE, ADVENTURE and SPECTATOR
(After 1.8) keys.public void setLastGmSwapTime(long lastGmSwapTime)
lastGmSwapTime
- Epoch millisecond a gm time was updated.public void setLastGamemode(org.bukkit.GameMode lastGamemode)
lastGamemode
- gamemode.public void setIsOp(boolean isOp)
isOp
- operator?public void setDemData(DemographicsData demData)
demData
- demographics data.public void setName(String name)
name
- username.public boolean isOnline()
public int getMobKills()
public void setMobKills(int mobKills)
mobKills
- 0 to Int.MAXpublic List<KillData> getPlayerKills()
public void setPlayerKills(List<KillData> playerKills)
playerKills
- list of players kills.public void addPlayerKill(KillData kill)
kill
- KillData representing a player kill.public int getDeaths()
public void setDeaths(int deaths)
deaths
- 0 to Int.MAXpublic List<SessionData> getSessions()
public String getLastNick()
public void setLastNick(String lastNick)
lastNick
- last nickname used.public boolean shouldClearAfterSave()
public void setClearAfterSave(boolean clearAfterSave)
clearAfterSave
- true/falseCopyright © 2017. All rights reserved.