Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticdrew committed Jun 13, 2024
1 parent cdf6589 commit 17576fc
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface PacketRegistrar
Side getSide();

/**
* Packet Registration
* Packet Registration - Defaults to running on the main thread
*
* @param packetIdentifier - The unique {@link ResourceLocation} packet id.
* @param messageType - The class of the packet.
Expand All @@ -28,4 +28,18 @@ public interface PacketRegistrar
* @return The registrar for chaining registrations.
*/
<T> PacketRegistrar registerPacket(ResourceLocation packetIdentifier, Class<T> messageType, BiConsumer<T, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, T> decoder, Consumer<PacketContext<T>> handler);

/**
* Packet Registration
*
* @param packetIdentifier - The unique {@link ResourceLocation} packet id.
* @param messageType - The class of the packet.
* @param encoder - The encoder method.
* @param decoder - The decoder method.
* @param handler - The handler method.
* @param handleOnNetworkThread - To handle on the network thread
* @param <T> - The class type
* @return The registrar for chaining registrations.
*/
<T> PacketRegistrar registerPacket(ResourceLocation packetIdentifier, Class<T> messageType, BiConsumer<T, FriendlyByteBuf> encoder, Function<FriendlyByteBuf, T> decoder, Consumer<PacketContext<T>> handler, boolean handleOnNetworkThread);
}

0 comments on commit 17576fc

Please sign in to comment.