mirror of
https://github.com/CodedRed-Spigot/PlayTimes.git
synced 2026-11-06 09:42:33 -05:00
Compare commits
7
Commits
1.6.2a
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52e989b6b0 | ||
|
|
393000c8db | ||
|
|
0bfb51e9a1 | ||
|
|
deb86b6772 | ||
|
|
afe66090f9 | ||
|
|
cbc8b632e0 | ||
|
|
8630c14648 |
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'dev.codedred'
|
||||
version = '1.6.2'
|
||||
version = '1.6.2b'
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
|
||||
+1
-1
@@ -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,7 +1,6 @@
|
||||
name: Playtimes
|
||||
version: "${version}"
|
||||
main: me.codedred.playtimes.PlayTimes
|
||||
api-version: 1.19
|
||||
author: Cmaaxx
|
||||
authors: [CodedRed]
|
||||
softdepend: [PlaceholderAPI]
|
||||
|
||||
Reference in new issue
Block a user