This commit is contained in:
Xaver106 2024-05-13 19:20:34 +00:00 committed by GitHub
commit 2c322df165
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 17 additions and 0 deletions

View File

@ -41,7 +41,9 @@ import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;
import java.util.stream.Stream;
@CommandDeclaration(command = "debugpaste",
aliases = "dp",
@ -170,6 +172,21 @@ public class DebugPaste extends SubCommand {
);
}
final Path langDir = PlotSquared.platform().getDirectory().toPath().resolve("lang");
if (Files.isDirectory(langDir)) {
try (Stream<Path> files = Files.list(langDir)) {
files.filter(Files::isRegularFile)
.filter(path -> path.getFileName().toString().startsWith("messages_") &&
path.getFileName().toString().endsWith(".json")
).forEach(path -> {
try {
incendoPaster.addFile(path.toFile());
} catch (IOException ignored) {
}
});
}
}
try {
final String rawResponse = incendoPaster.upload();
final JsonObject jsonObject =