Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20.2] Fix incorrect internal method names in ServerNetworkingImpl #3349

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public static Packet<ClientCommonPacketListener> createS2CPacket(Identifier chan
Objects.requireNonNull(channelName, "Channel cannot be null");
Objects.requireNonNull(buf, "Buf cannot be null");

return ServerNetworkingImpl.createC2SPacket(channelName, buf);
return ServerNetworkingImpl.createS2CPacket(channelName, buf);
}

/**
Expand All @@ -314,7 +314,7 @@ public static <T extends FabricPacket> Packet<ClientCommonPacketListener> create
Objects.requireNonNull(packet, "Packet cannot be null");
Objects.requireNonNull(packet.getType(), "Packet#getType cannot return null");

return ServerNetworkingImpl.createC2SPacket(packet);
return ServerNetworkingImpl.createS2CPacket(packet);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public static Packet<ClientCommonPacketListener> createS2CPacket(Identifier chan
Objects.requireNonNull(channelName, "Channel cannot be null");
Objects.requireNonNull(buf, "Buf cannot be null");

return ServerNetworkingImpl.createC2SPacket(channelName, buf);
return ServerNetworkingImpl.createS2CPacket(channelName, buf);
}

/**
Expand All @@ -396,7 +396,7 @@ public static Packet<ClientCommonPacketListener> createS2CPacket(Identifier chan
* @return a new packet
*/
public static <T extends FabricPacket> Packet<ClientCommonPacketListener> createS2CPacket(T packet) {
return ServerNetworkingImpl.createC2SPacket(packet);
return ServerNetworkingImpl.createS2CPacket(packet);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public static ServerConfigurationNetworkAddon getAddon(ServerConfigurationNetwor
return (ServerConfigurationNetworkAddon) ((NetworkHandlerExtensions) handler).getAddon();
}

public static Packet<ClientCommonPacketListener> createC2SPacket(Identifier channel, PacketByteBuf buf) {
public static Packet<ClientCommonPacketListener> createS2CPacket(Identifier channel, PacketByteBuf buf) {
return new CustomPayloadS2CPacket(new PacketByteBufPayload(channel, buf));
}

public static Packet<ClientCommonPacketListener> createC2SPacket(FabricPacket packet) {
public static Packet<ClientCommonPacketListener> createS2CPacket(FabricPacket packet) {
Objects.requireNonNull(packet, "Packet cannot be null");
Objects.requireNonNull(packet.getType(), "Packet#getType cannot return null");

PacketByteBuf buf = PacketByteBufs.create();
packet.write(buf);
return createC2SPacket(packet.getType().getId(), buf);
return createS2CPacket(packet.getType().getId(), buf);
}
}
Loading