Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e6144fcea | ||
|
|
440d43ed09 | ||
|
|
adf60eb533 |
No files matched your search
+10
-3
@@ -49,7 +49,7 @@
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<outputDirectory>F:\Minecraft\Servers\MC 1.20.4 Server\plugins</outputDirectory>
|
||||
<outputDirectory>F:\Minecraft\Servers\MC 1.20.6 Server\plugins</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -74,7 +74,6 @@
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@@ -88,7 +87,8 @@
|
||||
<dependency>
|
||||
<groupId>me.catcoder</groupId>
|
||||
<artifactId>bukkit-sidebar</artifactId>
|
||||
<version>6.2.6-SNAPSHOT</version>
|
||||
<version>6.2.7-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.j256.ormlite/ormlite-jdbc -->
|
||||
<dependency>
|
||||
@@ -96,6 +96,13 @@
|
||||
<artifactId>ormlite-jdbc</artifactId>
|
||||
<version>6.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.github.steveice10/opennbt -->
|
||||
<dependency>
|
||||
<groupId>com.github.steveice10</groupId>
|
||||
<artifactId>opennbt</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -94,6 +94,7 @@ public final class PureKitPvP extends JavaPlugin {
|
||||
LanguageConfig.save();
|
||||
LanguageConfig.loadLanguage();
|
||||
|
||||
|
||||
SidebarScoreboard scoreboard = new SidebarScoreboard(this);
|
||||
|
||||
getCommand("getkit").setExecutor(new GetKit(this));
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ import me.lifelessnerd.purekitpvp.utils.ComponentUtils;
|
||||
import me.lifelessnerd.purekitpvp.utils.DoubleUtils;
|
||||
import me.lifelessnerd.purekitpvp.utils.PlayerUtils;
|
||||
|
||||
import me.lifelessnerd.purekitpvp.versioning.MinecraftVersion;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -28,6 +29,7 @@ public class SidebarScoreboard implements Listener {
|
||||
if (plugin.getConfig().getBoolean("scoreboard-enabled")){
|
||||
refreshLeaderboard();
|
||||
}
|
||||
System.out.println(MinecraftVersion.getVersion());
|
||||
|
||||
}
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package me.lifelessnerd.purekitpvp.versioning;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class MinecraftVersion {
|
||||
|
||||
public static String getVersion(){
|
||||
return extractVersion(Bukkit.getVersion());
|
||||
}
|
||||
|
||||
public static String extractVersion(String input) {
|
||||
// Define a regular expression pattern to match the version number
|
||||
Pattern pattern = Pattern.compile("\\b(\\d+\\.\\d+\\.\\d+)\\b");
|
||||
Matcher matcher = pattern.matcher(input);
|
||||
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
} else {
|
||||
throw new IllegalArgumentException("No version number found in the input string");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package me.lifelessnerd.purekitpvp.versioning;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static java.lang.Integer.parseInt;
|
||||
|
||||
public class Version implements Comparable<Version> {
|
||||
|
||||
int major;
|
||||
int minor;
|
||||
int build;
|
||||
|
||||
public Version(int major, int minor, int build) {
|
||||
this.major = major;
|
||||
this.minor = minor;
|
||||
this.build = build;
|
||||
}
|
||||
|
||||
public Version(String versionString){
|
||||
// versionString: 1.20.6
|
||||
String[] split = versionString.split("\\.");
|
||||
this.major = parseInt(split[0]);
|
||||
this.minor = parseInt(split[1]);
|
||||
this.build = parseInt(split[2]);
|
||||
}
|
||||
|
||||
public int getVersionNumber(){
|
||||
String versionNumber = major + String.valueOf(minor) + build; // hacky
|
||||
return parseInt(versionNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull Version o) {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user