Package com.github.mafelp.accounts
Class Account
java.lang.Object
com.github.mafelp.accounts.Account
public class Account
extends java.lang.Object
The method that stores all necessary information about an account with linked discord user and
minecraft player.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
mentionTag
The tag used to mention a DiscordUser
in a discord message.private org.bukkit.OfflinePlayer
player
The minecraftOfflinePlayer
to link the discordUser
to.private java.util.UUID
playerUUID
The UUID of the minecraftplayer
.private org.javacord.api.entity.user.User
user
The discord userprivate long
userID
the discord ID of theuser
.private java.lang.String
username
The name of the account. -
Constructor Summary
Constructors Constructor Description Account(org.javacord.api.entity.user.User user, org.bukkit.OfflinePlayer player)
The constructor to create an account from a minecraftplayerUUID
and a discorduserID
. -
Method Summary
Modifier and Type Method Description static java.util.Optional<Account>
getByDiscordUser(org.javacord.api.entity.user.User user)
The method to get anAccount
by theUser
it belongs to.static java.util.Optional<Account>
getByPlayer(org.bukkit.OfflinePlayer player)
The method to get anAccount
by theOfflinePlayer
it belongs to.static java.util.Optional<Account>
getByUsername(java.lang.String username)
java.lang.String
getMentionTag()
The getter for thementionTag
.org.bukkit.OfflinePlayer
getPlayer()
The getter for theplayer
.java.util.UUID
getPlayerUUID()
The getter for theplayerUUID
.org.javacord.api.entity.user.User
getUser()
The getter for theuser
.long
getUserID()
The getter for theuserID
.java.lang.String
getUsername()
The getter for theusername
.Account
setUsername(java.lang.String username)
The setter for theusername
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
user
private final org.javacord.api.entity.user.User userThe discord user -
userID
private final long userIDthe discord ID of theuser
. -
username
private java.lang.String usernameThe name of the account. The default is the discord name of theuser
. -
mentionTag
private final java.lang.String mentionTagThe tag used to mention a DiscordUser
in a discord message. -
player
private final org.bukkit.OfflinePlayer playerThe minecraftOfflinePlayer
to link the discordUser
to. -
playerUUID
private final java.util.UUID playerUUIDThe UUID of the minecraftplayer
.
-
-
Constructor Details
-
Account
public Account(org.javacord.api.entity.user.User user, org.bukkit.OfflinePlayer player)The constructor to create an account from a minecraftplayerUUID
and a discorduserID
.- Parameters:
user
- The discordUser
to link this account to.player
- The minecraftPlayer
to link this account to.
-
-
Method Details
-
getUser
public org.javacord.api.entity.user.User getUser()The getter for theuser
.- Returns:
- The
user
field.
-
getUserID
public long getUserID()The getter for theuserID
.- Returns:
- The
userID
field.
-
getUsername
public java.lang.String getUsername()The getter for theusername
.- Returns:
- The
username
field.
-
setUsername
The setter for theusername
.- Parameters:
username
- the username to set.- Returns:
- The
username
field.
-
getMentionTag
public java.lang.String getMentionTag()The getter for thementionTag
.- Returns:
- The
mentionTag
field.
-
getPlayer
public org.bukkit.OfflinePlayer getPlayer()The getter for theplayer
.- Returns:
- The
player
field.
-
getPlayerUUID
public java.util.UUID getPlayerUUID()The getter for theplayerUUID
.- Returns:
- The
playerUUID
field.
-
getByPlayer
The method to get anAccount
by theOfflinePlayer
it belongs to. -
getByDiscordUser
The method to get anAccount
by theUser
it belongs to. -
getByUsername
-