Skip to content

Commit

Permalink
Merge pull request #3 from Zowpy/master
Browse files Browse the repository at this point in the history
fixed error on paper 1.21
  • Loading branch information
DevDrizzy authored Aug 8, 2024
2 parents c43216f + 2ac4080 commit 974077a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@

<dependencies>
<dependency>
<groupId>com.github.retrooper.packetevents</groupId>
<artifactId>spigot</artifactId>
<version>2.3.0</version>
<groupId>com.github.retrooper</groupId>
<artifactId>packetevents-spigot</artifactId>
<version>2.4.0</version>
<scope>provided</scope>
<exclusions>
<exclusion>
Expand All @@ -73,7 +73,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<version>1.18.30</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
Expand Down Expand Up @@ -120,7 +120,7 @@
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<version>1.18.30</version>
</path>
</annotationProcessorPaths>
<target>${maven.compiler.target}</target>
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/xyz/refinedev/api/tablist/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,19 @@
@UtilityClass
public class StringUtils {

public static final String VERSION = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
public static final int MINOR_VERSION = Integer.parseInt(VERSION.split("_")[1]);
public static final int MINOR_VERSION;
private static final Pattern hexPattern = Pattern.compile("&#[A-Fa-f0-9]{6}");

static {
Matcher matcher = Pattern.compile("MC: \\d\\.(\\d+)").matcher(Bukkit.getVersion());

if (matcher.find()) {
MINOR_VERSION = Integer.parseInt(matcher.group(1));
}else {
MINOR_VERSION = 8;
}
}


// Thnx scifi, love you <3

Expand Down

0 comments on commit 974077a

Please sign in to comment.