Package com.alessiodp.core.common.user
Interface User
-
- All Superinterfaces:
OfflineUser
public interface User extends OfflineUser
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidchat(@NotNull String message)Perform a chat message by the user@Nullable StringgetDisplayName()Get the display name of the user@Nullable StringgetDynamicPermission(@NotNull String startsWith)Get a specific permission that starts with given string and returns that permission without the starter part@Nullable ADPLocationgetLocation()Get the user location, if possibledefault booleanhasPermission(@NotNull ADPPermission permission)Does the user have the permission?booleanhasPermission(@NotNull String permission)Does the user have the permission?default booleanisInsideNetwork()Is the user inside the current network?default booleanisOnline()Is the user online?booleanisPlayer()Is a player?booleanisVanished()Is the player vanished?voidplaySound(@NotNull String sound, double volume, double pitch)Play a soundvoidsendMessage(@NotNull String message, boolean colorTranslation)Send a message to the uservoidsendTitle(@NotNull String message, int fadeInTime, int showTime, int fadeOutTime)Send a title to the user-
Methods inherited from interface com.alessiodp.core.common.user.OfflineUser
getName, getPlugin, getUUID, isBanned, isOperator
-
-
-
-
Method Detail
-
isOnline
default boolean isOnline()
Description copied from interface:OfflineUserIs the user online?- Specified by:
isOnlinein interfaceOfflineUser- Returns:
- true if the user is online
-
hasPermission
default boolean hasPermission(@NotNull @NotNull ADPPermission permission)Does the user have the permission?- Parameters:
permission- the permission to check- Returns:
- true if the user have the given permission
-
hasPermission
boolean hasPermission(@NotNull @NotNull String permission)Does the user have the permission?- Parameters:
permission- the permission to check- Returns:
- true if the user have the given permission
-
getDynamicPermission
@Nullable @Nullable String getDynamicPermission(@NotNull @NotNull String startsWith)
Get a specific permission that starts with given string and returns that permission without the starter part- Parameters:
startsWith- the start of the permission to find- Returns:
- permission name
-
isPlayer
boolean isPlayer()
Is a player? (Check if is a player or a console user)- Returns:
- true if is a player
-
getDisplayName
@Nullable @Nullable String getDisplayName()
Get the display name of the user- Returns:
- the display name of the user
-
sendMessage
void sendMessage(@NotNull @NotNull String message, boolean colorTranslation)Send a message to the user- Parameters:
message- the message to sendcolorTranslation- toggle color translation
-
sendTitle
void sendTitle(@NotNull @NotNull String message, int fadeInTime, int showTime, int fadeOutTime)Send a title to the user- Parameters:
message- the message to sendfadeInTime- fade time in millisecondsshowTime- show time in millisecondsfadeOutTime- fade out time in milliseconds
-
chat
void chat(@NotNull @NotNull String message)Perform a chat message by the user- Parameters:
message- the message to send
-
playSound
void playSound(@NotNull @NotNull String sound, double volume, double pitch)Play a sound- Parameters:
sound- the name of the soundvolume- the volume of the soundpitch- the pitch of the sound
-
isVanished
boolean isVanished()
Is the player vanished?- Returns:
- true if the player is vanished
-
getLocation
@Nullable @Nullable ADPLocation getLocation()
Get the user location, if possible- Returns:
- the location otherwise null
-
isInsideNetwork
default boolean isInsideNetwork()
Is the user inside the current network?- Returns:
- true if the user is inside the current network
-
-