Fix incorrect internal method names in ServerNetworkingImpl (#3349)

No functional change.
This commit is contained in:
modmuss 2023-10-01 12:37:30 +01:00 committed by GitHub
parent d9a2869ba3
commit b18afef34a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -301,7 +301,7 @@ public final class ServerConfigurationNetworking {
Objects.requireNonNull(channelName, "Channel cannot be null");
Objects.requireNonNull(buf, "Buf cannot be null");
return ServerNetworkingImpl.createC2SPacket(channelName, buf);
return ServerNetworkingImpl.createS2CPacket(channelName, buf);
}
/**
@ -314,7 +314,7 @@ public final class ServerConfigurationNetworking {
Objects.requireNonNull(packet, "Packet cannot be null");
Objects.requireNonNull(packet.getType(), "Packet#getType cannot return null");
return ServerNetworkingImpl.createC2SPacket(packet);
return ServerNetworkingImpl.createS2CPacket(packet);
}
/**

View file

@ -386,7 +386,7 @@ public final class ServerPlayNetworking {
Objects.requireNonNull(channelName, "Channel cannot be null");
Objects.requireNonNull(buf, "Buf cannot be null");
return ServerNetworkingImpl.createC2SPacket(channelName, buf);
return ServerNetworkingImpl.createS2CPacket(channelName, buf);
}
/**
@ -396,7 +396,7 @@ public final class ServerPlayNetworking {
* @return a new packet
*/
public static <T extends FabricPacket> Packet<ClientCommonPacketListener> createS2CPacket(T packet) {
return ServerNetworkingImpl.createC2SPacket(packet);
return ServerNetworkingImpl.createS2CPacket(packet);
}
/**

View file

@ -54,16 +54,16 @@ public final class ServerNetworkingImpl {
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);
}
}