浏览代码

Add missing includes

nossr50 4 年之前
父节点
当前提交
6f99940540
共有 3 个文件被更改,包括 37 次插入1 次删除
  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
 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
     Improvements were made to tracking player placed blocks in mcMMO
     Players no longer lose levels below the level threshold in hardcore mode
     Players no longer lose levels below the level threshold in hardcore mode
     Hardcore now only applies penalties to levels above threshold
     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.apache.tomcat:tomcat-juli</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-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>
                         </includes>
                     </artifactSet>
                     </artifactSet>
                     <relocations>
                     <relocations>
@@ -115,6 +125,10 @@
                             <pattern>org.apache.tomcat</pattern>
                             <pattern>org.apache.tomcat</pattern>
                             <shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
                             <shadedPattern>com.gmail.nossr50.database.tomcat</shadedPattern>
                         </relocation>
                         </relocation>
+                        <relocation>
+                            <pattern>net.kyori.adventure</pattern>
+                            <shadedPattern>com.gmail.nossr50.kyori.adventure</shadedPattern>
+                        </relocation>
                         <relocation>
                         <relocation>
                             <pattern>org.bstats</pattern>
                             <pattern>org.bstats</pattern>
                             <shadedPattern>com.gmail.nossr50.metrics.bstat</shadedPattern>
                             <shadedPattern>com.gmail.nossr50.metrics.bstat</shadedPattern>
@@ -160,16 +174,37 @@
             <!-- ... -->
             <!-- ... -->
     </repositories>
     </repositories>
     <dependencies>
     <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>
         <dependency>
             <groupId>net.kyori</groupId>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-api</artifactId>
             <artifactId>adventure-api</artifactId>
             <version>4.0.0-SNAPSHOT</version>
             <version>4.0.0-SNAPSHOT</version>
         </dependency>
         </dependency>
+        <dependency>
+            <groupId>net.kyori</groupId>
+            <artifactId>adventure-nbt</artifactId>
+            <version>4.0.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
         <dependency>
             <groupId>net.kyori</groupId>
             <groupId>net.kyori</groupId>
             <artifactId>adventure-platform-bukkit</artifactId>
             <artifactId>adventure-platform-bukkit</artifactId>
             <version>4.0.0-SNAPSHOT</version>
             <version>4.0.0-SNAPSHOT</version>
         </dependency>
         </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>
         <dependency>
             <groupId>org.apache.maven.scm</groupId>
             <groupId>org.apache.maven.scm</groupId>
             <artifactId>maven-scm-provider-gitexe</artifactId>
             <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 curRank = RankUtils.getRank(player, subSkillType);
                 int nextRank = 0;
                 int nextRank = 0;
 
 
-                if(curRank < subSkillType.getNumRanks() && subSkillType.getNumRanks() > 0)
+                if(curRank < subSkillType.getNumRanks())
                 {
                 {
                     nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1);
                     nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1);
                 }
                 }