From 8b82d61c0cc131df85262179750ab291c7380431 Mon Sep 17 00:00:00 2001 From: Kieran Wallbanks Date: Thu, 4 Mar 2021 13:47:26 +0000 Subject: [PATCH] fix demo build --- src/test/java/demo/PlayerInit.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/java/demo/PlayerInit.java b/src/test/java/demo/PlayerInit.java index 7be5363a3..3e277bd67 100644 --- a/src/test/java/demo/PlayerInit.java +++ b/src/test/java/demo/PlayerInit.java @@ -2,6 +2,7 @@ package demo; import demo.generator.ChunkGeneratorDemo; import demo.generator.NoiseTestGenerator; +import net.kyori.adventure.text.Component; import net.minestom.server.MinecraftServer; import net.minestom.server.benchmark.BenchmarkManager; import net.minestom.server.chat.ColoredText; @@ -78,13 +79,13 @@ public class PlayerInit { long ramUsage = benchmarkManager.getUsedMemory(); ramUsage /= 1e6; // bytes to MB - final ColoredText header = ColoredText.of("RAM USAGE: " + ramUsage + " MB"); - final ColoredText footer = ColoredText.of(benchmarkManager.getCpuMonitoringMessage()); + final Component header = Component.text("RAM USAGE: " + ramUsage + " MB"); + final Component footer = Component.text(benchmarkManager.getCpuMonitoringMessage()); { PlayerListHeaderAndFooterPacket playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket(); - playerListHeaderAndFooterPacket.header = header; - playerListHeaderAndFooterPacket.footer = footer; + playerListHeaderAndFooterPacket.header = MinecraftServer.getSerializationManager().serialize(header); + playerListHeaderAndFooterPacket.footer = MinecraftServer.getSerializationManager().serialize(footer); PacketUtils.sendGroupedPacket(players, playerListHeaderAndFooterPacket); }