public class Protocol1_9To1_8 extends Protocol<ClientboundPackets1_8,ClientboundPackets1_9,ServerboundPackets1_8,ServerboundPackets1_9>
Protocol.Packet, Protocol.ProtocolPacket
Modifier and Type | Field and Description |
---|---|
static ValueTransformer<String,com.google.gson.JsonElement> |
FIX_JSON |
newClientboundPacketEnum, newServerboundPacketEnum, oldClientboundPacketEnum, oldServerboundPacketEnum
Constructor and Description |
---|
Protocol1_9To1_8() |
Modifier and Type | Method and Description |
---|---|
protected void |
filterPacket(UserConnection info,
Object packet,
List output)
Filter a packet into the output
|
static com.google.gson.JsonElement |
fixJson(String line) |
static Item |
getHandItem(UserConnection info) |
void |
init(UserConnection userConnection)
Initialise a user for this protocol setting up objects.
|
boolean |
isFiltered(Class packetClass)
Should this protocol filter an object packet from this class.
|
static boolean |
isSword(int id) |
protected void |
register(ViaProviders providers)
Handle protocol registration phase, use this to register providers / tasks.
|
protected void |
registerPackets()
Register the packets for this protocol.
|
cancelIncoming, cancelIncoming, cancelIncoming, cancelOutgoing, cancelOutgoing, cancelOutgoing, get, getMappingData, hasMappingDataToLoad, hasRegisteredIncoming, hasRegisteredOutgoing, loadMappingData, onMappingDataLoaded, put, registerIncoming, registerIncoming, registerIncoming, registerIncoming, registerIncoming, registerIncomingChannelIdChanges, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoing, registerOutgoingChannelIdChanges, toString, transform
public static final ValueTransformer<String,com.google.gson.JsonElement> FIX_JSON
public static com.google.gson.JsonElement fixJson(String line)
public static Item getHandItem(UserConnection info)
public static boolean isSword(int id)
protected void registerPackets()
Protocol
protected void register(ViaProviders providers)
Protocol
To be overridden if needed.
register
in class Protocol<ClientboundPackets1_8,ClientboundPackets1_9,ServerboundPackets1_8,ServerboundPackets1_9>
providers
- The current providerspublic boolean isFiltered(Class packetClass)
Protocol
isFiltered
in class Protocol<ClientboundPackets1_8,ClientboundPackets1_9,ServerboundPackets1_8,ServerboundPackets1_9>
packetClass
- The class of the current inputprotected void filterPacket(UserConnection info, Object packet, List output) throws Exception
Protocol
filterPacket
in class Protocol<ClientboundPackets1_8,ClientboundPackets1_9,ServerboundPackets1_8,ServerboundPackets1_9>
info
- The current user connectionpacket
- The input packet as an object (NMS)output
- The list to put the object into.Exception
- Throws exception if cancelled / error.public void init(UserConnection userConnection)
Protocol
UserConnection
To be overridden if needed.
init
in class Protocol<ClientboundPackets1_8,ClientboundPackets1_9,ServerboundPackets1_8,ServerboundPackets1_9>
userConnection
- The user to initialiseCopyright © 2016–2021. All rights reserved.