Add isProxyEnabled
method to ServerConfiguration (#12664)
This commit is contained in:
parent
4419afb9c9
commit
5652882134
2 changed files with 16 additions and 0 deletions
|
@ -21,4 +21,13 @@ public interface ServerConfiguration {
|
||||||
* @return whether the server is in online mode or behind a proxy configured for online mode
|
* @return whether the server is in online mode or behind a proxy configured for online mode
|
||||||
*/
|
*/
|
||||||
boolean isProxyOnlineMode();
|
boolean isProxyOnlineMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether the server is configured to work behind a proxy.
|
||||||
|
* <p>
|
||||||
|
* This returns true if either Velocity or BungeeCord is enabled.
|
||||||
|
*
|
||||||
|
* @return whether the server is configured to work behind a proxy
|
||||||
|
*/
|
||||||
|
boolean isProxyEnabled();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
package io.papermc.paper.configuration;
|
package io.papermc.paper.configuration;
|
||||||
|
|
||||||
|
import org.spigotmc.SpigotConfig;
|
||||||
|
|
||||||
public class PaperServerConfiguration implements ServerConfiguration {
|
public class PaperServerConfiguration implements ServerConfiguration {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isProxyOnlineMode() {
|
public boolean isProxyOnlineMode() {
|
||||||
return GlobalConfiguration.get().proxies.isProxyOnlineMode();
|
return GlobalConfiguration.get().proxies.isProxyOnlineMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isProxyEnabled() {
|
||||||
|
return GlobalConfiguration.get().proxies.velocity.enabled || SpigotConfig.bungee;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue