Cleanup startup messages

This commit is contained in:
Redned 2019-09-15 18:46:05 -05:00 committed by RednedEpic
parent 7f051bd6bc
commit 5d87b7ccab
2 changed files with 13 additions and 13 deletions

View file

@ -53,6 +53,7 @@ import org.geysermc.connector.utils.Toolbox;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
@ -91,17 +92,13 @@ public class GeyserConnector implements Connector {
} }
private GeyserConnector() { private GeyserConnector() {
long startupTime = System.currentTimeMillis();
System.out.println(12 << 4);
System.out.println(2 << 2);
System.out.println(1 << 2 | 4);
System.out.println(23 << 3);
System.out.println(UUID.randomUUID().toString());
// Metric // Metric
if(!(System.console() == null) && System.getProperty("os.name", "Windows 10").toLowerCase().contains("windows")) { if(!(System.console() == null) && System.getProperty("os.name", "Windows 10").toLowerCase().contains("windows")) {
AnsiConsole.systemInstall(); AnsiConsole.systemInstall();
} }
instance = this; instance = this;
this.generalThreadPool = Executors.newScheduledThreadPool(32); //TODO: Make configurable value this.generalThreadPool = Executors.newScheduledThreadPool(32); //TODO: Make configurable value
@ -147,9 +144,9 @@ public class GeyserConnector implements Connector {
bedrockServer.setHandler(new ConnectorServerEventHandler(this)); bedrockServer.setHandler(new ConnectorServerEventHandler(this));
bedrockServer.bind().whenComplete((avoid, throwable) -> { bedrockServer.bind().whenComplete((avoid, throwable) -> {
if (throwable == null) { if (throwable == null) {
logger.info("Started RakNet on " + config.getBedrock().getAddress() + ":" + config.getBedrock().getPort()); logger.info("Started Geyser on " + config.getBedrock().getAddress() + ":" + config.getBedrock().getPort());
} else { } else {
logger.severe("Failed to start RakNet on " + config.getBedrock().getAddress() + ":" + config.getBedrock().getPort()); logger.severe("Failed to start Geyser on " + config.getBedrock().getAddress() + ":" + config.getBedrock().getPort());
throwable.printStackTrace(); throwable.printStackTrace();
} }
}).join(); }).join();
@ -157,6 +154,9 @@ public class GeyserConnector implements Connector {
metrics = new Metrics("GeyserMC", config.getUUID(), true, java.util.logging.Logger.getLogger("")); metrics = new Metrics("GeyserMC", config.getUUID(), true, java.util.logging.Logger.getLogger(""));
metrics.addCustomChart(new Metrics.SingleLineChart("servers", () -> 1)); metrics.addCustomChart(new Metrics.SingleLineChart("servers", () -> 1));
metrics.addCustomChart(new Metrics.SingleLineChart("players", Geyser::getPlayerCount)); metrics.addCustomChart(new Metrics.SingleLineChart("players", Geyser::getPlayerCount));
double completeTime = (System.currentTimeMillis() - startupTime) / 1000D;
logger.info(String.format("Done (%ss)! Run /help for help!", new DecimalFormat("#.###").format(completeTime)));
} }
public Collection<Player> getConnectedPlayers() { public Collection<Player> getConnectedPlayers() {

View file

@ -107,13 +107,13 @@ public class Toolbox {
JAVA_BLOCKS = javaBlocks; JAVA_BLOCKS = javaBlocks;
BEDROCK_BLOCKS = bedrockBlocks; BEDROCK_BLOCKS = bedrockBlocks;
GeyserLogger.DEFAULT.debug("Remapping items..."); GeyserLogger.DEFAULT.info("Remapping items...");
Remapper.ITEM_REMAPPER.registerConversions(bedrockItems, javaItems); Remapper.ITEM_REMAPPER.registerConversions(bedrockItems, javaItems);
GeyserLogger.DEFAULT.debug("Item remap complete!"); GeyserLogger.DEFAULT.info("Item remap complete!");
GeyserLogger.DEFAULT.debug("Remapping blocks..."); GeyserLogger.DEFAULT.info("Remapping blocks...");
Remapper.BLOCK_REMAPPER.registerConversions(bedrockBlocks, javaBlocks); Remapper.BLOCK_REMAPPER.registerConversions(bedrockBlocks, javaBlocks);
GeyserLogger.DEFAULT.debug("Block remap complete!"); GeyserLogger.DEFAULT.info("Block remap complete!");
} }
public static final Collection<StartGamePacket.ItemEntry> ITEMS; public static final Collection<StartGamePacket.ItemEntry> ITEMS;