getPluginManager().registerCommand( null, new CommandReload() ); getPluginManager().registerCommand( null, new CommandEnd() ); getPluginManager().registerCommand( null, new CommandIP() ); getPluginManager().registerCommand( null, new CommandBungee() ); getPluginManager().registerCommand( null, new CommandPerms() );
while ( bungee.isRunning && ( line = bungee.getConsoleReader().readLine( ">" ) ) != null ) if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) )
@Override public void done(ServerPing result, Throwable error) { if ( error != null ) { result = new ServerPing(); result.setDescription( bungee.getTranslation( "ping_cannot_connect" ) ); bungee.getLogger().log( Level.WARNING, "Error pinging remote server", error ); } Callback<ProxyPingEvent> callback = new Callback<ProxyPingEvent>() { @Override public void done(ProxyPingEvent pingResult, Throwable error) { Gson gson = BungeeCord.getInstance().gson; unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) ); if ( bungee.getConnectionThrottle() != null ) { bungee.getConnectionThrottle().unthrottle( getAddress().getAddress() ); } } }; bungee.getPluginManager().callEvent( new ProxyPingEvent( InitialHandler.this, result, callback ) ); } };
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
@Override public void execute(CommandSender sender, String[] args) { BungeeCord.getInstance().config.load(); BungeeCord.getInstance().reloadMessages(); BungeeCord.getInstance().stopListeners(); BungeeCord.getInstance().startListeners(); BungeeCord.getInstance().getPluginManager().callEvent( new ProxyReloadEvent( sender ) ); sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "BungeeCord has been reloaded." + " This is NOT advisable and you will not be supported with any issues that arise! Please restart BungeeCord ASAP." ); } }
bungee.getPluginManager().callEvent( new PreLoginEvent( InitialHandler.this, callback ) );
bungee.getPluginManager().callEvent( new LoginEvent( InitialHandler.this, complete ) );
bungee.getPluginManager().callEvent( new ProxyPingEvent( this, legacy, callback ) );
while ( bungee.isRunning && ( line = bungee.getConsoleReader().readLine( ">" ) ) != null ) if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) )
bungee.getPluginManager().callEvent( new ProxyPingEvent( InitialHandler.this, result, callback ) );
public static void main(String[] args) throws Exception { BungeeCord bungee = new BungeeCord(); ProxyServer.setInstance( bungee ); bungee.getLogger().info( "Enabled BungeeCord version " + bungee.getVersion() ); bungee.start(); while ( bungee.isRunning ) { String line = bungee.getConsoleReader().readLine( ">" ); if ( line != null ) { if ( !bungee.getPluginManager().dispatchCommand( ConsoleCommandSender.getInstance(), line ) ) { bungee.getConsole().sendMessage( ChatColor.RED + "Command not found" ); } } } } }
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
@Override public void execute(CommandSender sender, String[] args) { BungeeCord.getInstance().config.load(); BungeeCord.getInstance().stopListeners(); BungeeCord.getInstance().startListeners(); BungeeCord.getInstance().getPluginManager().callEvent( new ProxyReloadEvent( sender ) ); sender.sendMessage( ChatColor.BOLD.toString() + ChatColor.RED.toString() + "Waterfall has been reloaded." + " This is NOT advisable and you will not be supported with any issues that arise! Please restart Waterfall ASAP." ); } }
bungee.getPluginManager().callEvent( new PreLoginEvent( InitialHandler.this, callback ) );
bungee.getPluginManager().callEvent( new LoginEvent( InitialHandler.this, complete ) );
bungee.getPluginManager().callEvent( new ProxyPingEvent( this, legacy, callback ) );