Fix formatting
This commit is contained in:
parent
1cd3e42182
commit
80b3135a93
@ -104,13 +104,13 @@ public class ServerPing
|
||||
@Deprecated
|
||||
public ServerPing(Protocol version, Players players, String description, String favicon)
|
||||
{
|
||||
this( version, players, new TextComponent( TextComponent.fromLegacyText(description) ), favicon == null ? null : Favicon.create( favicon ) );
|
||||
this( version, players, new TextComponent( TextComponent.fromLegacyText( description ) ), favicon == null ? null : Favicon.create( favicon ) );
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public ServerPing(Protocol version, Players players, String description, Favicon favicon)
|
||||
{
|
||||
this( version, players, new TextComponent( TextComponent.fromLegacyText(description) ), favicon );
|
||||
this( version, players, new TextComponent( TextComponent.fromLegacyText( description ) ), favicon );
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -136,20 +136,24 @@ public class ServerPing
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setDescription(String description) {
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = new TextComponent( TextComponent.fromLegacyText( description ) );
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getDescription() {
|
||||
public String getDescription()
|
||||
{
|
||||
return BaseComponent.toLegacyText( description );
|
||||
}
|
||||
|
||||
public void setDescriptionComponent(BaseComponent description) {
|
||||
public void setDescriptionComponent(BaseComponent description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public BaseComponent getDescriptionComponent() {
|
||||
public BaseComponent getDescriptionComponent()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,8 @@ public class AsyncEvent<T> extends Event
|
||||
{
|
||||
done.done( (T) this, null );
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
{
|
||||
latch.decrementAndGet();
|
||||
}
|
||||
}
|
||||
|
@ -250,11 +250,13 @@ public class ComponentBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* Specify that we do not want to retain anything from the previous component.
|
||||
* Specify that we do not want to retain anything from the previous
|
||||
* component.
|
||||
*/
|
||||
NONE,
|
||||
/**
|
||||
* Specify that we want the formatting retained from the previous component.
|
||||
* Specify that we want the formatting retained from the previous
|
||||
* component.
|
||||
*/
|
||||
FORMATTING,
|
||||
/**
|
||||
@ -262,7 +264,8 @@ public class ComponentBuilder
|
||||
*/
|
||||
EVENTS,
|
||||
/**
|
||||
* Specify that we want to retain everything from the previous component.
|
||||
* Specify that we want to retain everything from the previous
|
||||
* component.
|
||||
*/
|
||||
ALL
|
||||
}
|
||||
|
@ -140,7 +140,8 @@ public class TranslatableComponent extends BaseComponent
|
||||
try
|
||||
{
|
||||
trans = locales.getString( translate );
|
||||
} catch ( MissingResourceException e ) {
|
||||
} catch ( MissingResourceException ex )
|
||||
{
|
||||
trans = translate;
|
||||
}
|
||||
|
||||
@ -184,7 +185,8 @@ public class TranslatableComponent extends BaseComponent
|
||||
try
|
||||
{
|
||||
trans = locales.getString( translate );
|
||||
} catch ( MissingResourceException e ) {
|
||||
} catch ( MissingResourceException e )
|
||||
{
|
||||
trans = translate;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,9 @@ import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TranslatableComponentTest {
|
||||
public class TranslatableComponentTest
|
||||
{
|
||||
|
||||
@Test
|
||||
public void testMissingPlaceholdersAdded()
|
||||
{
|
||||
|
@ -22,8 +22,8 @@ public abstract class ConfigurationProvider
|
||||
{
|
||||
return providers.get( provider );
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
public abstract void save(Configuration config, File file) throws IOException;
|
||||
|
||||
public abstract void save(Configuration config, Writer writer);
|
||||
|
2
pom.xml
2
pom.xml
@ -170,7 +170,7 @@
|
||||
<action>
|
||||
<execute>
|
||||
<runOnIncremental>false</runOnIncremental>
|
||||
</execute >
|
||||
</execute>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
|
@ -129,7 +129,6 @@ public enum Protocol
|
||||
private final TIntObjectMap<TIntIntMap> packetRemap = new TIntObjectHashMap<>();
|
||||
private final TIntObjectMap<TIntIntMap> packetRemapInv = new TIntObjectHashMap<>();
|
||||
|
||||
|
||||
{
|
||||
packetRemap.put( ProtocolConstants.MINECRAFT_1_8, new TIntIntHashMap() );
|
||||
packetRemapInv.put( ProtocolConstants.MINECRAFT_1_8, new TIntIntHashMap() );
|
||||
|
@ -54,7 +54,7 @@ public class ClientSettings extends DefinedPacket
|
||||
buf.writeByte( skinParts );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
DefinedPacket.writeVarInt(mainHand, buf);
|
||||
DefinedPacket.writeVarInt( mainHand, buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,11 +22,11 @@ public class PlayerListItem extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
action = Action.values()[ DefinedPacket.readVarInt( buf )];
|
||||
action = Action.values()[DefinedPacket.readVarInt( buf )];
|
||||
items = new Item[ DefinedPacket.readVarInt( buf ) ];
|
||||
for ( int i = 0; i < items.length; i++ )
|
||||
{
|
||||
Item item = items[ i ] = new Item();
|
||||
Item item = items[i] = new Item();
|
||||
item.setUuid( DefinedPacket.readUUID( buf ) );
|
||||
switch ( action )
|
||||
{
|
||||
@ -39,13 +39,13 @@ public class PlayerListItem extends DefinedPacket
|
||||
String value = DefinedPacket.readString( buf );
|
||||
if ( buf.readBoolean() )
|
||||
{
|
||||
item.properties[ j] = new String[]
|
||||
item.properties[j] = new String[]
|
||||
{
|
||||
name, value, DefinedPacket.readString( buf )
|
||||
};
|
||||
} else
|
||||
{
|
||||
item.properties[ j ] = new String[]
|
||||
item.properties[j] = new String[]
|
||||
{
|
||||
name, value
|
||||
};
|
||||
@ -88,12 +88,12 @@ public class PlayerListItem extends DefinedPacket
|
||||
DefinedPacket.writeVarInt( item.properties.length, buf );
|
||||
for ( String[] prop : item.properties )
|
||||
{
|
||||
DefinedPacket.writeString( prop[ 0], buf );
|
||||
DefinedPacket.writeString( prop[ 1], buf );
|
||||
DefinedPacket.writeString( prop[0], buf );
|
||||
DefinedPacket.writeString( prop[1], buf );
|
||||
if ( prop.length >= 3 )
|
||||
{
|
||||
buf.writeBoolean( true );
|
||||
DefinedPacket.writeString( prop[ 2], buf );
|
||||
DefinedPacket.writeString( prop[2], buf );
|
||||
} else
|
||||
{
|
||||
buf.writeBoolean( false );
|
||||
|
@ -33,7 +33,7 @@ public class PluginMessage extends DefinedPacket
|
||||
{
|
||||
tag = readString( buf );
|
||||
int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000;
|
||||
Preconditions.checkArgument(buf.readableBytes() < maxSize);
|
||||
Preconditions.checkArgument( buf.readableBytes() < maxSize );
|
||||
data = new byte[ buf.readableBytes() ];
|
||||
buf.readBytes( data );
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class Team extends DefinedPacket
|
||||
nameTagVisibility = readString( buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
collisionRule = readString(buf);
|
||||
collisionRule = readString( buf );
|
||||
}
|
||||
color = buf.readByte();
|
||||
}
|
||||
@ -82,7 +82,7 @@ public class Team extends DefinedPacket
|
||||
writeString( nameTagVisibility, buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
writeString( collisionRule, buf);
|
||||
writeString( collisionRule, buf );
|
||||
}
|
||||
buf.writeByte( color );
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import java.util.UUID;
|
||||
|
||||
public class PlayerInfoSerializer implements JsonSerializer<ServerPing.PlayerInfo>, JsonDeserializer<ServerPing.PlayerInfo>
|
||||
{
|
||||
|
||||
@Override
|
||||
public ServerPing.PlayerInfo deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
|
||||
{
|
||||
|
@ -41,20 +41,17 @@ public abstract class EntityMap
|
||||
{
|
||||
if ( varint )
|
||||
{
|
||||
clientboundVarInts[ id ] = true;
|
||||
clientboundVarInts[id] = true;
|
||||
} else
|
||||
{
|
||||
clientboundInts[ id ] = true;
|
||||
clientboundInts[id] = true;
|
||||
}
|
||||
} else if ( varint )
|
||||
{
|
||||
serverboundVarInts[id] = true;
|
||||
} else
|
||||
{
|
||||
if ( varint )
|
||||
{
|
||||
serverboundVarInts[ id ] = true;
|
||||
} else
|
||||
{
|
||||
serverboundInts[ id ] = true;
|
||||
}
|
||||
serverboundInts[id] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,10 +101,10 @@ public abstract class EntityMap
|
||||
int packetId = DefinedPacket.readVarInt( packet );
|
||||
int packetIdLength = packet.readerIndex() - readerIndex;
|
||||
|
||||
if ( ints[ packetId ] )
|
||||
if ( ints[packetId] )
|
||||
{
|
||||
rewriteInt( packet, oldId, newId, readerIndex + packetIdLength );
|
||||
} else if ( varints[ packetId ] )
|
||||
} else if ( varints[packetId] )
|
||||
{
|
||||
rewriteVarInt( packet, oldId, newId, readerIndex + packetIdLength );
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import java.util.UUID;
|
||||
|
||||
class EntityMap_1_9 extends EntityMap
|
||||
{
|
||||
|
||||
static final EntityMap_1_9 INSTANCE = new EntityMap_1_9();
|
||||
|
||||
EntityMap_1_9()
|
||||
|
@ -4,7 +4,6 @@ import java.util.Map;
|
||||
import net.md_5.bungee.ServerConnector;
|
||||
import net.md_5.bungee.UserConnection;
|
||||
import net.md_5.bungee.forge.ForgeLogger.LogDirection;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
import net.md_5.bungee.protocol.packet.PluginMessage;
|
||||
|
||||
/**
|
||||
|
@ -72,8 +72,7 @@ public class ForgeUtils
|
||||
// We know from the regex that we have an int.
|
||||
return Integer.parseInt( matcher.group( 4 ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
Matcher matcher = ForgeConstants.FML_HANDSHAKE_VERSION_REGEX.matcher( fmlVersion );
|
||||
if ( matcher.find() )
|
||||
|
@ -53,7 +53,7 @@ public class ColouredWriter extends Handler
|
||||
}
|
||||
try
|
||||
{
|
||||
console.print( Ansi.ansi().eraseLine(Erase.ALL).toString() + ConsoleReader.RESET_LINE + s + Ansi.ansi().reset().toString() );
|
||||
console.print( Ansi.ansi().eraseLine( Erase.ALL ).toString() + ConsoleReader.RESET_LINE + s + Ansi.ansi().reset().toString() );
|
||||
console.drawLine();
|
||||
console.flush();
|
||||
} catch ( IOException ex )
|
||||
|
@ -75,11 +75,11 @@ public class Global extends TabList
|
||||
String[][] props = new String[ loginResult.getProperties().length ][];
|
||||
for ( int j = 0; j < props.length; j++ )
|
||||
{
|
||||
props[ j ] = new String[]
|
||||
props[j] = new String[]
|
||||
{
|
||||
loginResult.getProperties()[ j ].getName(),
|
||||
loginResult.getProperties()[ j ].getValue(),
|
||||
loginResult.getProperties()[ j ].getSignature()
|
||||
loginResult.getProperties()[j].getName(),
|
||||
loginResult.getProperties()[j].getValue(),
|
||||
loginResult.getProperties()[j].getSignature()
|
||||
};
|
||||
}
|
||||
item.setProperties( props );
|
||||
@ -103,11 +103,11 @@ public class Global extends TabList
|
||||
String[][] props = new String[ loginResult.getProperties().length ][];
|
||||
for ( int j = 0; j < props.length; j++ )
|
||||
{
|
||||
props[ j ] = new String[]
|
||||
props[j] = new String[]
|
||||
{
|
||||
loginResult.getProperties()[ j ].getName(),
|
||||
loginResult.getProperties()[ j ].getValue(),
|
||||
loginResult.getProperties()[ j ].getSignature()
|
||||
loginResult.getProperties()[j].getName(),
|
||||
loginResult.getProperties()[j].getValue(),
|
||||
loginResult.getProperties()[j].getSignature()
|
||||
};
|
||||
}
|
||||
item.setProperties( props );
|
||||
|
@ -41,11 +41,11 @@ public abstract class TabList
|
||||
String[][] props = new String[ loginResult.getProperties().length ][];
|
||||
for ( int i = 0; i < props.length; i++ )
|
||||
{
|
||||
props[ i ] = new String[]
|
||||
props[i] = new String[]
|
||||
{
|
||||
loginResult.getProperties()[ i ].getName(),
|
||||
loginResult.getProperties()[ i ].getValue(),
|
||||
loginResult.getProperties()[ i ].getSignature()
|
||||
loginResult.getProperties()[i].getName(),
|
||||
loginResult.getProperties()[i].getValue(),
|
||||
loginResult.getProperties()[i].getSignature()
|
||||
};
|
||||
}
|
||||
item.setProperties( props );
|
||||
|
@ -84,8 +84,8 @@ public class ComponentsTest
|
||||
@Test
|
||||
public void testBuilderReset()
|
||||
{
|
||||
BaseComponent[] components = new ComponentBuilder( "Hello " ).color(ChatColor.RED)
|
||||
.append("World").reset().create();
|
||||
BaseComponent[] components = new ComponentBuilder( "Hello " ).color( ChatColor.RED )
|
||||
.append( "World" ).reset().create();
|
||||
|
||||
Assert.assertEquals( components[0].getColor(), ChatColor.RED );
|
||||
Assert.assertEquals( components[1].getColor(), ChatColor.WHITE );
|
||||
@ -113,7 +113,7 @@ public class ComponentsTest
|
||||
ClickEvent testClickEvent = new ClickEvent( ClickEvent.Action.OPEN_URL, "http://www.example.com" );
|
||||
|
||||
BaseComponent[] eventRetention = new ComponentBuilder( "Hello " ).color( ChatColor.RED )
|
||||
.event( testEvent ).event(testClickEvent).append("World", ComponentBuilder.FormatRetention.EVENTS).create();
|
||||
.event( testEvent ).event( testClickEvent ).append( "World", ComponentBuilder.FormatRetention.EVENTS ).create();
|
||||
|
||||
Assert.assertEquals( eventRetention[0].getColor(), ChatColor.RED );
|
||||
Assert.assertEquals( eventRetention[0].getHoverEvent(), testEvent );
|
||||
|
@ -5,7 +5,8 @@ import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
public class BoundedArrayListTest {
|
||||
public class BoundedArrayListTest
|
||||
{
|
||||
|
||||
@Test
|
||||
public void testGoodAdd() throws Exception
|
||||
@ -63,7 +64,7 @@ public class BoundedArrayListTest {
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void testBadAddAll() throws Exception
|
||||
{
|
||||
BoundedArrayList<Object> list = new BoundedArrayList<>(0);
|
||||
BoundedArrayList<Object> list = new BoundedArrayList<>( 0 );
|
||||
list.addAll( ImmutableList.of( new Object() ) );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user