mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 03:05:49 +01:00
#1583: Two additions to console behaviour:
1) Stop trying to read anything if the console is hooked up to /dev/null 2) Don't even bother in the first place if --noconsole is used as an argument.
This commit is contained in:
parent
c626254825
commit
8a1030e21c
@ -23,6 +23,7 @@ public class BungeeCordLauncher
|
||||
OptionParser parser = new OptionParser();
|
||||
parser.allowsUnrecognizedOptions();
|
||||
parser.acceptsAll( Arrays.asList( "v", "version" ) );
|
||||
parser.acceptsAll( Arrays.asList( "noconsole" ) );
|
||||
|
||||
OptionSet options = parser.parse( args );
|
||||
|
||||
@ -53,10 +54,10 @@ public class BungeeCordLauncher
|
||||
bungee.getLogger().info( "Enabled BungeeCord version " + bungee.getVersion() );
|
||||
bungee.start();
|
||||
|
||||
while ( bungee.isRunning )
|
||||
if ( !options.has( "noconsole" ) )
|
||||
{
|
||||
String line = bungee.getConsoleReader().readLine( ">" );
|
||||
if ( line != null )
|
||||
String line;
|
||||
while ( bungee.isRunning && ( line = bungee.getConsoleReader().readLine( ">" ) ) != null )
|
||||
{
|
||||
if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user