public class BaseProtocol extends SimpleProtocol
SimpleProtocol.DummyPacketTypes
Protocol.Packet, Protocol.ProtocolPacket
newClientboundPacketEnum, 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, toString
protected void registerPackets()
Protocol
public void init(UserConnection userConnection)
Protocol
UserConnection
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)
Protocol
To 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
Protocol
transform
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.