Package commonnetwork.networking
Class DelayedPacketRegistrationHandler
java.lang.Object
commonnetwork.networking.DelayedPacketRegistrationHandler
- All Implemented Interfaces:
PacketRegistrar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSide()<T> PacketRegistrarregisterConfigurationPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf, T> codec, Consumer<PacketContext<T>> handler) Packet Registration, registers a CONFIGURATION packet<T> PacketRegistrarregisterPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf, T> codec, Consumer<PacketContext<T>> handler) Packet Registration, registers a PLAY packet<T> PacketRegistrarregisterPacket(net.minecraft.resources.ResourceLocation id, Class<T> packetClass, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> encoder, Function<net.minecraft.network.FriendlyByteBuf, T> decoder, Consumer<PacketContext<T>> handler) Packet Registration registers a PLAY packetvoidregisterQueuedPackets(PacketRegistrationHandler packetRegistration)
-
Constructor Details
-
DelayedPacketRegistrationHandler
public DelayedPacketRegistrationHandler()
-
-
Method Details
-
getSide
- Specified by:
getSidein interfacePacketRegistrar- Returns:
- the side
-
registerPacket
public <T> PacketRegistrar registerPacket(net.minecraft.resources.ResourceLocation id, Class<T> packetClass, BiConsumer<T, net.minecraft.network.FriendlyByteBuf> encoder, Function<net.minecraft.network.FriendlyByteBuf, T> decoder, Consumer<PacketContext<T>> handler) Description copied from interface:PacketRegistrarPacket Registration registers a PLAY packet- Specified by:
registerPacketin interfacePacketRegistrar- Type Parameters:
T- - The class type- Parameters:
id- - The uniqueResourceLocationpacket id.packetClass- - The class of the packet.encoder- - The encoder method.decoder- - The decoder method.handler- - The handler method.- Returns:
- The registrar for chaining registrations.
-
registerPacket
public <T> PacketRegistrar registerPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf, T> codec, Consumer<PacketContext<T>> handler) Description copied from interface:PacketRegistrarPacket Registration, registers a PLAY packet- Specified by:
registerPacketin interfacePacketRegistrar- Type Parameters:
T- - The class type- Parameters:
type- - The packet type.packetClass- - The class of the packet.codec- - The StreamCodec.handler- - The handler method.- Returns:
- The registrar for chaining registrations.
-
registerConfigurationPacket
public <T> PacketRegistrar registerConfigurationPacket(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<? extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> type, Class<T> packetClass, net.minecraft.network.codec.StreamCodec<? extends net.minecraft.network.FriendlyByteBuf, T> codec, Consumer<PacketContext<T>> handler) Description copied from interface:PacketRegistrarPacket Registration, registers a CONFIGURATION packet- Specified by:
registerConfigurationPacketin interfacePacketRegistrar- Type Parameters:
T- - The class type- Parameters:
type- - The packet type.packetClass- - The class of the packet.codec- - The StreamCodec.handler- - The handler method.- Returns:
- The registrar for chaining registrations.
-
registerQueuedPackets
-