From f0213d4b8e3ca458670fddc0c63de042d20970c9 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 3 Dec 2021 20:26:20 -0500 Subject: [PATCH] Minor fixes; add CPU count to dump --- .../geyser/platform/velocity/GeyserVelocityPlugin.java | 6 +++--- core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java | 3 +++ .../java/org/geysermc/geyser/network/MinecraftProtocol.java | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java index b0e39352c..8106192ac 100644 --- a/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java +++ b/bootstrap/velocity/src/main/java/org/geysermc/geyser/platform/velocity/GeyserVelocityPlugin.java @@ -36,17 +36,17 @@ import com.velocitypowered.api.plugin.Plugin; import com.velocitypowered.api.proxy.ProxyServer; import lombok.Getter; import org.geysermc.common.PlatformType; -import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.GeyserBootstrap; -import org.geysermc.geyser.session.auth.AuthType; +import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.configuration.GeyserConfiguration; import org.geysermc.geyser.dump.BootstrapDumpInfo; import org.geysermc.geyser.ping.GeyserLegacyPingPassthrough; import org.geysermc.geyser.ping.IGeyserPingPassthrough; import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandExecutor; import org.geysermc.geyser.platform.velocity.command.GeyserVelocityCommandManager; -import org.geysermc.geyser.util.FileUtils; +import org.geysermc.geyser.session.auth.AuthType; import org.geysermc.geyser.text.GeyserLocale; +import org.geysermc.geyser.util.FileUtils; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; diff --git a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java index da98d45b5..8a21b6929 100644 --- a/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java +++ b/core/src/main/java/org/geysermc/geyser/dump/DumpInfo.java @@ -66,6 +66,7 @@ public class DumpInfo { private static final long MEGABYTE = 1024L * 1024L; private final DumpInfo.VersionInfo versionInfo; + private final int cpuCount; private Properties gitInfo; private final GeyserConfiguration config; private final Floodgate floodgate; @@ -79,6 +80,8 @@ public class DumpInfo { public DumpInfo(boolean addLog) { this.versionInfo = new VersionInfo(); + this.cpuCount = Runtime.getRuntime().availableProcessors(); + try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("git.properties")) { this.gitInfo = new Properties(); this.gitInfo.load(stream); diff --git a/core/src/main/java/org/geysermc/geyser/network/MinecraftProtocol.java b/core/src/main/java/org/geysermc/geyser/network/MinecraftProtocol.java index a9df533d5..6015bf229 100644 --- a/core/src/main/java/org/geysermc/geyser/network/MinecraftProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/MinecraftProtocol.java @@ -39,7 +39,7 @@ import java.util.StringJoiner; /** * Contains information about the supported protocols in Geyser. */ -public class MinecraftProtocol { +public final class MinecraftProtocol { /** * Default Bedrock codec that should act as a fallback. Should represent the latest available * release of the game that Geyser supports. @@ -114,4 +114,7 @@ public class MinecraftProtocol { return joiner.toString(); } + + private MinecraftProtocol() { + } }