Skip to content

Commit

Permalink
- New Config Option: notification.notifications_appear_in_action_bar
Browse files Browse the repository at this point in the history
    - default: true
    - This setting only applies to servers running spigot, paper or
bungeecord.
    - On servers using craftbukkit.jar the notifications will always
appear in the chat.
    - When set to false the notifications will appear in the chat rather
than the action bar.
    - Closes #3636.
  • Loading branch information
LlmDl committed Jan 14, 2020
1 parent c0d432c commit 7cb0408
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
9 changes: 8 additions & 1 deletion resources/ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4065,4 +4065,11 @@ v0.92.0.11:
- Confirmations can now be accepted/declined/confirmed/cancelled by clicking on the text if you use Spigot.
- Courtesy of Siris with PRs #3631 + #3639
- Closes #3534.
- Commands can still be used, clicking only for spigot servers, not craftbukkit servers.
- Commands can still be used, clicking only for spigot servers, not craftbukkit servers.
- New Config Option: notification.notifications_appear_in_action_bar
- default: true
- This setting only applies to servers running spigot, paper or bungeecord.
- On servers using craftbukkit.jar the notifications will always appear in the chat.
- When set to false the notifications will appear in the chat rather than the action bar.
- Closes #3636.

7 changes: 7 additions & 0 deletions src/com/palmergames/bukkit/config/ConfigNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,13 @@ public enum ConfigNodes {
"false",
"# If the notification.owner option should show name or {title} name.",
"# Titles are the ones granted by nation kings."),
NOTIFICATION_NOTIFICATIONS_APPEAR_IN_ACTION_BAR("notification.notifications_appear_in_action_bar",
"true",
"# This setting only applies to servers running spigot, paper or bungeecord.",
"# On servers using craftbukkit.jar the notifications will always appear in the chat.",
"# When set to false the notifications will appear in the chat rather than the action bar."),


FLAGS_DEFAULT(
"default_perm_flags",
"",
Expand Down
4 changes: 4 additions & 0 deletions src/com/palmergames/bukkit/towny/TownySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,10 @@ public static boolean isNotificationOwnerShowingNationTitles() {

return getBoolean(ConfigNodes.NOTIFICATION_OWNER_SHOWS_NATION_TITLE);
}

public static boolean isNotificationsAppearingInActionBar() {
return getBoolean(ConfigNodes.NOTIFICATION_NOTIFICATIONS_APPEAR_IN_ACTION_BAR);
}

public static boolean getShowTownBoardOnLogin() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public void onPlayerChangePlotEvent(PlayerChangePlotEvent event) {
ChunkNotification chunkNotifier = new ChunkNotification(from, to);
String msg = chunkNotifier.getNotificationString(resident);
if (msg != null)
if (!Towny.isSpigot)
player.sendMessage(msg);
else {
if (Towny.isSpigot && TownySettings.isNotificationsAppearingInActionBar())
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(msg));
else {
player.sendMessage(msg);
}
}
} catch (NotRegisteredException e) {
Expand Down

0 comments on commit 7cb0408

Please sign in to comment.