Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Do not use classes from io.netty.util.internal
In this case, we don't even need a concurrency-friendly MPSC queue, since this code only ever gets run in the event loop associated to the channel, so a simple `ArrayDeque` is enough for our needs.
Dieser Commit ist enthalten in:
Ursprung
d5e7fa5b84
Commit
ebc418f6cc
@ -24,7 +24,7 @@ import com.velocitypowered.proxy.protocol.StateRegistry;
|
||||
import io.netty.channel.ChannelDuplexHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -42,7 +42,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class PlayPacketQueueInboundHandler extends ChannelDuplexHandler {
|
||||
|
||||
private final StateRegistry.PacketRegistry.ProtocolRegistry registry;
|
||||
private final Queue<Object> queue = PlatformDependent.newMpscQueue();
|
||||
private final Queue<Object> queue = new ArrayDeque<>();
|
||||
|
||||
/**
|
||||
* Provides registries for client & server bound packets.
|
||||
|
@ -25,7 +25,7 @@ import io.netty.channel.ChannelDuplexHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Queue;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -43,7 +43,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class PlayPacketQueueOutboundHandler extends ChannelDuplexHandler {
|
||||
|
||||
private final StateRegistry.PacketRegistry.ProtocolRegistry registry;
|
||||
private final Queue<MinecraftPacket> queue = PlatformDependent.newMpscQueue();
|
||||
private final Queue<MinecraftPacket> queue = new ArrayDeque<>();
|
||||
|
||||
/**
|
||||
* Provides registries for client & server bound packets.
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren