Code format.

This commit is contained in:
md_5 2014-04-13 14:15:41 +10:00
parent 3b71a2b570
commit dc2da29c16
15 changed files with 46 additions and 32 deletions

View File

@ -85,7 +85,9 @@ public interface CommandSender
/** /**
* Get all Permissions which this CommandSender has * Get all Permissions which this CommandSender has
* @return a unmodifiable Collection of Strings which represent their permissions *
* @return a unmodifiable Collection of Strings which represent their
* permissions
*/ */
public Collection<String> getPermissions(); public Collection<String> getPermissions();
} }

View File

@ -47,7 +47,10 @@ public class TextComponent extends BaseComponent
c += 32; c += 32;
} }
ChatColor format = ChatColor.getByChar( c ); ChatColor format = ChatColor.getByChar( c );
if ( format == null ) continue; if ( format == null )
{
continue;
}
if ( builder.length() > 0 ) if ( builder.length() > 0 )
{ {
TextComponent old = component; TextComponent old = component;
@ -145,12 +148,13 @@ public class TextComponent extends BaseComponent
} }
/** /**
* Creates a TextComponent with blank text and the extras set * Creates a TextComponent with blank text and the extras set to the passed
* to the passed array * array
* *
* @param extras the extras to set * @param extras the extras to set
*/ */
public TextComponent(BaseComponent ...extras) { public TextComponent(BaseComponent... extras)
{
setText( "" ); setText( "" );
setExtra( Arrays.asList( extras ) ); setExtra( Arrays.asList( extras ) );
} }

View File

@ -75,7 +75,8 @@ public class BaseComponentSerializer
protected void serialize(JsonObject object, BaseComponent component, JsonSerializationContext context) protected void serialize(JsonObject object, BaseComponent component, JsonSerializationContext context)
{ {
boolean first = false; boolean first = false;
if ( ComponentSerializer.serializedComponents.get() == null ) { if ( ComponentSerializer.serializedComponents.get() == null )
{
first = true; first = true;
ComponentSerializer.serializedComponents.set( new HashSet<BaseComponent>() ); ComponentSerializer.serializedComponents.set( new HashSet<BaseComponent>() );
} }
@ -131,7 +132,8 @@ public class BaseComponentSerializer
} finally } finally
{ {
ComponentSerializer.serializedComponents.get().remove( component ); ComponentSerializer.serializedComponents.get().remove( component );
if (first) { if ( first )
{
ComponentSerializer.serializedComponents.set( null ); ComponentSerializer.serializedComponents.set( null );
} }
} }

View File

@ -2,10 +2,12 @@ package net.md_5.bungee.module.cmd.alert;
import net.md_5.bungee.api.plugin.Plugin; import net.md_5.bungee.api.plugin.Plugin;
public class PluginAlert extends Plugin { public class PluginAlert extends Plugin
{
@Override @Override
public void onEnable() { public void onEnable()
{
getProxy().getPluginManager().registerCommand( this, new CommandAlert() ); getProxy().getPluginManager().registerCommand( this, new CommandAlert() );
getProxy().getPluginManager().registerCommand( this, new CommandAlertRaw() ); getProxy().getPluginManager().registerCommand( this, new CommandAlertRaw() );
} }

View File

@ -95,8 +95,14 @@ public class CommandSend extends Command implements TabExecutor
matches.add( player.getName() ); matches.add( player.getName() );
} }
} }
if ( "all".startsWith( search ) ) matches.add( "all" ); if ( "all".startsWith( search ) )
if ( "current".startsWith( search ) ) matches.add( "current" ); {
matches.add( "all" );
}
if ( "current".startsWith( search ) )
{
matches.add( "current" );
}
} else } else
{ {
String search = args[1].toLowerCase(); String search = args[1].toLowerCase();

View File

@ -37,7 +37,6 @@ public enum Protocol
HANDSHAKE HANDSHAKE
{ {
{ {
TO_SERVER.registerPacket( 0x00, Handshake.class ); TO_SERVER.registerPacket( 0x00, Handshake.class );
} }
@ -46,7 +45,6 @@ public enum Protocol
GAME GAME
{ {
{ {
TO_CLIENT.registerPacket( 0x00, KeepAlive.class ); TO_CLIENT.registerPacket( 0x00, KeepAlive.class );
TO_CLIENT.registerPacket( 0x01, Login.class ); TO_CLIENT.registerPacket( 0x01, Login.class );
@ -72,7 +70,6 @@ public enum Protocol
STATUS STATUS
{ {
{ {
TO_CLIENT.registerPacket( 0x00, StatusResponse.class ); TO_CLIENT.registerPacket( 0x00, StatusResponse.class );
TO_CLIENT.registerPacket( 0x01, PingPacket.class ); TO_CLIENT.registerPacket( 0x01, PingPacket.class );
@ -85,7 +82,6 @@ public enum Protocol
LOGIN LOGIN
{ {
{ {
TO_CLIENT.registerPacket( 0x00, Kick.class ); TO_CLIENT.registerPacket( 0x00, Kick.class );
TO_CLIENT.registerPacket( 0x01, EncryptionRequest.class ); TO_CLIENT.registerPacket( 0x01, EncryptionRequest.class );

View File

@ -5,7 +5,8 @@ import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.plugin.Command; import net.md_5.bungee.api.plugin.Command;
/** /**
* Command to terminate the proxy instance. May only be used by the console by default. * Command to terminate the proxy instance. May only be used by the console by
* default.
*/ */
public class CommandEnd extends Command public class CommandEnd extends Command
{ {

View File

@ -13,7 +13,8 @@ public class LoginResult
@Data @Data
@AllArgsConstructor @AllArgsConstructor
public static class Property { public static class Property
{
private String name; private String name;
private String value; private String value;