From 5bd156c387afdc0cc8f779838fbb7e6af7e8cbbf Mon Sep 17 00:00:00 2001 From: Misat11 <20199703+Misat11@users.noreply.github.com> Date: Sat, 24 Feb 2024 20:59:11 +0100 Subject: [PATCH] fix: bw dump command --- .../org/screamingsandals/bedwars/commands/DumpCommand.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/DumpCommand.java b/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/DumpCommand.java index d62c5205f..133ee9686 100644 --- a/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/DumpCommand.java +++ b/plugin/common/src/main/java/org/screamingsandals/bedwars/commands/DumpCommand.java @@ -348,13 +348,14 @@ protected void construct(Command.Builder commandSenderWrapperBuil "expires", LocalDateTime.now().plusDays(30).format(DateTimeFormatter.ofPattern("YYYY-MM-dd'T'HH:mm:ss'Z'")), "files", files.stream() .map(aFile -> nullValuesAllowingMap( - "name", aFile.getContent(), + "name", aFile.getName(), "content", nullValuesAllowingMap( "format", "text", "highlight_language", aFile.getLanguage(), "value", aFile.getContent() ) )) + .collect(Collectors.toList()) ))))).build(), HttpResponse.BodyHandlers.ofString()) .thenAccept(stringHttpResponse -> { if (stringHttpResponse.statusCode() >= 200 && stringHttpResponse.statusCode() <= 299) { @@ -373,7 +374,9 @@ protected void construct(Command.Builder commandSenderWrapperBuil throw new RuntimeException(e); } } else { - org.screamingsandals.lib.lang.Message.of(LangKeys.DUMP_FAILED).defaultPrefix().send(sender); + org.screamingsandals.lib.lang.Message.of(LangKeys.DUMP_FAILED).defaultPrefix() + .joinPlainText(" " + stringHttpResponse.statusCode() + " - " + stringHttpResponse.body()) + .send(sender); } }); }