|
@@ -31,7 +31,7 @@ public class NotificationManager {
|
|
* @param notificationType notifications defined type
|
|
* @param notificationType notifications defined type
|
|
* @param key the locale key for the notifications defined message
|
|
* @param key the locale key for the notifications defined message
|
|
*/
|
|
*/
|
|
- public static void sendPlayerInformation(Player player, NotificationType notificationType, String key) {
|
|
|
|
|
|
+ public void sendPlayerInformation(Player player, NotificationType notificationType, String key) {
|
|
if (UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
if (UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -44,7 +44,7 @@ public class NotificationManager {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public static boolean doesPlayerUseNotifications(Player player) {
|
|
|
|
|
|
+ public boolean doesPlayerUseNotifications(Player player) {
|
|
if (UserManager.getPlayer(player) == null)
|
|
if (UserManager.getPlayer(player) == null)
|
|
return false;
|
|
return false;
|
|
else
|
|
else
|
|
@@ -60,12 +60,12 @@ public class NotificationManager {
|
|
* @param key Locale Key for the string to use with this event
|
|
* @param key Locale Key for the string to use with this event
|
|
* @param values values to be injected into the locale string
|
|
* @param values values to be injected into the locale string
|
|
*/
|
|
*/
|
|
- public static void sendNearbyPlayersInformation(Player targetPlayer, NotificationType notificationType, String key, String... values)
|
|
|
|
|
|
+ public void sendNearbyPlayersInformation(Player targetPlayer, NotificationType notificationType, String key, String... values)
|
|
{
|
|
{
|
|
sendPlayerInformation(targetPlayer, notificationType, key, values);
|
|
sendPlayerInformation(targetPlayer, notificationType, key, values);
|
|
}
|
|
}
|
|
|
|
|
|
- public static void sendPlayerInformationChatOnly(Player player, String key, String... values)
|
|
|
|
|
|
+ public void sendPlayerInformationChatOnly(Player player, String key, String... values)
|
|
{
|
|
{
|
|
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
return;
|
|
return;
|
|
@@ -74,7 +74,7 @@ public class NotificationManager {
|
|
player.sendMessage(preColoredString);
|
|
player.sendMessage(preColoredString);
|
|
}
|
|
}
|
|
|
|
|
|
- public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values)
|
|
|
|
|
|
+ public void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values)
|
|
{
|
|
{
|
|
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
if(UserManager.getPlayer(player) == null || !UserManager.getPlayer(player).useChatNotifications())
|
|
return;
|
|
return;
|
|
@@ -87,7 +87,7 @@ public class NotificationManager {
|
|
sendNotification(player, customEvent);
|
|
sendNotification(player, customEvent);
|
|
}
|
|
}
|
|
|
|
|
|
- private static void sendNotification(Player player, McMMOPlayerNotificationEvent customEvent) {
|
|
|
|
|
|
+ private void sendNotification(Player player, McMMOPlayerNotificationEvent customEvent) {
|
|
if (customEvent.isCancelled())
|
|
if (customEvent.isCancelled())
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -104,7 +104,7 @@ public class NotificationManager {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private static McMMOPlayerNotificationEvent checkNotificationEvent(Player player, NotificationType notificationType, ChatMessageType destination, TextComponent message) {
|
|
|
|
|
|
+ private McMMOPlayerNotificationEvent checkNotificationEvent(Player player, NotificationType notificationType, ChatMessageType destination, TextComponent message) {
|
|
//Init event
|
|
//Init event
|
|
McMMOPlayerNotificationEvent customEvent = new McMMOPlayerNotificationEvent(player,
|
|
McMMOPlayerNotificationEvent customEvent = new McMMOPlayerNotificationEvent(player,
|
|
notificationType, message, destination, AdvancedConfig.getInstance().doesNotificationSendCopyToChat(notificationType));
|
|
notificationType, message, destination, AdvancedConfig.getInstance().doesNotificationSendCopyToChat(notificationType));
|
|
@@ -121,7 +121,7 @@ public class NotificationManager {
|
|
* @param skillName skill that leveled up
|
|
* @param skillName skill that leveled up
|
|
* @param newLevel new level of that skill
|
|
* @param newLevel new level of that skill
|
|
*/
|
|
*/
|
|
- public static void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) {
|
|
|
|
|
|
+ public void sendPlayerLevelUpNotification(McMMOPlayer mcMMOPlayer, PrimarySkillType skillName, int levelsGained, int newLevel) {
|
|
if (!mcMMOPlayer.useChatNotifications())
|
|
if (!mcMMOPlayer.useChatNotifications())
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -133,13 +133,13 @@ public class NotificationManager {
|
|
sendNotification(mcMMOPlayer.getPlayer(), customEvent);
|
|
sendNotification(mcMMOPlayer.getPlayer(), customEvent);
|
|
}
|
|
}
|
|
|
|
|
|
- public static void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) {
|
|
|
|
|
|
+ public void broadcastTitle(Server server, String title, String subtitle, int i1, int i2, int i3) {
|
|
for (Player player : server.getOnlinePlayers()) {
|
|
for (Player player : server.getOnlinePlayers()) {
|
|
player.sendTitle(title, subtitle, i1, i2, i3);
|
|
player.sendTitle(title, subtitle, i1, i2, i3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public static void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
|
|
|
|
|
|
+ public void sendPlayerUnlockNotification(McMMOPlayer mcMMOPlayer, SubSkillType subSkillType) {
|
|
if (!mcMMOPlayer.useChatNotifications())
|
|
if (!mcMMOPlayer.useChatNotifications())
|
|
return;
|
|
return;
|
|
|
|
|
|
@@ -163,7 +163,7 @@ public class NotificationManager {
|
|
*
|
|
*
|
|
* @param msg message fetched from locale
|
|
* @param msg message fetched from locale
|
|
*/
|
|
*/
|
|
- private static void sendAdminNotification(String msg) {
|
|
|
|
|
|
+ private void sendAdminNotification(String msg) {
|
|
//If its not enabled exit
|
|
//If its not enabled exit
|
|
if (!mcMMO.getConfigManager().getConfigAdmin().isSendAdminNotifications())
|
|
if (!mcMMO.getConfigManager().getConfigAdmin().isSendAdminNotifications())
|
|
return;
|
|
return;
|
|
@@ -184,7 +184,7 @@ public class NotificationManager {
|
|
* @param commandSender target command sender
|
|
* @param commandSender target command sender
|
|
* @param msg message fetched from locale
|
|
* @param msg message fetched from locale
|
|
*/
|
|
*/
|
|
- private static void sendAdminCommandConfirmation(CommandSender commandSender, String msg) {
|
|
|
|
|
|
+ private void sendAdminCommandConfirmation(CommandSender commandSender, String msg) {
|
|
commandSender.sendMessage(LocaleLoader.getString("Notifications.Admin.Format.Self", msg));
|
|
commandSender.sendMessage(LocaleLoader.getString("Notifications.Admin.Format.Self", msg));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -194,7 +194,7 @@ public class NotificationManager {
|
|
* @param commandSender the command user
|
|
* @param commandSender the command user
|
|
* @param sensitiveCommandType type of command issued
|
|
* @param sensitiveCommandType type of command issued
|
|
*/
|
|
*/
|
|
- public static void processSensitiveCommandNotification(CommandSender commandSender, SensitiveCommandType sensitiveCommandType, String... args) {
|
|
|
|
|
|
+ public void processSensitiveCommandNotification(CommandSender commandSender, SensitiveCommandType sensitiveCommandType, String... args) {
|
|
/*
|
|
/*
|
|
* Determine the 'identity' of the one who executed the command to pass as a parameters
|
|
* Determine the 'identity' of the one who executed the command to pass as a parameters
|
|
*/
|
|
*/
|
|
@@ -225,7 +225,7 @@ public class NotificationManager {
|
|
* @param existingArray the existing array to be copied to the new array at position [0]+1 relative to their original index
|
|
* @param existingArray the existing array to be copied to the new array at position [0]+1 relative to their original index
|
|
* @return the new array combining itemToAdd at the start and existing array elements following while retaining their order
|
|
* @return the new array combining itemToAdd at the start and existing array elements following while retaining their order
|
|
*/
|
|
*/
|
|
- public static String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
|
|
|
|
|
|
+ public String[] addItemToFirstPositionOfArray(String itemToAdd, String... existingArray) {
|
|
String[] newArray = new String[existingArray.length + 1];
|
|
String[] newArray = new String[existingArray.length + 1];
|
|
newArray[0] = itemToAdd;
|
|
newArray[0] = itemToAdd;
|
|
|
|
|