From 9b2bb07d89e8ba319d566e31dbdd136f3a78259c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 28 Jan 2018 10:23:52 +1100 Subject: [PATCH] Fix some source code formatting --- .../md_5/bungee/api/chat/BaseComponent.java | 2 +- .../config/DefaultConfigurationTest.java | 1 + .../net/md_5/bungee/protocol/Protocol.java | 25 +++++++++++-------- .../net/md_5/bungee/chat/ComponentsTest.java | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/BaseComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/BaseComponent.java index 4bd60c33..6f8c9736 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/BaseComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/BaseComponent.java @@ -79,7 +79,7 @@ public abstract class BaseComponent copyFormatting( old ); } - public void copyFormatting( BaseComponent component ) + public void copyFormatting(BaseComponent component) { setColor( component.getColorRaw() ); setBold( component.isBoldRaw() ); diff --git a/config/src/test/java/net/md_5/bungee/config/DefaultConfigurationTest.java b/config/src/test/java/net/md_5/bungee/config/DefaultConfigurationTest.java index a9a5b9df..3ea12bb1 100644 --- a/config/src/test/java/net/md_5/bungee/config/DefaultConfigurationTest.java +++ b/config/src/test/java/net/md_5/bungee/config/DefaultConfigurationTest.java @@ -5,6 +5,7 @@ import org.junit.Test; public class DefaultConfigurationTest { + @Test public void testDefaultValues() { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java index f06aa95a..cd065631 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/Protocol.java @@ -251,8 +251,8 @@ public enum Protocol /*========================================================================*/ public static final int MAX_PACKET_ID = 0xFF; /*========================================================================*/ - public final DirectionData TO_SERVER = new DirectionData(this, ProtocolConstants.Direction.TO_SERVER ); - public final DirectionData TO_CLIENT = new DirectionData(this, ProtocolConstants.Direction.TO_CLIENT ); + public final DirectionData TO_SERVER = new DirectionData( this, ProtocolConstants.Direction.TO_SERVER ); + public final DirectionData TO_CLIENT = new DirectionData( this, ProtocolConstants.Direction.TO_CLIENT ); public static void main(String[] args) { @@ -289,7 +289,8 @@ public enum Protocol } @RequiredArgsConstructor - private static class ProtocolData { + private static class ProtocolData + { private final int protocolVersion; private final TObjectIntMap> packetMap = new TObjectIntHashMap<>( MAX_PACKET_ID ); @@ -297,13 +298,17 @@ public enum Protocol } @RequiredArgsConstructor - private static class ProtocolMapping { + private static class ProtocolMapping + { + private final int protocolVersion; private final int packetID; } + // Helper method - private static ProtocolMapping map(int protocol, int id) { - return new ProtocolMapping(protocol, id); + private static ProtocolMapping map(int protocol, int id) + { + return new ProtocolMapping( protocol, id ); } @RequiredArgsConstructor @@ -337,7 +342,7 @@ public enum Protocol linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12, Arrays.asList( ProtocolConstants.MINECRAFT_1_12_1 ) ); - linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12_1, Arrays.asList( + linkedProtocols.put( ProtocolConstants.MINECRAFT_1_12_1, Arrays.asList( ProtocolConstants.MINECRAFT_1_12_2 ) ); } @@ -358,7 +363,7 @@ public enum Protocol public final DefinedPacket createPacket(int id, int version) { ProtocolData protocolData = getProtocolData( version ); - if (protocolData == null) + if ( protocolData == null ) { throw new BadPacketException( "Unsupported protocol version" ); } @@ -377,7 +382,7 @@ public enum Protocol } } - protected final void registerPacket(Class packetClass, ProtocolMapping ...mappings) + protected final void registerPacket(Class packetClass, ProtocolMapping... mappings) { try { @@ -415,7 +420,7 @@ public enum Protocol { ProtocolData protocolData = getProtocolData( version ); - if (protocolData == null) + if ( protocolData == null ) { throw new BadPacketException( "Unsupported protocol version" ); } diff --git a/proxy/src/test/java/net/md_5/bungee/chat/ComponentsTest.java b/proxy/src/test/java/net/md_5/bungee/chat/ComponentsTest.java index 3d9396d3..d521d08e 100644 --- a/proxy/src/test/java/net/md_5/bungee/chat/ComponentsTest.java +++ b/proxy/src/test/java/net/md_5/bungee/chat/ComponentsTest.java @@ -16,7 +16,7 @@ public class ComponentsTest @Test public void testBuilderClone() { - ComponentBuilder builder = new ComponentBuilder("Hel").color(ChatColor.RED).append("lo").color(ChatColor.DARK_RED); + ComponentBuilder builder = new ComponentBuilder( "Hel" ).color( ChatColor.RED ).append( "lo" ).color( ChatColor.DARK_RED ); ComponentBuilder cloned = new ComponentBuilder( builder ); Assert.assertEquals( TextComponent.toLegacyText( builder.create() ), TextComponent.toLegacyText( cloned.create() ) );