Small debug dump improvements

This commit is contained in:
Blue (Lukas Rieger) 2021-06-25 13:51:24 +02:00
parent f66695acf6
commit 59bd00734c
No known key found for this signature in database
GPG Key ID: 904C4995F9E1F800
4 changed files with 32 additions and 13 deletions

View File

@ -33,6 +33,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@DebugDump
public class MinecraftVersion implements Comparable<MinecraftVersion> {
private static final Pattern VERSION_REGEX = Pattern.compile("(?:(?<major>\\d+)\\.(?<minor>\\d+))(?:\\.(?<patch>\\d+))?(?:\\-(?:pre|rc)\\d+)?");
@ -41,10 +42,8 @@ public class MinecraftVersion implements Comparable<MinecraftVersion> {
public static final MinecraftVersion EARLIEST_SUPPORTED = new MinecraftVersion(1, 12, 2);
public static final MinecraftVersion THE_FLATTENING = new MinecraftVersion(1, 13);
@DebugDump
private final int major, minor, patch;
@DebugDump
private final Lazy<MinecraftResource> resource;
public MinecraftVersion(int major, int minor) {
@ -142,6 +141,7 @@ public static MinecraftVersion of(String versionString) {
return new MinecraftVersion(major, minor, patch);
}
@DebugDump
public enum MinecraftResource {
MC_1_12 (new MinecraftVersion(1, 12), "mc1_12", "https://launcher.mojang.com/v1/objects/0f275bc1547d01fa5f56ba34bdc87d981ee12daf/client.jar"),
@ -152,9 +152,9 @@ public enum MinecraftResource {
MC_1_16_2 (new MinecraftVersion(1, 16, 2), "mc1_16", "https://launcher.mojang.com/v1/objects/653e97a2d1d76f87653f02242d243cdee48a5144/client.jar"),
MC_1_17 (new MinecraftVersion(1, 17), "mc1_16", "https://launcher.mojang.com/v1/objects/1cf89c77ed5e72401b869f66410934804f3d6f52/client.jar");
@DebugDump private final MinecraftVersion version;
@DebugDump private final String resourcePrefix;
@DebugDump private final String clientUrl;
private final MinecraftVersion version;
private final String resourcePrefix;
private final String clientUrl;
MinecraftResource(MinecraftVersion version, String resourcePrefix, String clientUrl) {
this.version = version;

View File

@ -30,13 +30,13 @@
import java.io.File;
import java.io.IOException;
@DebugDump
public class CoreConfig {
@DebugDump private boolean downloadAccepted = false;
@DebugDump private int renderThreadCount = 0;
@DebugDump private boolean metricsEnabled = false;
@DebugDump private File dataFolder = new File("data");
private boolean downloadAccepted = false;
private int renderThreadCount = 0;
private boolean metricsEnabled = false;
private File dataFolder = new File("data");
public CoreConfig(ConfigurationNode node) throws IOException {

View File

@ -183,4 +183,14 @@ public boolean equals(Object obj) {
return false;
}
@Override
public String toString() {
return "BmMap{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", world=" + world +
", fileRoot=" + fileRoot +
'}';
}
}

View File

@ -423,4 +423,13 @@ public static Vector2i blockToChunk(Vector3i pos) {
);
}
@Override
public String toString() {
return "MCAWorld{" +
"uuid=" + uuid +
", worldFolder=" + worldFolder +
", name='" + name + '\'' +
'}';
}
}