mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-15 23:25:32 +01:00
Rework StateDumper
This commit is contained in:
parent
3cd3f1d032
commit
93d8876b20
@ -1 +1 @@
|
||||
Subproject commit 6c84500dfc560ec9588c89f71cc4a2d7edef2b2d
|
||||
Subproject commit 8b179fb5e011ef8ac7e550e2e9aa6c64b644eaee
|
@ -27,6 +27,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
api ("com.mojang:brigadier:1.0.17")
|
||||
|
||||
api ("de.bluecolored.bluemap:BlueMapCore")
|
||||
|
||||
compileOnly ("org.jetbrains:annotations:16.0.2")
|
||||
|
@ -29,14 +29,13 @@
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.api.gson.MarkerGson;
|
||||
import de.bluecolored.bluemap.api.markers.MarkerSet;
|
||||
import de.bluecolored.bluemap.common.config.ConfigurationException;
|
||||
import de.bluecolored.bluemap.common.config.MapConfig;
|
||||
import de.bluecolored.bluemap.common.config.storage.StorageConfig;
|
||||
import de.bluecolored.bluemap.common.plugin.Plugin;
|
||||
import de.bluecolored.bluemap.core.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.common.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.resources.MinecraftVersion;
|
||||
@ -69,7 +68,6 @@
|
||||
/**
|
||||
* This is the attempt to generalize as many actions as possible to have CLI and Plugins run on the same general setup-code.
|
||||
*/
|
||||
@DebugDump
|
||||
public class BlueMapService implements Closeable {
|
||||
|
||||
private final BlueMapConfiguration config;
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.BlueMapConfiguration;
|
||||
import de.bluecolored.bluemap.common.config.storage.StorageConfig;
|
||||
import de.bluecolored.bluemap.common.serverinterface.ServerWorld;
|
||||
@ -44,7 +43,6 @@
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@DebugDump
|
||||
@Getter
|
||||
public class BlueMapConfigManager implements BlueMapConfiguration {
|
||||
|
||||
|
@ -24,13 +24,11 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public class CoreConfig {
|
||||
|
||||
@ -75,7 +73,6 @@ public LogConfig getLog() {
|
||||
return log;
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public static class LogConfig {
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
import com.flowpowered.math.vector.Vector2i;
|
||||
import com.flowpowered.math.vector.Vector3i;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.map.MapSettings;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
import lombok.AccessLevel;
|
||||
@ -38,7 +37,6 @@
|
||||
import java.nio.file.Path;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
@Getter
|
||||
public class MapConfig implements MapSettings {
|
||||
|
@ -24,14 +24,12 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public class PluginConfig {
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||
|
||||
import java.nio.file.Path;
|
||||
@ -33,7 +32,6 @@
|
||||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public class WebappConfig {
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
|
||||
|
||||
import java.net.InetAddress;
|
||||
@ -33,7 +32,6 @@
|
||||
import java.nio.file.Path;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public class WebserverConfig {
|
||||
|
||||
@ -75,7 +73,6 @@ public LogConfig getLog() {
|
||||
return log;
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public static class LogConfig {
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config.storage;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.config.ConfigurationException;
|
||||
import de.bluecolored.bluemap.core.storage.compression.Compression;
|
||||
import de.bluecolored.bluemap.core.storage.file.FileStorage;
|
||||
@ -34,7 +33,6 @@
|
||||
import java.nio.file.Path;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
@Getter
|
||||
public class FileConfig extends StorageConfig {
|
||||
|
@ -24,8 +24,8 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config.storage;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.config.ConfigurationException;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.storage.compression.Compression;
|
||||
import de.bluecolored.bluemap.core.storage.sql.Database;
|
||||
import de.bluecolored.bluemap.core.storage.sql.SQLStorage;
|
||||
@ -51,17 +51,20 @@
|
||||
@Getter
|
||||
public class SQLConfig extends StorageConfig {
|
||||
|
||||
@DebugDump(exclude = true)
|
||||
private String connectionUrl = "jdbc:mysql://localhost/bluemap?permitMysqlScheme";
|
||||
|
||||
@DebugDump(exclude = true)
|
||||
private Map<String, String> connectionProperties = new HashMap<>();
|
||||
@DebugDump private String dialect = null;
|
||||
|
||||
@DebugDump private String driverJar = null;
|
||||
@DebugDump private String driverClass = null;
|
||||
@DebugDump private int maxConnections = -1;
|
||||
private String dialect = null;
|
||||
|
||||
@DebugDump private String compression = Compression.GZIP.getKey().getFormatted();
|
||||
private String driverJar = null;
|
||||
private String driverClass = null;
|
||||
private int maxConnections = -1;
|
||||
|
||||
private String compression = Compression.GZIP.getKey().getFormatted();
|
||||
|
||||
@DebugDump
|
||||
@Getter(AccessLevel.NONE)
|
||||
private transient URL driverJarURL = null;
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.config.storage;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.config.ConfigurationException;
|
||||
import de.bluecolored.bluemap.core.storage.Storage;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
@ -35,7 +34,6 @@
|
||||
import java.util.Locale;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@ConfigSerializable
|
||||
public abstract class StorageConfig {
|
||||
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of BlueMap, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) Blue (Lukas Rieger) <https://bluecolored.de>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.debug;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({
|
||||
ElementType.METHOD,
|
||||
ElementType.FIELD,
|
||||
ElementType.TYPE
|
||||
})
|
||||
public @interface DebugDump {
|
||||
|
||||
String value() default "";
|
||||
|
||||
boolean exclude() default false;
|
||||
|
||||
}
|
@ -0,0 +1,328 @@
|
||||
/*
|
||||
* This file is part of BlueMap, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) Blue (Lukas Rieger) <https://bluecolored.de>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.debug;
|
||||
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class StateDumper {
|
||||
|
||||
private static final StateDumper GLOBAL = new StateDumper();
|
||||
|
||||
private final Set<Object> instances = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
|
||||
public void dump(Path file) throws IOException {
|
||||
JsonWriter writer = new JsonWriter(Files.newBufferedWriter(
|
||||
file,
|
||||
StandardCharsets.UTF_8,
|
||||
StandardOpenOption.CREATE,
|
||||
StandardOpenOption.TRUNCATE_EXISTING
|
||||
));
|
||||
writer.setIndent(" ");
|
||||
|
||||
writer.beginObject();
|
||||
|
||||
writer.name("system-info");
|
||||
collectSystemInfo(writer);
|
||||
|
||||
Set<Object> alreadyDumped = Collections.newSetFromMap(new IdentityHashMap<>());
|
||||
|
||||
writer.name("threads").beginArray();
|
||||
for (Thread thread : Thread.getAllStackTraces().keySet()) {
|
||||
dumpInstance(thread, writer, alreadyDumped);
|
||||
}
|
||||
writer.endArray();
|
||||
|
||||
writer.name("dump").beginObject();
|
||||
for (Object instance : instances) {
|
||||
Class<?> type = instance.getClass();
|
||||
writer.name(type.getName());
|
||||
dumpInstance(instance, writer, alreadyDumped);
|
||||
}
|
||||
writer.endObject();
|
||||
|
||||
writer.endObject();
|
||||
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
|
||||
private void dumpInstance(Object instance, JsonWriter writer, Set<Object> alreadyDumped) throws IOException {
|
||||
|
||||
if (instance == null) {
|
||||
writer.nullValue();
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof String ||
|
||||
instance instanceof Path ||
|
||||
instance instanceof UUID ||
|
||||
instance instanceof Key
|
||||
) {
|
||||
writer.value(instance.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Number val) {
|
||||
writer.value(val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Boolean val) {
|
||||
writer.value(val);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!alreadyDumped.add(instance)) {
|
||||
writer.value("<<" + Objects.toIdentityString(instance) + ">>");
|
||||
return;
|
||||
}
|
||||
|
||||
writer.beginObject();
|
||||
try {
|
||||
String identityString = Objects.toIdentityString(instance);
|
||||
writer.name("#identity").value(identityString);
|
||||
|
||||
if (instance instanceof Map<?, ?> map) {
|
||||
writer.name("entries").beginArray();
|
||||
|
||||
int count = 0;
|
||||
for (Map.Entry<?, ?> entry : map.entrySet()) {
|
||||
if (++count > 30) {
|
||||
writer.value("<<" + (map.size() - 30) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
writer.beginObject();
|
||||
|
||||
writer.name("key");
|
||||
dumpInstance(entry.getKey(), writer, alreadyDumped);
|
||||
|
||||
writer.name("value");
|
||||
dumpInstance(entry.getValue(), writer, alreadyDumped);
|
||||
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
writer.endArray();
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Collection<?> collection) {
|
||||
writer.name("entries").beginArray();
|
||||
|
||||
int count = 0;
|
||||
for (Object entry : collection) {
|
||||
if (++count > 30) {
|
||||
writer.value("<<" + (collection.size() - 30) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
dumpInstance(entry, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
writer.endArray();
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Object[] array) {
|
||||
writer.name("entries").beginArray();
|
||||
|
||||
int count = 0;
|
||||
for (Object entry : array) {
|
||||
if (++count > 30) {
|
||||
writer.value("<<" + (array.length - 30) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
dumpInstance(entry, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
writer.endArray();
|
||||
return;
|
||||
}
|
||||
|
||||
String toString = instance.toString();
|
||||
if (!toString.equals(identityString))
|
||||
writer.name("#toString").value(instance.toString());
|
||||
|
||||
if (instance instanceof Thread thread) {
|
||||
writer.name("name").value(thread.getName());
|
||||
writer.name("state").value(thread.getState().toString());
|
||||
writer.name("priority").value(thread.getPriority());
|
||||
writer.name("alive").value(thread.isAlive());
|
||||
writer.name("id").value(thread.getId());
|
||||
writer.name("deamon").value(thread.isDaemon());
|
||||
writer.name("interrupted").value(thread.isInterrupted());
|
||||
|
||||
try {
|
||||
StackTraceElement[] trace = thread.getStackTrace();
|
||||
writer.name("stacktrace").beginArray();
|
||||
for (StackTraceElement element : trace) {
|
||||
writer.value(element.toString());
|
||||
}
|
||||
writer.endArray();
|
||||
} catch (SecurityException ignore) {}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
dumpAnnotatedInstance(instance.getClass(), instance, writer, alreadyDumped);
|
||||
|
||||
} finally {
|
||||
writer.endObject();
|
||||
}
|
||||
}
|
||||
|
||||
private void dumpAnnotatedInstance(Class<?> type, Object instance, JsonWriter writer, Set<Object> alreadyDumped) throws IOException {
|
||||
|
||||
DebugDump typedd = type.getAnnotation(DebugDump.class);
|
||||
boolean exclude = typedd != null && typedd.exclude();
|
||||
boolean allFields = !exclude && (
|
||||
typedd != null ||
|
||||
type.getPackageName().startsWith("de.bluecolored.bluemap")
|
||||
);
|
||||
|
||||
for (Field field : type.getDeclaredFields()) {
|
||||
String key = field.getName();
|
||||
Object value;
|
||||
|
||||
try {
|
||||
DebugDump dd = field.getAnnotation(DebugDump.class);
|
||||
if (dd == null) {
|
||||
if (!allFields) continue;
|
||||
if (Modifier.isStatic(field.getModifiers())) continue;
|
||||
if (Modifier.isTransient(field.getModifiers())) continue;
|
||||
} else {
|
||||
if (dd.exclude()) continue;
|
||||
}
|
||||
|
||||
if (dd != null) {
|
||||
key = dd.value();
|
||||
if (key.isEmpty()) key = field.getName();
|
||||
}
|
||||
|
||||
field.setAccessible(true);
|
||||
value = field.get(instance);
|
||||
} catch (Exception ex) {
|
||||
writer.name("!!" + key).value(ex.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
writer.name(key);
|
||||
dumpInstance(value, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
for (Method method : type.getDeclaredMethods()) {
|
||||
String key = method.toGenericString();
|
||||
Object value;
|
||||
|
||||
try {
|
||||
DebugDump dd = method.getAnnotation(DebugDump.class);
|
||||
if (dd == null || dd.exclude()) continue;
|
||||
|
||||
key = dd.value();
|
||||
if (key.isEmpty()) key = method.toGenericString();
|
||||
|
||||
method.setAccessible(true);
|
||||
value = method.invoke(instance);
|
||||
} catch (Exception ex) {
|
||||
writer.name("!!" + key).value(ex.toString());
|
||||
continue;
|
||||
}
|
||||
|
||||
writer.name(key);
|
||||
dumpInstance(value, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
for (Class<?> iface : type.getInterfaces()) {
|
||||
dumpAnnotatedInstance(iface, instance, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
Class<?> typeSuperclass = type.getSuperclass();
|
||||
if (typeSuperclass != null) {
|
||||
dumpAnnotatedInstance(typeSuperclass, instance, writer, alreadyDumped);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void collectSystemInfo(JsonWriter writer) throws IOException {
|
||||
writer.beginObject();
|
||||
|
||||
writer.name("bluemap-version").value(BlueMap.VERSION);
|
||||
writer.name("git-hash").value(BlueMap.GIT_HASH);
|
||||
|
||||
String[] properties = new String[]{
|
||||
"java.runtime.name",
|
||||
"java.runtime.version",
|
||||
"java.vm.vendor",
|
||||
"java.vm.name",
|
||||
"os.name",
|
||||
"os.version",
|
||||
"user.dir",
|
||||
"java.home",
|
||||
"file.separator",
|
||||
"sun.io.unicode.encoding",
|
||||
"java.class.version"
|
||||
};
|
||||
Map<String, String> propMap = new HashMap<>();
|
||||
for (String key : properties) {
|
||||
propMap.put(key, System.getProperty(key));
|
||||
}
|
||||
writer.name("properties");
|
||||
dumpInstance(propMap, writer, new HashSet<>());
|
||||
|
||||
writer.name("cores").value(Runtime.getRuntime().availableProcessors());
|
||||
writer.name("max-memory").value(Runtime.getRuntime().maxMemory());
|
||||
writer.name("total-memory").value(Runtime.getRuntime().totalMemory());
|
||||
writer.name("free-memory").value(Runtime.getRuntime().freeMemory());
|
||||
|
||||
writer.name("timestamp").value(System.currentTimeMillis());
|
||||
writer.name("time").value(LocalDateTime.now().toString());
|
||||
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
public static StateDumper global() {
|
||||
return GLOBAL;
|
||||
}
|
||||
|
||||
public synchronized void register(Object instance) {
|
||||
GLOBAL.instances.add(instance);
|
||||
}
|
||||
|
||||
}
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.plugin;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.BlueMapConfiguration;
|
||||
import de.bluecolored.bluemap.common.BlueMapService;
|
||||
import de.bluecolored.bluemap.common.InterruptableReentrantLock;
|
||||
@ -40,7 +39,7 @@
|
||||
import de.bluecolored.bluemap.common.serverinterface.ServerWorld;
|
||||
import de.bluecolored.bluemap.common.web.*;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpServer;
|
||||
import de.bluecolored.bluemap.core.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.common.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.metrics.Metrics;
|
||||
@ -71,7 +70,6 @@
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@DebugDump
|
||||
public class Plugin implements ServerEventListener {
|
||||
|
||||
public static final String PLUGIN_ID = "bluemap";
|
||||
|
@ -25,7 +25,6 @@
|
||||
package de.bluecolored.bluemap.common.plugin;
|
||||
|
||||
import com.flowpowered.math.vector.Vector2i;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.rendermanager.RenderManager;
|
||||
import de.bluecolored.bluemap.common.rendermanager.WorldRegionRenderTask;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
@ -52,7 +51,6 @@ public class RegionFileWatchService extends Thread {
|
||||
|
||||
private Timer delayTimer;
|
||||
|
||||
@DebugDump
|
||||
private final Map<Vector2i, TimerTask> scheduledUpdates;
|
||||
|
||||
public RegionFileWatchService(RenderManager renderManager, BmMap map) throws IOException {
|
||||
|
@ -48,7 +48,7 @@
|
||||
import de.bluecolored.bluemap.common.rendermanager.*;
|
||||
import de.bluecolored.bluemap.common.serverinterface.CommandSource;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
import de.bluecolored.bluemap.core.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.common.debug.StateDumper;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.map.renderstate.TileInfoRegion;
|
||||
@ -635,7 +635,7 @@ public int debugDumpCommand(CommandContext<S> context) {
|
||||
final CommandSource source = commandSourceInterface.apply(context.getSource());
|
||||
|
||||
try {
|
||||
Path file = plugin.getBlueMap().getConfig().getCoreConfig().getData().resolve("dump.json");
|
||||
Path file = plugin.getBlueMap().getConfig().getCoreConfig().getData().resolve("dump.json.gz");
|
||||
StateDumper.global().dump(file);
|
||||
|
||||
source.sendMessage(Text.of(TextColor.GREEN, "Dump created at: " + file));
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.plugin.skins;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.api.plugin.PlayerIconFactory;
|
||||
import de.bluecolored.bluemap.api.plugin.SkinProvider;
|
||||
import de.bluecolored.bluemap.common.plugin.Plugin;
|
||||
@ -45,7 +44,6 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@DebugDump
|
||||
public class PlayerSkinUpdater implements ServerEventListener {
|
||||
|
||||
private final Plugin plugin;
|
||||
|
@ -24,11 +24,8 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.rendermanager;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@DebugDump
|
||||
public class CombinedRenderTask<T extends RenderTask> implements RenderTask {
|
||||
|
||||
private final String description;
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.rendermanager;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -25,7 +25,6 @@
|
||||
package de.bluecolored.bluemap.common.rendermanager;
|
||||
|
||||
import com.flowpowered.math.vector.Vector2i;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.map.renderstate.MapTileState;
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@DebugDump
|
||||
public class MapUpdateTask extends CombinedRenderTask<RenderTask> {
|
||||
|
||||
private final BmMap map;
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.rendermanager;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
|
||||
import java.util.*;
|
||||
@ -35,19 +34,19 @@
|
||||
public class RenderManager {
|
||||
private static final AtomicInteger nextRenderManagerIndex = new AtomicInteger(0);
|
||||
|
||||
@DebugDump private final int id;
|
||||
@DebugDump private volatile boolean running;
|
||||
private final int id;
|
||||
private volatile boolean running;
|
||||
|
||||
@DebugDump private long lastTimeBusy;
|
||||
private long lastTimeBusy;
|
||||
|
||||
private final AtomicInteger nextWorkerThreadIndex;
|
||||
@DebugDump private final Collection<WorkerThread> workerThreads;
|
||||
private final Collection<WorkerThread> workerThreads;
|
||||
private final AtomicInteger busyCount;
|
||||
|
||||
private ProgressTracker progressTracker;
|
||||
private volatile boolean newTask;
|
||||
|
||||
@DebugDump private final LinkedList<RenderTask> renderTasks;
|
||||
private final LinkedList<RenderTask> renderTasks;
|
||||
|
||||
public RenderManager() {
|
||||
this.id = nextRenderManagerIndex.getAndIncrement();
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.rendermanager;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.storage.MapStorage;
|
||||
|
||||
import java.util.Objects;
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
import com.flowpowered.math.vector.Vector2i;
|
||||
import com.flowpowered.math.vector.Vector2l;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.map.BmMap;
|
||||
import de.bluecolored.bluemap.core.map.renderstate.TileActionResolver.ActionAndNextState;
|
||||
@ -47,7 +47,6 @@
|
||||
import static de.bluecolored.bluemap.core.map.renderstate.TileActionResolver.Action.DELETE;
|
||||
import static de.bluecolored.bluemap.core.map.renderstate.TileActionResolver.Action.RENDER;
|
||||
|
||||
@DebugDump
|
||||
public class WorldRegionRenderTask implements RenderTask {
|
||||
|
||||
@Getter private final BmMap map;
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.serverinterface;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Tristate;
|
||||
import de.bluecolored.bluemap.core.world.World;
|
||||
import de.bluecolored.bluemap.core.world.mca.MCAWorld;
|
||||
|
@ -24,7 +24,7 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.serverinterface;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -24,14 +24,12 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.web;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequest;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequestHandler;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpResponse;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpStatusCode;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
|
||||
@DebugDump
|
||||
public class BlueMapResponseModifier implements HttpRequestHandler {
|
||||
|
||||
private final HttpRequestHandler delegate;
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.web;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.web.http.*;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@DebugDump
|
||||
public class FileRequestHandler implements HttpRequestHandler {
|
||||
|
||||
private final Path webRoot;
|
||||
|
@ -24,12 +24,10 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.web;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.web.http.*;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import lombok.Getter;
|
||||
|
||||
@DebugDump
|
||||
@Getter
|
||||
public class LoggingRequestHandler implements HttpRequestHandler {
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
package de.bluecolored.bluemap.common.web;
|
||||
|
||||
import de.bluecolored.bluemap.api.ContentTypeRegistry;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequest;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequestHandler;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpResponse;
|
||||
@ -47,7 +46,6 @@
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@DebugDump
|
||||
@RequiredArgsConstructor
|
||||
public class MapStorageRequestHandler implements HttpRequestHandler {
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.web;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequest;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpRequestHandler;
|
||||
import de.bluecolored.bluemap.common.web.http.HttpResponse;
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@DebugDump
|
||||
public class RoutingRequestHandler implements HttpRequestHandler {
|
||||
|
||||
public final LinkedList<Route> routes;
|
||||
@ -83,7 +81,6 @@ public HttpResponse handle(HttpRequest request) {
|
||||
return new HttpResponse(HttpStatusCode.BAD_REQUEST);
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
@AllArgsConstructor
|
||||
@Getter @Setter
|
||||
public static class Route {
|
||||
|
@ -24,13 +24,11 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.common.web.http;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@DebugDump
|
||||
public class HttpServer extends Server {
|
||||
|
||||
@Getter @Setter
|
||||
|
@ -1,277 +0,0 @@
|
||||
/*
|
||||
* This file is part of BlueMap, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) Blue (Lukas Rieger) <https://bluecolored.de>
|
||||
* Copyright (c) contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.debug;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
import org.spongepowered.configurate.ConfigurationNode;
|
||||
import org.spongepowered.configurate.ConfigurationOptions;
|
||||
import org.spongepowered.configurate.gson.GsonConfigurationLoader;
|
||||
import org.spongepowered.configurate.serialize.SerializationException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class StateDumper {
|
||||
|
||||
private static final StateDumper GLOBAL = new StateDumper();
|
||||
|
||||
private final Set<Object> instances = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
|
||||
public void dump(Path file) throws IOException {
|
||||
GsonConfigurationLoader loader = GsonConfigurationLoader.builder()
|
||||
.path(file)
|
||||
.build();
|
||||
ConfigurationNode node = loader.createNode();
|
||||
|
||||
collectSystemInfo(node.node("system-info"));
|
||||
|
||||
Set<Object> alreadyDumped = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
|
||||
try {
|
||||
ConfigurationNode threadDump = node.node("threads");
|
||||
for (Thread thread : Thread.getAllStackTraces().keySet()) {
|
||||
dumpInstance(thread, loader.defaultOptions(), threadDump.appendListNode(), alreadyDumped);
|
||||
}
|
||||
} catch (SecurityException ex){
|
||||
node.node("threads").set(ex.toString());
|
||||
}
|
||||
|
||||
ConfigurationNode dump = node.node("dump");
|
||||
for (Object instance : instances) {
|
||||
Class<?> type = instance.getClass();
|
||||
ConfigurationNode instanceDump = dump.node(type.getName()).appendListNode();
|
||||
dumpInstance(instance, loader.defaultOptions(), instanceDump, alreadyDumped);
|
||||
}
|
||||
|
||||
loader.save(node);
|
||||
|
||||
}
|
||||
|
||||
private void dumpInstance(Object instance, ConfigurationOptions options, ConfigurationNode node, Set<Object> alreadyDumped) throws SerializationException {
|
||||
|
||||
try {
|
||||
if (instance == null){
|
||||
node.raw(null);
|
||||
return;
|
||||
}
|
||||
|
||||
Class<?> type = instance.getClass();
|
||||
|
||||
if (!alreadyDumped.add(instance)) {
|
||||
node.set("<<" + instance + ">>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Map) {
|
||||
int count = 0;
|
||||
Map<?, ?> map = (Map<?, ?>) instance;
|
||||
|
||||
if (map.isEmpty()){
|
||||
node.set(map.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
for (Map.Entry<?, ?> entry : map.entrySet()) {
|
||||
if (++count > 100) {
|
||||
node.appendListNode().set("<<" + (map.size() - 100) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
ConfigurationNode entryNode = node.appendListNode();
|
||||
dumpInstance(entry.getKey(), options, entryNode.node("key"), alreadyDumped);
|
||||
dumpInstance(entry.getValue(), options, entryNode.node("value"), alreadyDumped);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Collection) {
|
||||
if (((Collection<?>) instance).isEmpty()){
|
||||
node.set(instance.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (Object entry : (Collection<?>) instance) {
|
||||
if (++count > 100) {
|
||||
node.appendListNode().set("<<" + (((Collection<?>) instance).size() - 100) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
dumpInstance(entry, options, node.appendListNode(), alreadyDumped);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Object[]) {
|
||||
if (((Object[]) instance).length == 0){
|
||||
node.set(instance.toString());
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (Object entry : (Object[]) instance) {
|
||||
if (++count > 100) {
|
||||
node.appendListNode().set("<<" + (((Object[]) instance).length - 100) + " more elements>>");
|
||||
break;
|
||||
}
|
||||
|
||||
dumpInstance(entry, options, node.appendListNode(), alreadyDumped);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance instanceof Thread) {
|
||||
Thread t = (Thread) instance;
|
||||
node.node("name").set(t.getName());
|
||||
node.node("state").set(t.getState().toString());
|
||||
node.node("priority").set(t.getPriority());
|
||||
node.node("alive").set(t.isAlive());
|
||||
node.node("id").set(t.getId());
|
||||
node.node("deamon").set(t.isDaemon());
|
||||
node.node("interrupted").set(t.isInterrupted());
|
||||
|
||||
dumpInstance(t.getStackTrace(), options, node.node("stackTrace"), alreadyDumped);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean foundSomething = dumpAnnotatedInstance(type, instance, options, node, alreadyDumped);
|
||||
if (!foundSomething) {
|
||||
node.set(instance.toString());
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
ex.printStackTrace(new PrintWriter(stringWriter));
|
||||
node.set("Error: " + ex + " >> " + stringWriter);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean dumpAnnotatedInstance(Class<?> type, Object instance, ConfigurationOptions options, ConfigurationNode node, Set<Object> alreadyDumped) throws Exception {
|
||||
boolean foundSomething = false;
|
||||
boolean allFields = type.isAnnotationPresent(DebugDump.class);
|
||||
|
||||
for (Field field : type.getDeclaredFields()) {
|
||||
DebugDump dd = field.getAnnotation(DebugDump.class);
|
||||
if (dd == null) {
|
||||
if (!allFields) continue;
|
||||
if (Modifier.isStatic(field.getModifiers())) continue;
|
||||
if (Modifier.isTransient(field.getModifiers())) continue;
|
||||
}
|
||||
foundSomething = true;
|
||||
|
||||
String key = "";
|
||||
if (dd != null) key = dd.value();
|
||||
if (key.isEmpty()) key = field.getName();
|
||||
|
||||
field.setAccessible(true);
|
||||
if (options.acceptsType(field.getType())) {
|
||||
node.node(key).set(field.get(instance));
|
||||
} else {
|
||||
dumpInstance(field.get(instance), options, node.node(key), alreadyDumped);
|
||||
}
|
||||
}
|
||||
|
||||
for (Method method : type.getDeclaredMethods()) {
|
||||
DebugDump dd = method.getAnnotation(DebugDump.class);
|
||||
if (dd == null) continue;
|
||||
foundSomething = true;
|
||||
|
||||
String key = dd.value();
|
||||
if (key.isEmpty()) key = method.toGenericString().replace(' ', '_');
|
||||
|
||||
if (options.acceptsType(method.getReturnType())) {
|
||||
method.setAccessible(true);
|
||||
node.node(key).set(method.invoke(instance));
|
||||
} else {
|
||||
method.setAccessible(true);
|
||||
dumpInstance(method.invoke(instance), options, node.node(key), alreadyDumped);
|
||||
}
|
||||
}
|
||||
|
||||
for (Class<?> iface : type.getInterfaces()) {
|
||||
foundSomething |= dumpAnnotatedInstance(iface, instance, options, node, alreadyDumped);
|
||||
}
|
||||
|
||||
Class<?> typeSuperclass = type.getSuperclass();
|
||||
if (typeSuperclass != null) {
|
||||
foundSomething |= dumpAnnotatedInstance(typeSuperclass, instance, options, node, alreadyDumped);
|
||||
}
|
||||
|
||||
return foundSomething;
|
||||
}
|
||||
|
||||
private void collectSystemInfo(ConfigurationNode node) throws SerializationException {
|
||||
node.node("bluemap-version").set(BlueMap.VERSION);
|
||||
node.node("git-hash").set(BlueMap.GIT_HASH);
|
||||
|
||||
String[] properties = new String[]{
|
||||
"java.runtime.name",
|
||||
"java.runtime.version",
|
||||
"java.vm.vendor",
|
||||
"java.vm.name",
|
||||
"os.name",
|
||||
"os.version",
|
||||
"user.dir",
|
||||
"java.home",
|
||||
"file.separator",
|
||||
"sun.io.unicode.encoding",
|
||||
"java.class.version"
|
||||
};
|
||||
Map<String, String> propMap = new HashMap<>();
|
||||
for (String key : properties) {
|
||||
propMap.put(key, System.getProperty(key));
|
||||
}
|
||||
node.node("system-properties").set(propMap);
|
||||
|
||||
node.node("cores").set(Runtime.getRuntime().availableProcessors());
|
||||
node.node("max-memory").set(Runtime.getRuntime().maxMemory());
|
||||
node.node("total-memory").set(Runtime.getRuntime().totalMemory());
|
||||
node.node("free-memory").set(Runtime.getRuntime().freeMemory());
|
||||
|
||||
node.node("timestamp").set(System.currentTimeMillis());
|
||||
node.node("time").set(LocalDateTime.now().toString());
|
||||
}
|
||||
|
||||
public static StateDumper global() {
|
||||
return GLOBAL;
|
||||
}
|
||||
|
||||
public synchronized void register(Object instance) {
|
||||
GLOBAL.instances.add(instance);
|
||||
}
|
||||
|
||||
public synchronized void unregister(Object instance) {
|
||||
GLOBAL.instances.remove(instance);
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,6 @@
|
||||
import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.api.gson.MarkerGson;
|
||||
import de.bluecolored.bluemap.api.markers.MarkerSet;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
@ -55,7 +54,6 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@DebugDump
|
||||
@Getter
|
||||
public class BmMap {
|
||||
|
||||
|
@ -29,7 +29,6 @@
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.google.gson.JsonParseException;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.ResourcePath;
|
||||
import de.bluecolored.bluemap.core.resources.adapter.ResourcesGson;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
|
||||
@ -43,7 +42,6 @@
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@DebugDump
|
||||
public class TextureGallery {
|
||||
|
||||
private static final Gson GSON = ResourcesGson.addAdapter(new GsonBuilder())
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
import com.flowpowered.math.vector.Vector2i;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.storage.GridStorage;
|
||||
import de.bluecolored.bluemap.core.storage.compression.CompressedInputStream;
|
||||
@ -41,7 +40,6 @@
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@DebugDump
|
||||
abstract class CellStorage<T extends CellStorage.Cell> {
|
||||
|
||||
private static final BlueNBT BLUE_NBT = new BlueNBT();
|
||||
|
@ -24,10 +24,8 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.map.renderstate;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.storage.GridStorage;
|
||||
|
||||
@DebugDump
|
||||
public class MapChunkState extends CellStorage<ChunkInfoRegion> {
|
||||
|
||||
static final int SHIFT = 7;
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.map.renderstate;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.storage.GridStorage;
|
||||
import de.bluecolored.bluemap.core.util.Grid;
|
||||
@ -36,7 +35,6 @@
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@DebugDump
|
||||
public class MapTileState extends CellStorage<TileInfoRegion> {
|
||||
|
||||
static final int SHIFT = 5;
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
import com.flowpowered.math.GenericMath;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.math.Color;
|
||||
import de.bluecolored.bluemap.core.world.biome.Biome;
|
||||
import de.bluecolored.bluemap.core.world.block.Block;
|
||||
@ -40,7 +39,6 @@
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@DebugDump
|
||||
public class BlockColorCalculatorFactory {
|
||||
|
||||
private static final int BLEND_RADIUS_H = 2;
|
||||
|
@ -25,7 +25,6 @@
|
||||
package de.bluecolored.bluemap.core.resources;
|
||||
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.world.BlockProperties;
|
||||
import de.bluecolored.bluemap.core.world.BlockState;
|
||||
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@DebugDump
|
||||
public class BlockPropertiesConfig {
|
||||
|
||||
private final Map<String, List<BlockStateMapping<BlockProperties>>> mappings;
|
||||
|
@ -24,12 +24,10 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.world.BlockState;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@DebugDump
|
||||
class BlockStateMapping<T> {
|
||||
private final BlockState blockState;
|
||||
private final T mapping;
|
||||
|
@ -29,7 +29,6 @@
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.util.FileHelper;
|
||||
import lombok.AccessLevel;
|
||||
@ -48,7 +47,6 @@
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
|
||||
@DebugDump
|
||||
@Getter
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public class MinecraftVersion {
|
||||
|
@ -31,7 +31,6 @@
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@ -40,7 +39,6 @@
|
||||
import java.util.Locale;
|
||||
import java.util.function.Function;
|
||||
|
||||
@DebugDump
|
||||
@JsonAdapter(ResourcePath.Adapter.class)
|
||||
public class ResourcePath<T> extends Key {
|
||||
|
||||
|
@ -24,14 +24,12 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources.pack.datapack.dimension;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.world.DimensionType;
|
||||
import de.bluecolored.bluenbt.NBTName;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@DebugDump
|
||||
public class DimensionTypeData implements DimensionType {
|
||||
|
||||
@NBTName("natural")
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.resources.BlockColorCalculatorFactory;
|
||||
@ -58,7 +57,6 @@
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@DebugDump
|
||||
public class ResourcePack extends Pack {
|
||||
public static final ResourcePath<BlockState> MISSING_BLOCK_STATE = new ResourcePath<>("bluemap", "missing");
|
||||
public static final ResourcePath<BlockModel> MISSING_BLOCK_MODEL = new ResourcePath<>("bluemap", "block/missing");
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources.pack.resourcepack.blockmodel;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.ResourcePath;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.texture.Texture;
|
||||
@ -34,7 +33,6 @@
|
||||
import java.util.*;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
public class BlockModel {
|
||||
|
||||
private ResourcePath<BlockModel> parent;
|
||||
|
@ -30,7 +30,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
|
||||
import de.bluecolored.bluemap.core.util.Direction;
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.EnumMap;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@JsonAdapter(Element.Adapter.class)
|
||||
public class Element {
|
||||
private static final Vector3f FULL_BLOCK_MIN = Vector3f.ZERO;
|
||||
|
@ -25,14 +25,12 @@
|
||||
package de.bluecolored.bluemap.core.resources.pack.resourcepack.blockmodel;
|
||||
|
||||
import com.flowpowered.math.vector.Vector4f;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
|
||||
import de.bluecolored.bluemap.core.util.Direction;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
public class Face {
|
||||
|
||||
private static final TextureVariable DEFAULT_TEXTURE = new TextureVariable(ResourcePack.MISSING_TEXTURE);
|
||||
|
@ -31,7 +31,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
import de.bluecolored.bluemap.core.util.math.Axis;
|
||||
import de.bluecolored.bluemap.core.util.math.MatrixM4f;
|
||||
@ -39,7 +38,6 @@
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@JsonAdapter(Rotation.Adapter.class)
|
||||
public class Rotation {
|
||||
private static final Vector3f DEFAULT_ORIGIN = new Vector3f(8, 8, 8);
|
||||
|
@ -28,7 +28,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.ResourcePath;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.texture.Texture;
|
||||
@ -38,7 +37,6 @@
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
|
||||
@DebugDump
|
||||
@JsonAdapter(TextureVariable.Adapter.class)
|
||||
public class TextureVariable {
|
||||
|
||||
|
@ -24,13 +24,11 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources.pack.resourcepack.blockstate;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
public class BlockState {
|
||||
|
||||
private Variants variants = null;
|
||||
|
@ -24,8 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources.pack.resourcepack.blockstate;
|
||||
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Preconditions;
|
||||
import de.bluecolored.bluemap.core.world.BlockState;
|
||||
|
||||
@ -41,7 +39,6 @@ public interface BlockStateCondition {
|
||||
|
||||
boolean matches(BlockState state);
|
||||
|
||||
@DebugDump
|
||||
class Property implements BlockStateCondition {
|
||||
|
||||
private final String key;
|
||||
@ -61,7 +58,6 @@ public boolean matches(BlockState state) {
|
||||
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
class PropertySet implements BlockStateCondition {
|
||||
|
||||
private final String key;
|
||||
@ -82,7 +78,6 @@ public boolean matches(BlockState state) {
|
||||
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
class And implements BlockStateCondition {
|
||||
|
||||
final BlockStateCondition[] conditions;
|
||||
@ -117,7 +112,6 @@ public boolean matches(BlockState state) {
|
||||
|
||||
}
|
||||
|
||||
@DebugDump
|
||||
class Or implements BlockStateCondition {
|
||||
|
||||
private final BlockStateCondition[] conditions;
|
||||
|
@ -28,7 +28,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
import de.bluecolored.bluemap.core.world.BlockState;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -39,7 +38,6 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@JsonAdapter(Multipart.Adapter.class)
|
||||
public class Multipart {
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
import de.bluecolored.bluemap.core.resources.ResourcePath;
|
||||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.blockmodel.BlockModel;
|
||||
@ -38,7 +37,6 @@
|
||||
import java.io.IOException;
|
||||
|
||||
@SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"})
|
||||
@DebugDump
|
||||
@JsonAdapter(Variant.Adapter.class)
|
||||
public class Variant {
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonToken;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -36,7 +35,6 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@JsonAdapter(VariantSet.Adapter.class)
|
||||
public class VariantSet {
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.JsonAdapter;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.resources.AbstractTypeAdapterFactory;
|
||||
import de.bluecolored.bluemap.core.world.BlockState;
|
||||
@ -40,7 +39,6 @@
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
@JsonAdapter(Variants.Adapter.class)
|
||||
public class Variants {
|
||||
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.resources.pack.resourcepack.texture;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.resources.ResourcePath;
|
||||
import de.bluecolored.bluemap.core.util.BufferedImageUtil;
|
||||
import de.bluecolored.bluemap.core.util.math.Color;
|
||||
@ -36,7 +35,6 @@
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
@DebugDump
|
||||
public class Texture {
|
||||
|
||||
public static final Texture MISSING = new Texture(
|
||||
|
@ -24,11 +24,8 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.util;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@DebugDump
|
||||
public class Key implements Keyed {
|
||||
|
||||
private static final ConcurrentHashMap<String, String> STRING_INTERN_POOL = new ConcurrentHashMap<>();
|
||||
|
@ -24,8 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.util;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@ -33,7 +31,6 @@ public class Lazy<T> {
|
||||
|
||||
private Supplier<T> loader;
|
||||
|
||||
@DebugDump
|
||||
private volatile T value;
|
||||
|
||||
public Lazy(Supplier<T> loader) {
|
||||
|
@ -24,10 +24,7 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.util.math;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
|
||||
@SuppressWarnings("UnusedReturnValue")
|
||||
@DebugDump
|
||||
public class Color {
|
||||
|
||||
public float r, g, b, a;
|
||||
|
@ -24,10 +24,8 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.world;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Tristate;
|
||||
|
||||
@DebugDump
|
||||
public class BlockProperties {
|
||||
|
||||
public static final BlockProperties DEFAULT = new BlockProperties();
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.world;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -39,7 +38,6 @@
|
||||
* <br>
|
||||
* <i>The implementation of this class has to be thread-save!</i><br>
|
||||
*/
|
||||
@DebugDump
|
||||
public class BlockState extends Key {
|
||||
|
||||
private static final Pattern BLOCKSTATE_SERIALIZATION_PATTERN = Pattern.compile("^(.+?)(?:\\[(.*)])?$");
|
||||
|
@ -24,13 +24,11 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.world.biome;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.util.Key;
|
||||
import de.bluecolored.bluemap.core.util.Keyed;
|
||||
import de.bluecolored.bluemap.core.util.math.Color;
|
||||
import lombok.Getter;
|
||||
|
||||
@DebugDump
|
||||
public interface Biome extends Keyed {
|
||||
|
||||
Biome DEFAULT = new Default();
|
||||
|
@ -29,7 +29,6 @@
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import com.github.benmanes.caffeine.cache.LoadingCache;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.BlueMap;
|
||||
import de.bluecolored.bluemap.core.logger.Logger;
|
||||
import de.bluecolored.bluemap.core.resources.pack.datapack.DataPack;
|
||||
@ -60,7 +59,6 @@
|
||||
|
||||
@Getter
|
||||
@ToString
|
||||
@DebugDump
|
||||
public class MCAWorld implements World {
|
||||
|
||||
private static final Grid CHUNK_GRID = new Grid(16);
|
||||
|
@ -24,7 +24,6 @@
|
||||
*/
|
||||
package de.bluecolored.bluemap.core.world.mca.data;
|
||||
|
||||
import de.bluecolored.bluemap.api.debug.DebugDump;
|
||||
import de.bluecolored.bluemap.core.world.DimensionType;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@ -35,13 +34,11 @@
|
||||
|
||||
@Getter
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
@DebugDump
|
||||
public class LevelData {
|
||||
|
||||
private Data data = new Data();
|
||||
|
||||
@Getter
|
||||
@DebugDump
|
||||
public static class Data {
|
||||
private String levelName = "world";
|
||||
private int spawnX = 0, spawnY = 0, spawnZ = 0;
|
||||
@ -49,7 +46,6 @@ public static class Data {
|
||||
}
|
||||
|
||||
@Getter
|
||||
@DebugDump
|
||||
public static class WGSettings {
|
||||
private Map<String, Dimension> dimensions = new HashMap<>();
|
||||
}
|
||||
@ -57,7 +53,6 @@ public static class WGSettings {
|
||||
@Getter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@DebugDump
|
||||
public static class Dimension {
|
||||
private DimensionType type = DimensionType.OVERWORLD;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user