Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugman-assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugman-bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugman-bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugman-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion plugman-paper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,9 @@
return bukkitPluginManager;
}

var version = Bukkit.getBukkitVersion().split("-")[0].split("\\.");

var paperVersion = Integer.parseInt(version[1]) * 100;
if (version.length >= 3) paperVersion += Integer.parseInt(version[2]);

return paperVersion >= 2005?
new ModernPaperPluginManager(bukkitPluginManager) :
new PaperPluginManager(bukkitPluginManager);
return obtainVersion() >= 12005 ?
new ModernPaperPluginManager(bukkitPluginManager) :
new PaperPluginManager(bukkitPluginManager);
}

/**
Expand All @@ -84,4 +79,17 @@
plugin.getLogger().info("You can disable this warning by setting 'showPaperWarning' to false in the config.yml");
}

/**
* Returns the Minecraft version integer id. 1.20 -> 12000, 1.21.4 -> 12104, 26.1 -> 260100.
*/
private static int obtainVersion() {
try {
String[] versions = Bukkit.getMinecraftVersion().split("\\.");
return Integer.parseInt(versions[0]) * 10000
+ (versions.length > 1 ? Integer.parseInt(versions[1]) : 0) * 100
+ (versions.length > 2 ? Integer.parseInt(versions[2]) : 0);
} catch (Exception ignored) {

Check warning on line 91 in plugman-paper/src/main/java/paper/com/rylinaux/plugman/PaperInitializer.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this block of code, fill it in, or add a comment explaining why it is empty.

See more on https://sonarcloud.io/project/issues?id=Test-Account666_PlugManX&issues=AZ1wFzRoia_1p5aQRJVB&open=AZ1wFzRoia_1p5aQRJVB&pullRequest=87
}
return -1;
}
}
2 changes: 1 addition & 1 deletion plugman-velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@Plugin(
id = "plugmanvelocity",
name = "PlugManVelocity",
version = "3.0.4",
version = "3.0.5",
description = "Plugin manager for Velocity servers.",
authors = {"rylinaux", "TestAccount666"}
)
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.rylinaux</groupId>
<artifactId>PlugManX</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<packaging>pom</packaging>

<modules>
Expand Down Expand Up @@ -57,7 +57,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plugman.version>3.0.4</plugman.version>
<plugman.version>3.0.5</plugman.version>
<manifold.version>2025.1.31</manifold.version>
<jackson.version>2.13.5</jackson.version>
</properties>
Expand Down