better check for bungeecord support
For some custom forks like Tuinity and such. Also this next warning is enormous and just annoying. I think there's should be some configurable option in the config to disable it. Can make a PR for this too if needed.
This commit is contained in:
parent
e02dd0e858
commit
d950d8eb22
|
@ -109,7 +109,6 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
// Enables very basic bungee support if not setup right
|
// Enables very basic bungee support if not setup right
|
||||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
if(this.checkIfBungee()) {
|
if(this.checkIfBungee()) {
|
||||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
|
||||||
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeListener(this));
|
this.getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", new BungeeListener(this));
|
||||||
|
|
||||||
this.getServer().getMessenger().registerOutgoingPluginChannel(this, channelName);
|
this.getServer().getMessenger().registerOutgoingPluginChannel(this, channelName);
|
||||||
|
@ -124,12 +123,14 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
private boolean checkIfBungee()
|
private boolean checkIfBungee()
|
||||||
{
|
{
|
||||||
// we check if the server is Spigot/Paper (because of the spigot.yml file)
|
// we check if the server is Spigot/Paper (because of the spigot.yml file)
|
||||||
if ( !getServer().getVersion().contains( "Spigot" ) && !getServer().getVersion().contains( "Paper" ) )
|
try {
|
||||||
{
|
Class.forName("org.spigotmc.SpigotConfig");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
this.getServer().getConsoleSender().sendMessage( "\u00A7ePossibly unsupported version for bungee messages detected, channels won't be enabled." );
|
this.getServer().getConsoleSender().sendMessage( "\u00A7ePossibly unsupported version for bungee messages detected, channels won't be enabled." );
|
||||||
getLogger().info("If you believe this shouldn't be the case please contact us on discord https://discord.gg/fAJ3xJg");
|
getLogger().info("If you believe this shouldn't be the case please contact us on discord https://discord.gg/fAJ3xJg");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !getServer().spigot().getConfig().getConfigurationSection("settings").getBoolean( "bungeecord" ) )
|
if ( !getServer().spigot().getConfig().getConfigurationSection("settings").getBoolean( "bungeecord" ) )
|
||||||
{
|
{
|
||||||
this.getServer().getConsoleSender().sendMessage( "\n\n\u00A7eThis server does not have BungeeCord enabled.\n" +
|
this.getServer().getConsoleSender().sendMessage( "\n\n\u00A7eThis server does not have BungeeCord enabled.\n" +
|
||||||
|
@ -141,6 +142,7 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
getLogger().warning( "Advanced bungee features disabled for Advanced Portals as bungee isn't enabled on the server (spigot.yml)" );
|
getLogger().warning( "Advanced bungee features disabled for Advanced Portals as bungee isn't enabled on the server (spigot.yml)" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue