public abstract class ValueTransformer<T1,T2> extends java.lang.Object implements ValueWriter<T1>
Modifier | Constructor and Description |
---|---|
protected |
ValueTransformer(@Nullable Type<T1> inputType,
Type<T2> outputType) |
protected |
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 abstract T2 transform(PacketWrapper wrapper, T1 inputValue) throws java.lang.Exception
wrapper
- The current packetinputValue
- The input valuejava.lang.Exception
- Throws exception if it fails to transform a valuepublic void write(PacketWrapper writer, T1 inputValue) throws java.lang.Exception
ValueWriter
write
in interface ValueWriter<T1>
writer
- The packet wrapper to write toinputValue
- The value to writejava.lang.Exception
- Throws exception if it fails to write