Class InMemoryNotificationService
- All Implemented Interfaces:
BaseService,NotificationService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classResult object for BossBar tick processing. -
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidcacheBossBar(UUID playerUUID, org.bukkit.boss.BossBar bossBar) Put a BossBar into cache.(package private) static voidClear all cached BossBars.(package private) static org.bukkit.boss.BossBargetCachedBossBar(UUID playerUUID) Get the cached BossBar for a player.getName()Get service name, this name will appear in the console or in the game.intVersion number, used to compare the version number of the registered service, currently not in use.(package private) static InMemoryNotificationService.BossBarTickResultprocessBossBarTick(org.bukkit.boss.BossBar bossBar, org.bukkit.entity.Player player, int seconds) Process a single tick of the BossBar progress animation.booleansendActionBarNotification(org.bukkit.entity.Player player, String message) booleansendBossBarNotification(org.bukkit.entity.Player player, String message) Send a boss bar notification to a playerbooleansendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds) Send a boss bar notification to a playerbooleansendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.boss.BossBar bossBar) Send a boss bar notification to a playerbooleansendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.boss.BossBar bossBar, org.bukkit.Sound sound) Send a boss bar notification to a playerbooleansendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.Sound sound) Send a boss bar notification to a playerbooleansendMessageNotification(org.bukkit.entity.Player player, String message) Send a message notification to a playerbooleansendMessageNotification(org.bukkit.entity.Player player, String message, org.bukkit.Sound sound) Send a message notification to a playerbooleansendSubTitleNotification(org.bukkit.entity.Player player, String subtitle) Send a subtitle message notification to a playerbooleansendSubTitleNotification(org.bukkit.entity.Player player, String subtitle, org.bukkit.Sound sound) Send a subtitle message notification to a playerbooleansendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle) Send a title message notification to a playerbooleansendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle, org.bukkit.Sound sound) Send a title message notification to a playerbooleansendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle, org.bukkit.Sound sound, int fadeIn, int stay, int fadeOut) Send a title message notification to a playerbooleansendToastNotification(org.bukkit.entity.Player player, String icon, String message, Toast.Style style) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ultikits.ultitools.interfaces.BaseService
getResourceFolderName
-
Field Details
-
atedPlayer
-
-
Constructor Details
-
InMemoryNotificationService
public InMemoryNotificationService()
-
-
Method Details
-
getName
Description copied from interface:BaseServiceGet service name, this name will appear in the console or in the game.获取服务的名称,此名称将会出现在控制台或者游戏中
- Specified by:
getNamein interfaceBaseService- Returns:
- Service name
服务的名称
-
getAuthor
- Specified by:
getAuthorin interfaceBaseService- Returns:
- Author name
作者名称
-
getVersion
public int getVersion()Description copied from interface:BaseServiceVersion number, used to compare the version number of the registered service, currently not in use.用于对比注册服务的版本号,目前没啥卵用嘿嘿嘿
- Specified by:
getVersionin interfaceBaseService- Returns:
- service version
服务版本号
-
sendBossBarNotification
Description copied from interface:NotificationServiceSend a boss bar notification to a player向玩家发送Boss bar通知
- Specified by:
sendBossBarNotificationin interfaceNotificationService- Parameters:
player- The player to send the boss bar to要发送Boss bar的玩家
message- The message to send要发送的消息
- Returns:
- Whether the boss bar was sent successfully
是否成功发送了Boss bar
-
sendBossBarNotification
public boolean sendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds) Description copied from interface:NotificationServiceSend a boss bar notification to a player向玩家发送Boss bar通知
- Specified by:
sendBossBarNotificationin interfaceNotificationService- Parameters:
player- The player to send the boss bar to要发送Boss bar的玩家
message- The message to send要发送的消息
seconds- The duration of the boss bar in secondsBoss bar的持续时间(秒)
- Returns:
- Whether the boss bar was sent successfully
是否成功发送了Boss bar
-
sendBossBarNotification
public boolean sendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.Sound sound) Description copied from interface:NotificationServiceSend a boss bar notification to a player向玩家发送Boss bar通知
- Specified by:
sendBossBarNotificationin interfaceNotificationService- Parameters:
player- The player to send the boss bar to要发送Boss bar的玩家
message- The message to send要发送的消息
seconds- The duration of the boss bar in secondsBoss bar的持续时间(秒)
sound- The sound to play when the boss bar is sent发送Boss bar时播放的声音
- Returns:
- Whether the boss bar was sent successfully
是否成功发送了Boss bar
-
sendBossBarNotification
public boolean sendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.boss.BossBar bossBar) Description copied from interface:NotificationServiceSend a boss bar notification to a player向玩家发送Boss bar通知
- Specified by:
sendBossBarNotificationin interfaceNotificationService- Parameters:
player- The player to send the boss bar to要发送Boss bar的玩家
message- The message to send要发送的消息
seconds- The duration of the boss bar in secondsBoss bar的持续时间(秒)
bossBar- The boss bar to send要发送的Boss bar
- Returns:
- Whether the boss bar was sent successfully
是否成功发送了Boss bar
-
sendBossBarNotification
public boolean sendBossBarNotification(org.bukkit.entity.Player player, String message, int seconds, org.bukkit.boss.BossBar bossBar, org.bukkit.Sound sound) Description copied from interface:NotificationServiceSend a boss bar notification to a player向玩家发送Boss bar通知
- Specified by:
sendBossBarNotificationin interfaceNotificationService- Parameters:
player- The player to send the boss bar to要发送Boss bar的玩家
message- The message to send要发送的消息
seconds- The duration of the boss bar in secondsBoss bar的持续时间(秒)
bossBar- The boss bar to send要发送的Boss bar
sound- The sound to play when the boss bar is sent发送Boss bar时播放的声音
- Returns:
- Whether the boss bar was sent successfully
是否成功发送了Boss bar
-
processBossBarTick
static InMemoryNotificationService.BossBarTickResult processBossBarTick(org.bukkit.boss.BossBar bossBar, org.bukkit.entity.Player player, int seconds) Process a single tick of the BossBar progress animation. This method is extracted from BukkitRunnable for testability.- Parameters:
bossBar- the BossBar to updateplayer- the player viewing the BossBarseconds- the total duration in seconds- Returns:
- the result containing whether to cancel and the new progress
-
getCachedBossBar
Get the cached BossBar for a player. Used for testing. -
cacheBossBar
Put a BossBar into cache. Used for testing. -
clearBossBarCache
static void clearBossBarCache()Clear all cached BossBars. Used for testing. -
sendMessageNotification
Description copied from interface:NotificationServiceSend a message notification to a player向玩家发送消息通知
- Specified by:
sendMessageNotificationin interfaceNotificationService- Parameters:
player- The player to send the message to要发送消息的玩家
message- The message to send要发送的消息
- Returns:
- Whether the message was sent successfully
是否成功发送了消息
-
sendMessageNotification
public boolean sendMessageNotification(org.bukkit.entity.Player player, String message, org.bukkit.Sound sound) Description copied from interface:NotificationServiceSend a message notification to a player向玩家发送消息通知
- Specified by:
sendMessageNotificationin interfaceNotificationService- Parameters:
player- The player to send the message to要发送消息的玩家
message- The message to send要发送的消息
sound- The sound to play when the message is sent发送消息时播放的声音
- Returns:
- Whether the message was sent successfully
是否成功发送了消息
-
sendSubTitleNotification
Description copied from interface:NotificationServiceSend a subtitle message notification to a player向玩家发送副标题消息通知
- Specified by:
sendSubTitleNotificationin interfaceNotificationService- Parameters:
player- The player to send the subtitle to要发送副标题的玩家
subtitle- The subtitle to send要发送的副标题
- Returns:
- Whether the subtitle was sent successfully
是否成功发送了副标题
-
sendSubTitleNotification
public boolean sendSubTitleNotification(org.bukkit.entity.Player player, String subtitle, org.bukkit.Sound sound) Description copied from interface:NotificationServiceSend a subtitle message notification to a player向玩家发送副标题消息通知
- Specified by:
sendSubTitleNotificationin interfaceNotificationService- Parameters:
player- The player to send the subtitle to要发送副标题的玩家
subtitle- The subtitle to send要发送的副标题
sound- The sound to play when the subtitle is sent发送副标题时播放的声音
- Returns:
- Whether the subtitle was sent successfully
是否成功发送了副标题
-
sendTitleNotification
public boolean sendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle) Description copied from interface:NotificationServiceSend a title message notification to a player向玩家发送标题消息通知
- Specified by:
sendTitleNotificationin interfaceNotificationService- Parameters:
player- The player to send the title to要发送标题的玩家
title- The title to send要发送的标题
subtitle- The subtitle to send要发送的副标题
- Returns:
- Whether the title was sent successfully
是否成功发送了标题
-
sendTitleNotification
public boolean sendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle, org.bukkit.Sound sound) Description copied from interface:NotificationServiceSend a title message notification to a player向玩家发送标题消息通知
- Specified by:
sendTitleNotificationin interfaceNotificationService- Parameters:
player- The player to send the title to要发送标题的玩家
title- The title to send要发送的标题
subtitle- The subtitle to send要发送的副标题
sound- The sound to play when the title is sent发送标题时播放的声音
- Returns:
- Whether the title was sent successfully
是否成功发送了标题
-
sendTitleNotification
public boolean sendTitleNotification(org.bukkit.entity.Player player, String title, String subtitle, org.bukkit.Sound sound, int fadeIn, int stay, int fadeOut) Description copied from interface:NotificationServiceSend a title message notification to a player向玩家发送标题消息通知
- Specified by:
sendTitleNotificationin interfaceNotificationService- Parameters:
player- The player to send the title to要发送标题的玩家
title- The title to send要发送的标题
subtitle- The subtitle to send要发送的副标题
sound- The sound to play when the title is sent发送标题时播放的声音
fadeIn- The time in ticks for the title to fade in标题淡入的时间(ticks)
stay- The time in ticks for the title to stay标题停留的时间(ticks)
fadeOut- The time in ticks for the title to fade out标题淡出的时间(ticks)
- Returns:
- Whether the title was sent successfully
是否成功发送了标题
-
sendActionBarNotification
- Specified by:
sendActionBarNotificationin interfaceNotificationService
-
sendToastNotification
public boolean sendToastNotification(org.bukkit.entity.Player player, String icon, String message, Toast.Style style) - Specified by:
sendToastNotificationin interfaceNotificationService
-