public abstract class ValueTransformer<T1,T2> extends Object implements ValueWriter<T1>
| Constructor and Description |
|---|
ValueTransformer(@Nullable Type<T1> inputType,
Type<T2> outputType) |
ValueTransformer(Type<T2> outputType) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable Type<T1> |
getInputType() |
Type<T2> |
getOutputType() |
abstract T2 |
transform(PacketWrapper wrapper,
T1 inputValue)
Transform a value from one type to another
|
void |
write(PacketWrapper writer,
T1 inputValue)
Write a value to a packet
|
public ValueTransformer(@Nullable
@Nullable Type<T1> inputType,
Type<T2> outputType)
public abstract T2 transform(PacketWrapper wrapper, T1 inputValue) throws Exception
wrapper - The current packetinputValue - The input valueException - Throws exception if it fails to transform a valuepublic void write(PacketWrapper writer, T1 inputValue) throws Exception
ValueWriterwrite in interface ValueWriter<T1>writer - The packet wrapper to write toinputValue - The value to writeException - Throws exception if it fails to writeCopyright © 2016–2021. All rights reserved.