Package pro.cloudnode.smp.cloudnodemsg
Class Message
java.lang.Object
pro.cloudnode.smp.cloudnodemsg.Message
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The context in which this message is sent -
Field Summary
Modifier and TypeFieldDescriptionstatic final @NotNull NamespacedKey
static final @NotNull NamespacedKey
static final @NotNull OfflinePlayer
static final @NotNull NamespacedKey
static final @NotNull NamespacedKey
static final @NotNull NamespacedKey
-
Constructor Summary
ConstructorDescriptionMessage
(@NotNull OfflinePlayer sender, @NotNull OfflinePlayer recipient, @NotNull String message) Message
(@NotNull OfflinePlayer sender, @NotNull OfflinePlayer recipient, @NotNull Component message) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
createChannel
(@NotNull Player player, @NotNull OfflinePlayer recipient) Create DM channel to playerstatic void
createTeamChannel
(@NotNull Player player) Team message channelstatic void
exitChannel
(@NotNull Player player) Exit DM channelstatic void
exitTeamChannel
(@NotNull Player player) Exit team message channelstatic @NotNull Optional<@NotNull OfflinePlayer>
getChannel
(@NotNull Player player) Get DM channel recipientgetIgnored
(@NotNull Player player) Get UUID set of ignored players from PDC stringstatic @NotNull Optional<@NotNull OfflinePlayer>
getReplyTo
(@NotNull OfflinePlayer player) static boolean
hasChannel
(@NotNull Player player) Check whether player has DM channelstatic boolean
hasChannel
(@NotNull Player player, @NotNull OfflinePlayer recipient) Check whether player has DM channel with recipientstatic boolean
hasTeamChannel
(@NotNull Player player) Check whether player has a team message channelstatic void
ignore
(@NotNull Player player, @NotNull OfflinePlayer ignore) Ignore a playerstatic void
incomingDisable
(@NotNull Player player) Denies player to receive private messagesstatic void
incomingEnable
(@NotNull Player player) Allows player to receive private messagesstatic boolean
isIgnored
(@NotNull Player player, @NotNull OfflinePlayer ignored) Check if a player is ignoredstatic boolean
isIncomingEnabled
(@NotNull Player player) Check if a player allows private messagesstatic @NotNull OfflinePlayer
offlinePlayer
(@NotNull CommandSender executor) static void
removeReplyTo
(@NotNull OfflinePlayer player) void
send()
void
send
(@NotNull Message.Context context) static void
sendMessage
(@NotNull OfflinePlayer recipient, @NotNull Component message) static void
sendSpyMessage
(@NotNull OfflinePlayer sender, @NotNull OfflinePlayer recipient, @NotNull Component message) Send social spy to online players with permissionstatic void
setReplyTo
(@NotNull OfflinePlayer sender, @NotNull OfflinePlayer recipient) static void
unignore
(@NotNull Player player, @NotNull OfflinePlayer ignored) Unignore a player
-
Field Details
-
console
-
REPLY_TO
-
IGNORED_PLAYERS
-
CHANNEL_RECIPIENT
-
CHANNEL_TEAM
-
INCOMING_ENABLED
-
-
Constructor Details
-
Message
public Message(@NotNull @NotNull OfflinePlayer sender, @NotNull @NotNull OfflinePlayer recipient, @NotNull @NotNull Component message) -
Message
public Message(@NotNull @NotNull OfflinePlayer sender, @NotNull @NotNull OfflinePlayer recipient, @NotNull @NotNull String message)
-
-
Method Details
-
send
- Throws:
InvalidPlayerError
-
send
- Throws:
InvalidPlayerError
-
offlinePlayer
@NotNull public static @NotNull OfflinePlayer offlinePlayer(@NotNull @NotNull CommandSender executor) -
sendMessage
public static void sendMessage(@NotNull @NotNull OfflinePlayer recipient, @NotNull @NotNull Component message) -
sendSpyMessage
public static void sendSpyMessage(@NotNull @NotNull OfflinePlayer sender, @NotNull @NotNull OfflinePlayer recipient, @NotNull @NotNull Component message) Send social spy to online players with permission -
setReplyTo
public static void setReplyTo(@NotNull @NotNull OfflinePlayer sender, @NotNull @NotNull OfflinePlayer recipient) -
getReplyTo
@NotNull public static @NotNull Optional<@NotNull OfflinePlayer> getReplyTo(@NotNull @NotNull OfflinePlayer player) -
removeReplyTo
-
getIgnored
Get UUID set of ignored players from PDC string- Parameters:
player
- The player
-
isIgnored
public static boolean isIgnored(@NotNull @NotNull Player player, @NotNull @NotNull OfflinePlayer ignored) Check if a player is ignored- Parameters:
player
- The playerignored
- The ignored player
-
ignore
Ignore a player- Parameters:
player
- The playerignore
- The player to ignore
-
unignore
public static void unignore(@NotNull @NotNull Player player, @NotNull @NotNull OfflinePlayer ignored) Unignore a player- Parameters:
player
- The playerignored
- The player to unignore
-
incomingEnable
Allows player to receive private messages- Parameters:
player
- The player
-
incomingDisable
Denies player to receive private messages- Parameters:
player
- The player
-
isIncomingEnabled
Check if a player allows private messages- Parameters:
player
- The player
-
createChannel
public static void createChannel(@NotNull @NotNull Player player, @NotNull @NotNull OfflinePlayer recipient) Create DM channel to player- Parameters:
player
- The player (you)recipient
- The other end of the channel
-
exitChannel
Exit DM channel- Parameters:
player
- The player (you)
-
getChannel
@NotNull public static @NotNull Optional<@NotNull OfflinePlayer> getChannel(@NotNull @NotNull Player player) Get DM channel recipient- Parameters:
player
- The player
-
hasChannel
public static boolean hasChannel(@NotNull @NotNull Player player, @NotNull @NotNull OfflinePlayer recipient) Check whether player has DM channel with recipient- Parameters:
player
- The playerrecipient
- The recipient
-
hasChannel
Check whether player has DM channel- Parameters:
player
- The player
-
createTeamChannel
Team message channel- Parameters:
player
- The player
-
exitTeamChannel
Exit team message channel- Parameters:
player
- The player
-
hasTeamChannel
Check whether player has a team message channel- Parameters:
player
- The player
-