Browse Source

Fixed messages not being sent to the action bar

nossr50 1 year ago
parent
commit
0bf1bbe6ac
3 changed files with 16 additions and 17 deletions
  1. 1 0
      Changelog.txt
  2. 11 12
      pom.xml
  3. 4 5
      src/main/java/com/gmail/nossr50/util/player/NotificationManager.java

+ 1 - 0
Changelog.txt

@@ -1,6 +1,7 @@
 Version 2.2.008
 Version 2.2.008
     Fixed alchemy potions not upgrading correctly (This will only affect new potions made, see notes)
     Fixed alchemy potions not upgrading correctly (This will only affect new potions made, see notes)
     Fixed a bug where alchemy potions had italicized names
     Fixed a bug where alchemy potions had italicized names
+    Fixed a bug where messages were not being sent to the action bar in 1.20.6
     Fixed some exceptions that could happen with parties disabled (thanks IAISI)
     Fixed some exceptions that could happen with parties disabled (thanks IAISI)
 
 
     NOTES:
     NOTES:

+ 11 - 12
pom.xml

@@ -140,23 +140,22 @@
                             <include>org.bstats:bstats-base</include>
                             <include>org.bstats:bstats-base</include>
                             <include>org.bstats:bstats-bukkit</include>
                             <include>org.bstats:bstats-bukkit</include>
                             <include>net.kyori:adventure-api</include>
                             <include>net.kyori:adventure-api</include>
-                            <include>net.kyori:adventure-text-serializer-gson</include>
-                            <include>net.kyori:adventure-platform-bukkit</include>
+                            <include>net.kyori:adventure-key</include>
+                            <include>net.kyori:adventure-nbt</include>
                             <include>net.kyori:adventure-platform-api</include>
                             <include>net.kyori:adventure-platform-api</include>
-                            <include>net.kyori:adventure-platform-viaversion</include>
+                            <include>net.kyori:adventure-platform-bukkit</include>
                             <include>net.kyori:adventure-platform-facet</include>
                             <include>net.kyori:adventure-platform-facet</include>
-                            <include>net.kyori:adventure-nbt</include>
-                            <include>net.kyori:adventure-key</include>
-                            <include>net.kyori:examination-api</include>
-                            <include>net.kyori:examination-string</include>
-                            <include>net.kyori:adventure-text-serializer-legacy</include>
-                            <include>net.kyori:adventure-text-serializer-gson</include>
-                            <include>net.kyori:adventure-text-serializer-json</include>
+                            <include>net.kyori:adventure-platform-viaversion</include>
                             <include>net.kyori:adventure-text-serializer-bungeecord</include>
                             <include>net.kyori:adventure-text-serializer-bungeecord</include>
-                            <include>net.kyori:adventure-text-serializer-craftbukkit</include>
+                            <include>net.kyori:adventure-text-serializer-gson</include>
                             <include>net.kyori:adventure-text-serializer-gson-legacy-impl</include>
                             <include>net.kyori:adventure-text-serializer-gson-legacy-impl</include>
+                            <include>net.kyori:adventure-text-serializer-json</include>
                             <include>net.kyori:adventure-text-serializer-json-legacy-impl</include>
                             <include>net.kyori:adventure-text-serializer-json-legacy-impl</include>
+                            <include>net.kyori:adventure-text-serializer-legacy</include>
+                            <include>net.kyori:examination-api</include>
+                            <include>net.kyori:examination-string</include>
                             <include>net.kyori:option</include>
                             <include>net.kyori:option</include>
+                            <include>net.kyori:adventure-text-serializer-craftbukkit</include>
                             <include>co.aikar:acf-bukkit</include>
                             <include>co.aikar:acf-bukkit</include>
                             <include>com.tcoded:FoliaLib</include>
                             <include>com.tcoded:FoliaLib</include>
                         </includes>
                         </includes>
@@ -344,7 +343,7 @@
         <dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-platform-bukkit</artifactId>
             <artifactId>adventure-platform-bukkit</artifactId>
-            <version>4.3.2</version>
+            <version>LATEST</version>
         </dependency>
         </dependency>
         <dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <groupId>net.kyori</groupId>

+ 4 - 5
src/main/java/com/gmail/nossr50/util/player/NotificationManager.java

@@ -121,14 +121,13 @@ public class NotificationManager {
 
 
         final Audience audience = mcMMO.getAudiences().player(player);
         final Audience audience = mcMMO.getAudiences().player(player);
 
 
-        //If the message is being sent to the action bar we need to check if the copy if a copy is sent to the chat system
+
         Component notificationTextComponent = customEvent.getNotificationTextComponent();
         Component notificationTextComponent = customEvent.getNotificationTextComponent();
-        if(customEvent.getChatMessageType() == McMMOMessageType.ACTION_BAR)
-        {
+        if(customEvent.getChatMessageType() == McMMOMessageType.ACTION_BAR) {
             audience.sendActionBar(notificationTextComponent);
             audience.sendActionBar(notificationTextComponent);
 
 
-            if(customEvent.isMessageAlsoBeingSentToChat())
-            {
+            // If the message is being sent to the action bar we need to check if a copy is also sent to the chat system
+            if(customEvent.isMessageAlsoBeingSentToChat()) {
                 //Send copy to chat system
                 //Send copy to chat system
                 audience.sendMessage(notificationTextComponent);
                 audience.sendMessage(notificationTextComponent);
             }
             }