PaperMC/paper-server/nms-patches/net/minecraft/network/NetworkManager.patch
CraftBukkit/Spigot eed041d629 Update to Minecraft 1.21
By: md_5 <git@md-5.net>
2024-06-14 01:05:00 +10:00

37 lines
1.6 KiB
Diff

--- a/net/minecraft/network/NetworkManager.java
+++ b/net/minecraft/network/NetworkManager.java
@@ -114,6 +114,7 @@
private volatile DisconnectionDetails delayedDisconnect;
@Nullable
BandwidthDebugMonitor bandwidthDebugMonitor;
+ public String hostname = ""; // CraftBukkit - add field
public NetworkManager(EnumProtocolDirection enumprotocoldirection) {
this.receiving = enumprotocoldirection;
@@ -205,7 +206,7 @@
}
private static <T extends PacketListener> void genericsFtw(Packet<T> packet, PacketListener packetlistener) {
- packet.handle(packetlistener);
+ packet.handle((T) packetlistener); // CraftBukkit - decompile error
}
private void validateListener(ProtocolInfo<?> protocolinfo, PacketListener packetlistener) {
@@ -469,7 +470,7 @@
}
if (this.isConnected()) {
- this.channel.close().awaitUninterruptibly();
+ this.channel.close(); // We can't wait as this may be called from an event loop.
this.disconnectionDetails = disconnectiondetails;
}
@@ -537,7 +538,7 @@
}
public void configurePacketHandler(ChannelPipeline channelpipeline) {
- channelpipeline.addLast("hackfix", new ChannelOutboundHandlerAdapter(this) {
+ channelpipeline.addLast("hackfix", new ChannelOutboundHandlerAdapter() { // CraftBukkit - decompile error
public void write(ChannelHandlerContext channelhandlercontext, Object object, ChannelPromise channelpromise) throws Exception {
super.write(channelhandlercontext, object, channelpromise);
}