mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-17 22:32:04 +00:00
Ah
This commit is contained in:
@@ -20,12 +20,17 @@ package com.volmit.iris.engine.object;
|
|||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class IrisEngineStatistics {
|
public class IrisEngineStatistics {
|
||||||
private int totalHotloads = 0;
|
private int totalHotloads = 0;
|
||||||
private int chunksGenerated = 0;
|
private int chunksGenerated = 0;
|
||||||
private String IrisCreationVersion = getVersion();
|
private String IrisCreationVersion = getVersion();
|
||||||
|
private String MinecraftVersion = getMCVersion();
|
||||||
|
|
||||||
public void generatedChunk() {
|
public void generatedChunk() {
|
||||||
chunksGenerated++;
|
chunksGenerated++;
|
||||||
@@ -38,10 +43,22 @@ public class IrisEngineStatistics {
|
|||||||
String result = null;
|
String result = null;
|
||||||
if (hyphenIndex != -1) {
|
if (hyphenIndex != -1) {
|
||||||
result = input.substring(0, hyphenIndex);
|
result = input.substring(0, hyphenIndex);
|
||||||
System.out.println(result);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
public String getMCVersion() {
|
||||||
|
String bukkitVersion = "git-Purpur-2023 (MC: 1.20.1)";
|
||||||
|
|
||||||
|
Pattern pattern = Pattern.compile("\\(MC: (\\d+\\.\\d+(\\.\\d+)?)\\)");
|
||||||
|
Matcher matcher = pattern.matcher(bukkitVersion);
|
||||||
|
|
||||||
|
if (matcher.find()) {
|
||||||
|
return matcher.group(1);
|
||||||
|
} else {
|
||||||
|
return "ERROR"; // todo: Maybe do something ?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void hotloaded() {
|
public void hotloaded() {
|
||||||
totalHotloads++;
|
totalHotloads++;
|
||||||
|
|||||||
Reference in New Issue
Block a user