Interface PacketRegistry
- 
- All Known Subinterfaces:
- BasicPacketChannel,- PacketChannel,- TransactionalPacketRegistry
 
 public interface PacketRegistryA registry for packets and their bindings.Used opcodes should always be positive values. 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<PacketBinding<?>>binding(int opcode)Gets thePacketBindingfor the given packet class, if the packet type is registered to this channel.<P extends Packet>
 java.util.Optional<PacketBinding<P>>binding(java.lang.Class<P> packetClass)Gets thePacketBindingfor the given packet class, if the packet type is registered to this channel.java.util.Collection<PacketBinding<?>>bindings()Gets a collection with all thePacketBindings.<P extends Packet>
 HandlerPacketBinding<P>register(java.lang.Class<P> packetClass, int packetOpcode)Register a packet class to this channel without a receiving handler.
 
- 
- 
- 
Method Detail- 
register<P extends Packet> HandlerPacketBinding<P> register(java.lang.Class<P> packetClass, int packetOpcode) Register a packet class to this channel without a receiving handler. This will only allow the packet to be sent, this channel binding will not be able to receive the packet.RequestPackettypes may not be registered using this method, they are only supported byTransactionalPacketRegistry.registerTransactional(java.lang.Class<P>, java.lang.Class<R>, int).- Type Parameters:
- P- The type of the packet
- Parameters:
- packetClass- The class of the packet being registered. Note: the class must have a no-args constructor
- packetOpcode- A unique opcode for this packet
- Returns:
- The created packet binding
 
 - 
binding<P extends Packet> java.util.Optional<PacketBinding<P>> binding(java.lang.Class<P> packetClass) Gets thePacketBindingfor the given packet class, if the packet type is registered to this channel.- Type Parameters:
- P- The type of the packet
- Parameters:
- packetClass- The packet class
- Returns:
- The packet binding, if found
 
 - 
bindingsjava.util.Collection<PacketBinding<?>> bindings() Gets a collection with all thePacketBindings.- Returns:
- The opcode bindings
 
 - 
bindingjava.util.Optional<PacketBinding<?>> binding(int opcode) Gets thePacketBindingfor the given packet class, if the packet type is registered to this channel.- Parameters:
- opcode- The opcode
- Returns:
- The opcode binding, if found
 
 
- 
 
-