diff --git a/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java b/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java index 8280879d..2df7f485 100644 --- a/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java +++ b/src/main/java/com/comphenix/protocol/injector/netty/ChannelInjector.java @@ -79,11 +79,15 @@ public class ChannelInjector extends ByteToMessageDecoder implements Injector { // Versioning private static Class PACKET_SET_PROTOCOL = null; - private static final AtomicInteger keyId = new AtomicInteger(); - private static final AttributeKey PROTOCOL_KEY; + private static AtomicInteger keyId = new AtomicInteger(); + private static AttributeKey PROTOCOL_KEY; static { - PROTOCOL_KEY = AttributeKey.valueOf("PROTOCOL-" + keyId.getAndIncrement()); + try { + PROTOCOL_KEY = AttributeKey.valueOf("PROTOCOL-" + keyId.getAndIncrement()); + } catch (Exception ex) { + throw new RuntimeException("Encountered an error caused by a reload! Please properly restart your server!", ex); + } } // Saved accessors diff --git a/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java b/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java index fdb86b2a..91c67e35 100644 --- a/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java +++ b/src/main/java/com/comphenix/protocol/injector/netty/PipelineProxy.java @@ -22,12 +22,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.ChannelPromise; +import io.netty.channel.*; import io.netty.util.concurrent.EventExecutorGroup; /**