public class BaseProtocol extends SimpleProtocol
SimpleProtocol.DummyPacketTypesProtocol.Packet, Protocol.ProtocolPacketnewClientboundPacketEnum, newServerboundPacketEnum, oldClientboundPacketEnum, oldServerboundPacketEnum| Constructor and Description |
|---|
BaseProtocol() |
| Modifier and Type | Method and Description |
|---|---|
void |
init(UserConnection userConnection)
Initialise a user for this protocol setting up objects.
|
protected void |
register(ViaProviders providers)
Handle protocol registration phase, use this to register providers / tasks.
|
protected void |
registerPackets()
Register the packets for this protocol.
|
void |
transform(Direction direction,
State state,
PacketWrapper packetWrapper)
Transform a packet using this protocol
|
cancelIncoming, cancelIncoming, cancelIncoming, cancelOutgoing, cancelOutgoing, cancelOutgoing, filterPacket, get, getMappingData, hasMappingDataToLoad, hasRegisteredIncoming, hasRegisteredOutgoing, isFiltered, loadMappingData, onMappingDataLoaded, put, registerIncoming, registerIncoming, registerIncoming, registerIncoming, registerIncoming, registerIncomingChannelIdChanges, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoingChannelIdChanges, toStringprotected void registerPackets()
Protocolpublic void init(UserConnection userConnection)
ProtocolUserConnection
To be overridden if needed.
init in class Protocol<SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes>userConnection - The user to initialiseprotected void register(ViaProviders providers)
ProtocolTo be overridden if needed.
register in class Protocol<SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes>providers - The current providerspublic void transform(Direction direction, State state, PacketWrapper packetWrapper) throws Exception
Protocoltransform in class Protocol<SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes,SimpleProtocol.DummyPacketTypes>direction - The direction the packet is going instate - The current protocol statepacketWrapper - The packet wrapper to transformException - Throws exception if it fails to transformCopyright © 2016–2021. All rights reserved.