Class PacketHandlers
java.lang.Object
com.viaversion.viaversion.api.protocol.remapper.PacketHandlers
- All Implemented Interfaces:
PacketHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidWrites a value.final voidhandle(PacketWrapper wrapper) Handles a packet.voidhandler(PacketHandler handler) Adds a packet handler.voidhandlerSoftFail(PacketHandler handler) Adds a packet handler which will suppress any exceptions thrown by the handler.int<T> voidmap(ValueReader<T> inputReader, ValueWriter<T> outputWriter) Maps a type using a basic ValueReader to a ValueWriter.<T1,T2> void map(ValueTransformer<T1, T2> transformer) Maps a type from an old type to a transformed new type based on their input type.voidReads the first given type and writes the second given type.<T> voidReads and writes the given type.<T1,T2> void map(Type<T1> oldType, ValueTransformer<T1, T2> transformer) Maps a type from an old type to a transformed new type.<T1,T2> void Maps a type from an old type to a transformed new type.voidReads (and thus removes) the given type.protected abstract voidregister()Registers the handlers for this packet.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.viaversion.viaversion.api.protocol.remapper.PacketHandler
then
-
Constructor Details
-
PacketHandlers
protected PacketHandlers()
-
-
Method Details
-
map
Reads and writes the given type.- Parameters:
type- type to map
-
map
Reads the first given type and writes the second given type.- Parameters:
oldType- old typenewType- new type
-
map
Maps a type from an old type to a transformed new type.- Type Parameters:
T1- old value typeT2- new value type- Parameters:
oldType- old typenewType- new typetransformer- transformer to produce the new type
-
map
Maps a type from an old type to a transformed new type based on their input type.- Type Parameters:
T1- old value typeT2- new value type- Parameters:
transformer- transformer to produce the new type
-
map
Maps a type from an old type to a transformed new type.- Type Parameters:
T1- old value typeT2- new value type- Parameters:
oldType- old typetransformer- transformer to produce the new type
-
map
Maps a type using a basic ValueReader to a ValueWriter.- Type Parameters:
T- read/write type- Parameters:
inputReader- reader to read withoutputWriter- writer to write with
-
handler
Adds a packet handler.- Parameters:
handler- packet handler
-
handlerSoftFail
Adds a packet handler which will suppress any exceptions thrown by the handler.- Parameters:
handler- packet handler
-
create
Writes a value.- Parameters:
type- type to writevalue- value to write
-
read
Reads (and thus removes) the given type.- Parameters:
type- type to read
-
register
protected abstract void register()Registers the handlers for this packet. -
handle
Description copied from interface:PacketHandlerHandles a packet.- Specified by:
handlein interfacePacketHandler- Parameters:
wrapper- packet wrapper- Throws:
InformativeException
-
handlersSize
public int handlersSize()
-