From 0d377ae0e32ace1188d13572939abd000e9a6427 Mon Sep 17 00:00:00 2001 From: MiGoYAm Date: Sat, 11 Dec 2021 18:01:10 +0100 Subject: [PATCH] optimize imports --- src/main/java/ru/nanit/limbo/configuration/LimboConfig.java | 5 ++++- .../nanit/limbo/configuration/SocketAddressSerializer.java | 1 - .../ru/nanit/limbo/connection/ClientChannelInitializer.java | 2 +- .../java/ru/nanit/limbo/connection/ClientConnection.java | 6 +++--- .../ru/nanit/limbo/connection/pipeline/PacketDecoder.java | 3 ++- .../limbo/protocol/packets/login/PacketLoginStart.java | 3 ++- .../limbo/protocol/packets/status/PacketStatusRequest.java | 3 ++- .../limbo/protocol/packets/status/PacketStatusResponse.java | 3 ++- src/main/java/ru/nanit/limbo/protocol/registry/State.java | 6 +++--- src/main/java/ru/nanit/limbo/server/LimboServer.java | 1 - src/main/java/ru/nanit/limbo/server/data/Title.java | 1 - 11 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java b/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java index 486ea46c..17cef9fd 100644 --- a/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java +++ b/src/main/java/ru/nanit/limbo/configuration/LimboConfig.java @@ -7,7 +7,10 @@ import ru.nanit.limbo.server.data.*; import ru.nanit.limbo.util.Colors; -import java.io.*; +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; import java.net.SocketAddress; import java.nio.file.Files; import java.nio.file.Path; diff --git a/src/main/java/ru/nanit/limbo/configuration/SocketAddressSerializer.java b/src/main/java/ru/nanit/limbo/configuration/SocketAddressSerializer.java index 613f9c27..f5ff6269 100644 --- a/src/main/java/ru/nanit/limbo/configuration/SocketAddressSerializer.java +++ b/src/main/java/ru/nanit/limbo/configuration/SocketAddressSerializer.java @@ -2,7 +2,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.configurate.ConfigurationNode; -import org.spongepowered.configurate.serialize.SerializationException; import org.spongepowered.configurate.serialize.TypeSerializer; import java.lang.reflect.Type; diff --git a/src/main/java/ru/nanit/limbo/connection/ClientChannelInitializer.java b/src/main/java/ru/nanit/limbo/connection/ClientChannelInitializer.java index 827fc999..879eca16 100644 --- a/src/main/java/ru/nanit/limbo/connection/ClientChannelInitializer.java +++ b/src/main/java/ru/nanit/limbo/connection/ClientChannelInitializer.java @@ -4,9 +4,9 @@ import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.handler.timeout.ReadTimeoutHandler; -import ru.nanit.limbo.connection.pipeline.VarIntFrameDecoder; import ru.nanit.limbo.connection.pipeline.PacketDecoder; import ru.nanit.limbo.connection.pipeline.PacketEncoder; +import ru.nanit.limbo.connection.pipeline.VarIntFrameDecoder; import ru.nanit.limbo.connection.pipeline.VarIntLengthEncoder; import ru.nanit.limbo.server.LimboServer; diff --git a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java index d6a3286e..6335d938 100644 --- a/src/main/java/ru/nanit/limbo/connection/ClientConnection.java +++ b/src/main/java/ru/nanit/limbo/connection/ClientConnection.java @@ -10,13 +10,13 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import ru.nanit.limbo.LimboConstants; +import ru.nanit.limbo.connection.pipeline.PacketDecoder; +import ru.nanit.limbo.connection.pipeline.PacketEncoder; import ru.nanit.limbo.protocol.ByteMessage; import ru.nanit.limbo.protocol.PreEncodedPacket; +import ru.nanit.limbo.protocol.packets.PacketHandshake; import ru.nanit.limbo.protocol.packets.login.*; import ru.nanit.limbo.protocol.packets.play.*; -import ru.nanit.limbo.connection.pipeline.PacketDecoder; -import ru.nanit.limbo.connection.pipeline.PacketEncoder; -import ru.nanit.limbo.protocol.packets.PacketHandshake; import ru.nanit.limbo.protocol.packets.status.PacketStatusPing; import ru.nanit.limbo.protocol.packets.status.PacketStatusRequest; import ru.nanit.limbo.protocol.packets.status.PacketStatusResponse; diff --git a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java index e25eff8e..62d499be 100644 --- a/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java +++ b/src/main/java/ru/nanit/limbo/connection/pipeline/PacketDecoder.java @@ -3,7 +3,8 @@ import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageDecoder; -import ru.nanit.limbo.protocol.*; +import ru.nanit.limbo.protocol.ByteMessage; +import ru.nanit.limbo.protocol.Packet; import ru.nanit.limbo.protocol.registry.State; import ru.nanit.limbo.protocol.registry.Version; import ru.nanit.limbo.util.Logger; diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginStart.java b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginStart.java index eed9e08c..3f768fa8 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginStart.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/login/PacketLoginStart.java @@ -1,6 +1,7 @@ package ru.nanit.limbo.protocol.packets.login; -import ru.nanit.limbo.protocol.*; +import ru.nanit.limbo.protocol.ByteMessage; +import ru.nanit.limbo.protocol.PacketIn; import ru.nanit.limbo.protocol.registry.Version; public class PacketLoginStart implements PacketIn { diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusRequest.java b/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusRequest.java index ed18d344..ff3b92ef 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusRequest.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusRequest.java @@ -1,6 +1,7 @@ package ru.nanit.limbo.protocol.packets.status; -import ru.nanit.limbo.protocol.*; +import ru.nanit.limbo.protocol.ByteMessage; +import ru.nanit.limbo.protocol.PacketIn; import ru.nanit.limbo.protocol.registry.Version; public class PacketStatusRequest implements PacketIn { diff --git a/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusResponse.java b/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusResponse.java index bacbfd1a..df081426 100644 --- a/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusResponse.java +++ b/src/main/java/ru/nanit/limbo/protocol/packets/status/PacketStatusResponse.java @@ -1,6 +1,7 @@ package ru.nanit.limbo.protocol.packets.status; -import ru.nanit.limbo.protocol.*; +import ru.nanit.limbo.protocol.ByteMessage; +import ru.nanit.limbo.protocol.PacketOut; import ru.nanit.limbo.protocol.registry.Version; import ru.nanit.limbo.server.LimboServer; diff --git a/src/main/java/ru/nanit/limbo/protocol/registry/State.java b/src/main/java/ru/nanit/limbo/protocol/registry/State.java index 9dbdde3a..ad7cb97e 100644 --- a/src/main/java/ru/nanit/limbo/protocol/registry/State.java +++ b/src/main/java/ru/nanit/limbo/protocol/registry/State.java @@ -1,18 +1,18 @@ package ru.nanit.limbo.protocol.registry; import ru.nanit.limbo.protocol.Packet; -import ru.nanit.limbo.protocol.packets.*; +import ru.nanit.limbo.protocol.packets.PacketHandshake; import ru.nanit.limbo.protocol.packets.login.*; import ru.nanit.limbo.protocol.packets.play.*; import ru.nanit.limbo.protocol.packets.status.PacketStatusPing; import ru.nanit.limbo.protocol.packets.status.PacketStatusRequest; import ru.nanit.limbo.protocol.packets.status.PacketStatusResponse; -import static ru.nanit.limbo.protocol.registry.Version.*; - import java.util.*; import java.util.function.Supplier; +import static ru.nanit.limbo.protocol.registry.Version.*; + public enum State { HANDSHAKING(0) { diff --git a/src/main/java/ru/nanit/limbo/server/LimboServer.java b/src/main/java/ru/nanit/limbo/server/LimboServer.java index 578b5278..12dcb34f 100644 --- a/src/main/java/ru/nanit/limbo/server/LimboServer.java +++ b/src/main/java/ru/nanit/limbo/server/LimboServer.java @@ -13,7 +13,6 @@ import ru.nanit.limbo.configuration.LimboConfig; import ru.nanit.limbo.connection.ClientChannelInitializer; import ru.nanit.limbo.connection.ClientConnection; -import ru.nanit.limbo.protocol.registry.State; import ru.nanit.limbo.util.Logger; import ru.nanit.limbo.world.DimensionRegistry; diff --git a/src/main/java/ru/nanit/limbo/server/data/Title.java b/src/main/java/ru/nanit/limbo/server/data/Title.java index 9697f840..3519a25d 100644 --- a/src/main/java/ru/nanit/limbo/server/data/Title.java +++ b/src/main/java/ru/nanit/limbo/server/data/Title.java @@ -2,7 +2,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.configurate.ConfigurationNode; -import org.spongepowered.configurate.serialize.SerializationException; import org.spongepowered.configurate.serialize.TypeSerializer; import ru.nanit.limbo.util.Colors;