sendSuccess signature changes

This commit is contained in:
Frank 2023-05-17 15:12:21 +02:00
parent ab846e1b42
commit 7cd4723d87
2 changed files with 6 additions and 5 deletions

View file

@ -84,7 +84,7 @@ public class DumpDatapack {
ctx.getSource().sendSuccess( ctx.getSource().sendSuccess(
Component.literal("Succesfully written to:\n ").append( () -> Component.literal("Succesfully written to:\n ").append(
Component.literal(base.toString()).setStyle(Style.EMPTY.withUnderlined(true)) Component.literal(base.toString()).setStyle(Style.EMPTY.withUnderlined(true))
), ),
false false

View file

@ -44,7 +44,7 @@ public class PrintInfo {
.setStyle(Style.EMPTY.withBold(false).withColor(cl)); .setStyle(Style.EMPTY.withBold(false).withColor(cl));
result.append(dimComponent); result.append(dimComponent);
} }
ctx.getSource().sendSuccess(result, false); ctx.getSource().sendSuccess(() -> result, false);
return Command.SINGLE_SUCCESS; return Command.SINGLE_SUCCESS;
} }
@ -53,7 +53,7 @@ public class PrintInfo {
MutableComponent header = Component.literal("Mod Updates:") MutableComponent header = Component.literal("Mod Updates:")
.setStyle(Style.EMPTY.withBold(false) .setStyle(Style.EMPTY.withBold(false)
.withColor(ChatFormatting.WHITE)); .withColor(ChatFormatting.WHITE));
ctx.getSource().sendSuccess(header, false); ctx.getSource().sendSuccess(() -> header, false);
VersionChecker.forEachUpdate((mod, cur, updated) -> { VersionChecker.forEachUpdate((mod, cur, updated) -> {
ModContainer nfo = FabricLoader.getInstance().getModContainer(mod).orElse(null); ModContainer nfo = FabricLoader.getInstance().getModContainer(mod).orElse(null);
@ -100,13 +100,14 @@ public class PrintInfo {
result.append(Component.literal(" ").setStyle(Style.EMPTY.withBold(true).withItalic(false))); result.append(Component.literal(" ").setStyle(Style.EMPTY.withBold(true).withItalic(false)));
} }
ctx.getSource().sendSuccess(result, false); MutableComponent finalResult = result;
ctx.getSource().sendSuccess(() -> finalResult, false);
}); });
MutableComponent footer = Component.literal("\n") MutableComponent footer = Component.literal("\n")
.setStyle(Style.EMPTY.withBold(false) .setStyle(Style.EMPTY.withBold(false)
.withUnderlined(true) .withUnderlined(true)
.withColor(ChatFormatting.WHITE)); .withColor(ChatFormatting.WHITE));
ctx.getSource().sendSuccess(footer, false); ctx.getSource().sendSuccess(() -> footer, false);
if (withUI && BCLib.isClient() && Configs.CLIENT_CONFIG.showUpdateInfo() && !VersionChecker.isEmpty()) { if (withUI && BCLib.isClient() && Configs.CLIENT_CONFIG.showUpdateInfo() && !VersionChecker.isEmpty()) {
if (!RenderSystem.isOnRenderThread()) { if (!RenderSystem.isOnRenderThread()) {