7 Commits
5 changed files with 37 additions and 14 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ plugins {
}
group = 'dev.codedred'
version = '1.6.2'
version = '1.6.2b'
repositories {
mavenLocal()
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
NEW_VERSION="1.6.2"
NEW_VERSION="1.6.2b"
git checkout main
git pull origin main
@@ -31,9 +31,13 @@ public class UpdateChecker {
connection.setReadTimeout(5000);
connection.setUseCaches(true);
latestVersion =
new BufferedReader(new InputStreamReader(connection.getInputStream()))
.readLine();
try (
BufferedReader reader = new BufferedReader(
new InputStreamReader(connection.getInputStream())
)
) {
latestVersion = reader.readLine();
}
if (latestVersion == null || latestVersion.isEmpty()) {
throw new IOException("Failed to retrieve latest version.");
@@ -36,16 +36,36 @@ public class ServerUtils {
* @return true if so
*/
public static boolean isRisenVersion() {
String[] versionParts = Bukkit.getServer().getVersion().split("\\.");
String version = Bukkit.getServer().getVersion();
String mcVersion = null;
int majorVersion = Integer.parseInt(
versionParts[1].replaceAll("[^0-9]", "")
);
int minorVersion = 0;
if (versionParts.length >= 3) minorVersion =
Integer.parseInt(versionParts[2].replaceAll("[^0-9]", ""));
if (version.contains("(MC:")) {
int startIndex = version.indexOf("(MC:") + 5;
int endIndex = version.indexOf(")", startIndex);
mcVersion = version.substring(startIndex, endIndex).trim();
}
return majorVersion >= 17 && minorVersion >= 0;
if (mcVersion == null) {
Bukkit
.getLogger()
.warning("PlayTimes failed to extract Minecraft version: " + version);
return false;
}
String[] versionParts = mcVersion.split("\\.");
try {
int minorVersion = versionParts.length >= 2
? Integer.parseInt(versionParts[1])
: 0;
return minorVersion >= 17;
} catch (NumberFormatException e) {
Bukkit
.getLogger()
.warning("PlayTimes failed to parse Minecraft version: " + mcVersion);
return false;
}
}
public static boolean hasPAPI() {
-1
View File
@@ -1,7 +1,6 @@
name: Playtimes
version: "${version}"
main: me.codedred.playtimes.PlayTimes
api-version: 1.19
author: Cmaaxx
authors: [CodedRed]
softdepend: [PlaceholderAPI]