mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00: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;
|
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
|
@Setter
|
||||||
private AuthType defaultAuthType;
|
private AuthType defaultAuthType;
|
||||||
|
|
||||||
|
@ -219,6 +225,8 @@ public class GeyserConnector {
|
||||||
}
|
}
|
||||||
|
|
||||||
bedrockServer.setHandler(new ConnectorServerEventHandler(this));
|
bedrockServer.setHandler(new ConnectorServerEventHandler(this));
|
||||||
|
|
||||||
|
if (shouldStartListener) {
|
||||||
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
bedrockServer.bind().whenComplete((avoid, throwable) -> {
|
||||||
if (throwable == null) {
|
if (throwable == null) {
|
||||||
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
logger.info(LanguageUtils.getLocaleStringLog("geyser.core.start", config.getBedrock().getAddress(), String.valueOf(config.getBedrock().getPort())));
|
||||||
|
@ -227,6 +235,7 @@ public class GeyserConnector {
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
}
|
}
|
||||||
}).join();
|
}).join();
|
||||||
|
}
|
||||||
|
|
||||||
if (config.getMetrics().isEnabled()) {
|
if (config.getMetrics().isEnabled()) {
|
||||||
metrics = new Metrics(this, "GeyserMC", config.getMetrics().getUniqueId(), false, java.util.logging.Logger.getLogger(""));
|
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>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.4</version>
|
<version>1.18.20</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
Loading…
Reference in a new issue