Browse Source

Add missing includes

nossr50 5 năm trước cách đây
mục cha
commit
6f99940540
3 tập tin đã thay đổi với 37 bổ sung1 xóa
  1. 1 0
      Changelog.txt
  2. 35 0
      pom.xml
  3. 1 1
      src/main/java/com/gmail/nossr50/util/TextComponentFactory.java

+ 1 - 0
Changelog.txt

@@ -1,4 +1,5 @@
 Version 2.1.146
+    JSON Text components are now done through 'adventure' library by Kyori, this should help reduce player disconnects from messages due to an unfixed Spigot bug.
     Improvements were made to tracking player placed blocks in mcMMO
     Players no longer lose levels below the level threshold in hardcore mode
     Hardcore now only applies penalties to levels above threshold

+ 35 - 0
pom.xml

@@ -100,6 +100,16 @@
                             <include>org.apache.tomcat:tomcat-juli</include>
                             <include>org.bstats:bstats-bukkit</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-platform-api</include>
+                            <include>net.kyori:adventure-platform-common</include>
+                            <include>net.kyori:adventure-platform-viaversion</include>
+                            <include>net.kyori:adventure-nbt</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-bungeecord</include>
                         </includes>
                     </artifactSet>
                     <relocations>
@@ -115,6 +125,10 @@
                             <pattern>org.apache.tomcat</pattern>
                             <shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
                         </relocation>
+                        <relocation>
+                            <pattern>net.kyori.adventure</pattern>
+                            <shadedPattern>com.gmail.nossr50.kyori.adventure</shadedPattern>
+                        </relocation>
                         <relocation>
                             <pattern>org.bstats</pattern>
                             <shadedPattern>com.gmail.nossr50.metrics.bstat</shadedPattern>
@@ -160,16 +174,37 @@
             <!-- ... -->
     </repositories>
     <dependencies>
+<!--        adventure-api, adventure-text-serializer-gson, adventure-platform-bukkit-->
+        <dependency>
+            <groupId>net.kyori</groupId>
+            <artifactId>adventure-text-serializer-gson</artifactId>
+            <version>4.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-api</artifactId>
             <version>4.0.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>net.kyori</groupId>
+            <artifactId>adventure-nbt</artifactId>
+            <version>4.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-platform-bukkit</artifactId>
             <version>4.0.0-SNAPSHOT</version>
         </dependency>
+        <dependency>
+            <groupId>net.kyori</groupId>
+            <artifactId>adventure-platform-api</artifactId>
+            <version>4.0.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>net.kyori</groupId>
+            <artifactId>adventure-platform-common</artifactId>
+            <version>4.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.maven.scm</groupId>
             <artifactId>maven-scm-provider-gitexe</artifactId>

+ 1 - 1
src/main/java/com/gmail/nossr50/util/TextComponentFactory.java

@@ -483,7 +483,7 @@ public class TextComponentFactory {
                 int curRank = RankUtils.getRank(player, subSkillType);
                 int nextRank = 0;
 
-                if(curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0)
+                if(curRank < subSkillType.getNumRanks())
                 {
                     nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1);
                 }