mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-01-01 17:01:45 +01:00
Add static variable to disable bedrock listener (#2254)
* Add static variable to disable bedrock listener * Add default value * Add javadoc comment
This commit is contained in:
parent
4c542ba2c4
commit
aaa100b2d3
2 changed files with 18 additions and 9 deletions
|
@ -99,6 +99,12 @@ public class GeyserConnector {
|
|||
|
||||
private static GeyserConnector instance;
|
||||
|
||||
/**
|
||||
* This is used in GeyserConnect to stop the bedrock server binding to a port
|
||||
*/
|
||||
@Setter
|
||||
private static boolean shouldStartListener = true;
|
||||
|
||||
@Setter
|
||||
private AuthType defaultAuthType;
|
||||
|
||||
|
@ -219,14 +225,17 @@ public class GeyserConnector {
|
|||
}
|
||||
|
||||
bedrockServer.setHandler(new ConnectorServerEventHandler(this));
|
||||
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
||||
if (throwable == null) {
|
||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||
} else {
|
||||
logger.severe(LanguageUtils.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}).join();
|
||||
|
||||
if (shouldStartListener) {
|
||||
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
||||
if (throwable == null) {
|
||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||
} else {
|
||||
logger.severe(LanguageUtils.getLocaleStringLog("geyser.core.fail", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}).join();
|
||||
}
|
||||
|
||||
if (config.getMetrics().isEnabled()) {
|
||||
metrics = new Metrics(this, "GeyserMC", config.getMetrics().getUniqueId(), false, java.util.logging.Logger.getLogger(""));
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -75,7 +75,7 @@
|
|||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.4</version>
|
||||
<version>1.18.20</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
Loading…
Reference in a new issue