mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 09:57:45 +01:00
fix demo build
This commit is contained in:
parent
abae740cbc
commit
8b82d61c0c
@ -2,6 +2,7 @@ package demo;
|
|||||||
|
|
||||||
import demo.generator.ChunkGeneratorDemo;
|
import demo.generator.ChunkGeneratorDemo;
|
||||||
import demo.generator.NoiseTestGenerator;
|
import demo.generator.NoiseTestGenerator;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import net.minestom.server.MinecraftServer;
|
import net.minestom.server.MinecraftServer;
|
||||||
import net.minestom.server.benchmark.BenchmarkManager;
|
import net.minestom.server.benchmark.BenchmarkManager;
|
||||||
import net.minestom.server.chat.ColoredText;
|
import net.minestom.server.chat.ColoredText;
|
||||||
@ -78,13 +79,13 @@ public class PlayerInit {
|
|||||||
long ramUsage = benchmarkManager.getUsedMemory();
|
long ramUsage = benchmarkManager.getUsedMemory();
|
||||||
ramUsage /= 1e6; // bytes to MB
|
ramUsage /= 1e6; // bytes to MB
|
||||||
|
|
||||||
final ColoredText header = ColoredText.of("RAM USAGE: " + ramUsage + " MB");
|
final Component header = Component.text("RAM USAGE: " + ramUsage + " MB");
|
||||||
final ColoredText footer = ColoredText.of(benchmarkManager.getCpuMonitoringMessage());
|
final Component footer = Component.text(benchmarkManager.getCpuMonitoringMessage());
|
||||||
|
|
||||||
{
|
{
|
||||||
PlayerListHeaderAndFooterPacket playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket();
|
PlayerListHeaderAndFooterPacket playerListHeaderAndFooterPacket = new PlayerListHeaderAndFooterPacket();
|
||||||
playerListHeaderAndFooterPacket.header = header;
|
playerListHeaderAndFooterPacket.header = MinecraftServer.getSerializationManager().serialize(header);
|
||||||
playerListHeaderAndFooterPacket.footer = footer;
|
playerListHeaderAndFooterPacket.footer = MinecraftServer.getSerializationManager().serialize(footer);
|
||||||
|
|
||||||
PacketUtils.sendGroupedPacket(players, playerListHeaderAndFooterPacket);
|
PacketUtils.sendGroupedPacket(players, playerListHeaderAndFooterPacket);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user