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
* @return a unmodifiable Collection of Strings which represent their permissions
*
* @return a unmodifiable Collection of Strings which represent their
* permissions
*/
public Collection<String> getPermissions();
}

View File

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

View File

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

View File

@@ -31,7 +31,7 @@ public class TextComponentSerializer extends BaseComponentSerializer implements
public JsonElement serialize(TextComponent src, Type typeOfSrc, JsonSerializationContext context)
{
List<BaseComponent> extra = src.getExtra();
if ( !src.hasFormatting() && (extra == null || extra.size() == 0) )
if ( !src.hasFormatting() && ( extra == null || extra.size() == 0 ) )
{
return new JsonPrimitive( src.getText() );
}