Skip to content

Commit

Permalink
Fix incorrect internal method names in ServerNetworkingImpl (#3349)
Browse files Browse the repository at this point in the history
No functional change.
  • Loading branch information
modmuss50 authored Oct 1, 2023
1 parent d9a2869 commit b18afef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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);
}
}

0 comments on commit b18afef

Please sign in to comment.