From 19c3c23b86746022d7b5c02c93fa409431162ef8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 11 Apr 2013 20:26:55 +1000 Subject: [PATCH] Reformat all code --- .../md_5/bungee/api/config/ListenerInfo.java | 3 ++- .../bungee/api/plugin/PluginClassloader.java | 2 +- .../md_5/bungee/api/plugin/PluginManager.java | 19 ++++++++++--------- .../net/md_5/bungee/BungeeServerInfo.java | 2 +- .../java/net/md_5/bungee/UserConnection.java | 2 +- .../bungee/connection/DownstreamBridge.java | 2 +- .../bungee/connection/InitialHandler.java | 6 +++--- .../bungee/tablist/ServerUniqueTabList.java | 2 +- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/config/ListenerInfo.java b/api/src/main/java/net/md_5/bungee/api/config/ListenerInfo.java index c0f11496..af4999fd 100644 --- a/api/src/main/java/net/md_5/bungee/api/config/ListenerInfo.java +++ b/api/src/main/java/net/md_5/bungee/api/config/ListenerInfo.java @@ -33,7 +33,8 @@ public class ListenerInfo */ private final String defaultServer; /** - * Name of the server which users will be taken when current server goes down. + * Name of the server which users will be taken when current server goes + * down. */ private final String fallbackServer; /** diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginClassloader.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginClassloader.java index 3cd2bf9a..c5d0dd09 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginClassloader.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginClassloader.java @@ -45,6 +45,6 @@ public class PluginClassloader extends URLClassLoader } } } - throw new ClassNotFoundException(name); + throw new ClassNotFoundException( name ); } } diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index cdfaae1e..c2e76f7e 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -150,9 +150,9 @@ public class PluginManager private boolean enablePlugin(Map pluginStatuses, Stack dependStack, Plugin plugin) { - if ( pluginStatuses.containsKey(plugin) ) + if ( pluginStatuses.containsKey( plugin ) ) { - return pluginStatuses.get(plugin); + return pluginStatuses.get( plugin ); } // success status @@ -161,18 +161,19 @@ public class PluginManager // try to load dependencies first for ( String dependName : plugin.getDescription().getDepends() ) { - Plugin depend = this.plugins.get(dependName); - Boolean dependStatus = depend != null ? pluginStatuses.get(depend) : Boolean.FALSE; + Plugin depend = this.plugins.get( dependName ); + Boolean dependStatus = depend != null ? pluginStatuses.get( depend ) : Boolean.FALSE; - if ( dependStatus == null ) { - if ( dependStack.contains(depend) ) + if ( dependStatus == null ) + { + if ( dependStack.contains( depend ) ) { StringBuilder dependencyGraph = new StringBuilder(); for ( Plugin element : dependStack ) { - dependencyGraph.append(element.getDescription().getName()).append(" -> "); + dependencyGraph.append( element.getDescription().getName() ).append( " -> " ); } - dependencyGraph.append(plugin.getDescription().getName()).append(" -> ").append(dependName); + dependencyGraph.append( plugin.getDescription().getName() ).append( " -> " ).append( dependName ); ProxyServer.getInstance().getLogger().log( Level.WARNING, "Circular dependency detected: " + dependencyGraph ); status = false; } else @@ -187,7 +188,7 @@ public class PluginManager { ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} (required by {1}) is unavailable", new Object[] { - depend.getDescription().getName(), plugin.getDescription().getName() + depend.getDescription().getName(), plugin.getDescription().getName() } ); status = false; } diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java index 4762ce3b..51e2fded 100644 --- a/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeServerInfo.java @@ -61,7 +61,7 @@ public class BungeeServerInfo extends ServerInfo { if ( future.isSuccess() ) { - future.channel().pipeline().get( HandlerBoss.class ).setHandler( new PingHandler( BungeeServerInfo.this, callback ) ); + future.channel().pipeline().get( HandlerBoss.class ).setHandler( new PingHandler( BungeeServerInfo.this, callback ) ); } else { callback.done( null, future.cause() ); diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 629c11f3..83b234c5 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -93,7 +93,7 @@ public final class UserConnection implements ProxiedPlayer { Preconditions.checkArgument( name.length() <= 16, "Display name cannot be longer than 16 characters" ); bungee.getTabListHandler().onDisconnect( this ); - displayName=name; + displayName = name; bungee.getTabListHandler().onConnect( this ); } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java index b24d3154..6a77f527 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/DownstreamBridge.java @@ -158,7 +158,7 @@ public class DownstreamBridge extends PacketHandler { t = con.serverSentScoreboard.getTeam( team.name ); } - + if ( t != null ) { if ( team.mode == 0 || team.mode == 2 ) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index 66570331..fdf61746 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -175,16 +175,16 @@ public class InitialHandler extends PacketHandler implements PendingConnection { old.disconnect( "You are already connected to the server" ); } - + } - + // fire login event LoginEvent event = new LoginEvent( InitialHandler.this ); if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) { disconnect( event.getCancelReason() ); } - + Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, shared ); Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, shared ); ch.write( new PacketFCEncryptionResponse() ); diff --git a/proxy/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java b/proxy/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java index 3c17aab5..2cf3fdc5 100644 --- a/proxy/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java +++ b/proxy/src/main/java/net/md_5/bungee/tablist/ServerUniqueTabList.java @@ -40,7 +40,7 @@ public class ServerUniqueTabList implements TabListHandler { for ( String username : usernames ) { - ( (UserConnection) player ).sendPacket(new PacketC9PlayerListItem( username, false, 9999 ) ); + ( (UserConnection) player ).sendPacket( new PacketC9PlayerListItem( username, false, 9999 ) ); } usernames.clear(); }