9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-25 18:09:20 +00:00
This commit is contained in:
XiaoMoMi
2024-10-11 23:31:02 +08:00
parent 5898d8e3d4
commit 2e03248555
2 changed files with 10 additions and 4 deletions

View File

@@ -141,7 +141,9 @@ public class BukkitNetworkManager implements PacketSender, PipelineInjector {
}
private void uninjectServerChannel(Channel channel) {
channel.pipeline().remove(NAMEPLATES_CONNECTION_HANDLER_NAME);
if (channel.pipeline().get(NAMEPLATES_CONNECTION_HANDLER_NAME) != null) {
channel.pipeline().remove(NAMEPLATES_CONNECTION_HANDLER_NAME);
}
}
@Override
@@ -189,7 +191,9 @@ public class BukkitNetworkManager implements PacketSender, PipelineInjector {
CNPlayer user = removeUser(channel);
if (user == null) return;
channel.eventLoop().submit(() -> {
channel.pipeline().remove(NAMEPLATES_PACKET_HANDLER_NAME);
if (channel.pipeline().get(NAMEPLATES_PACKET_HANDLER_NAME) != null) {
channel.pipeline().remove(NAMEPLATES_PACKET_HANDLER_NAME);
}
return null;
});
}
@@ -206,7 +210,9 @@ public class BukkitNetworkManager implements PacketSender, PipelineInjector {
}
ChannelPipeline pipeline = channel.pipeline();
pipeline.remove(NAMEPLATES_PACKET_HANDLER_NAME);
if (pipeline.get(NAMEPLATES_PACKET_HANDLER_NAME) != null) {
pipeline.remove(NAMEPLATES_PACKET_HANDLER_NAME);
}
for (Map.Entry<String, ChannelHandler> entry : pipeline.toMap().entrySet()) {
if (Reflections.clazz$NetworkManager.isAssignableFrom(entry.getValue().getClass())) {
pipeline.addBefore(entry.getKey(), NAMEPLATES_PACKET_HANDLER_NAME, createHandler(user));

View File

@@ -1,6 +1,6 @@
# Project settings
# Rule: [major update].[feature update].[bug fix]
project_version=3.0.1
project_version=3.0.2
config_version=30
project_group=net.momirealms