Package net.lewmc.essence.core
Class UtilPlayer
java.lang.Object
net.lewmc.essence.core.UtilPlayer
Essence's player utility.
-
Constructor Summary
ConstructorsConstructorDescriptionUtilPlayer(Essence plugin, org.bukkit.command.CommandSender cs) The Player utility. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreates a player data file for the given p.getPlayerDisplayname(org.bukkit.command.CommandSender cs) Gets a player's display name.Fetches a player's prefix.Fetches a player's suffix.booleanremovePlayerDisplayname(org.bukkit.command.CommandSender cs) Sets a player's display name.booleansetGamemode(org.bukkit.command.CommandSender cs, org.bukkit.entity.Player p, org.bukkit.GameMode gamemode) Sets the player's gamemode.booleansetPlayerDisplayname(org.bukkit.command.CommandSender cs, String nickname) Sets a player's display name.booleanUpdates a player data file for the given p.booleanupdatePlayerData(boolean acceptingTeleportRequests, double balance, boolean acceptingPayments) Updates a player data file for the given p.
-
Constructor Details
-
UtilPlayer
The Player utility.- Parameters:
plugin- Reference to the main Essence class.cs- CommandSender - The user who sent the command.
-
-
Method Details
-
setGamemode
public boolean setGamemode(org.bukkit.command.CommandSender cs, org.bukkit.entity.Player p, org.bukkit.GameMode gamemode) Sets the player's gamemode.- Parameters:
cs- CommandSender - The executor of the command.p- Player - The target player (might be self).gamemode- GameMode - The gamemode to set the player to.- Returns:
- boolean - Success
-
createPlayerData
public boolean createPlayerData()Creates a player data file for the given p.- Returns:
- boolean - If the operation was successful.
-
updatePlayerData
public boolean updatePlayerData(boolean acceptingTeleportRequests, double balance, boolean acceptingPayments) Updates a player data file for the given p.- Parameters:
acceptingTeleportRequests- boolean - Is the player accepting teleport requests?balance- double - What is the player's balance?acceptingPayments- boolean - Is the player accepting payments?- Returns:
- boolean - If the operation was successful.
-
updatePlayerData
public boolean updatePlayerData()Updates a player data file for the given p.- Returns:
- boolean - If the operation was successful.
-
getPlayerPrefix
Fetches a player's prefix.- Returns:
- String - The player's prefix (might be blank).
-
getPlayerSuffix
Fetches a player's suffix.- Returns:
- String - The player's suffix (might be blank).
-
getPlayerDisplayname
Gets a player's display name.- Parameters:
cs- CommandSender - The player to check.- Returns:
- The display name.
-
setPlayerDisplayname
Sets a player's display name.- Parameters:
cs- CommandSender - The p.nickname- String - The nickname- Returns:
- true/false success.
-
removePlayerDisplayname
public boolean removePlayerDisplayname(org.bukkit.command.CommandSender cs) Sets a player's display name.- Parameters:
cs- CommandSender - The p.- Returns:
- true/false success.
-