mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-01-04 23:07:42 +01:00
Implement passthroughAll to make it easier for adding things to the end of a packet.
This commit is contained in:
parent
fb4bc397c6
commit
172f89940a
@ -163,6 +163,21 @@ public class PacketWrapper {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Take all the inputs and write them to the output.
|
||||||
|
*
|
||||||
|
* @throws Exception If it failed to read or write
|
||||||
|
*/
|
||||||
|
public void passthroughAll() throws Exception {
|
||||||
|
// Copy previous objects
|
||||||
|
packetValues.addAll(readableObjects);
|
||||||
|
readableObjects.clear();
|
||||||
|
// If the buffer has readable bytes, copy them.
|
||||||
|
if(inputBuffer.readableBytes() > 0){
|
||||||
|
read(Type.REMAINING_BYTES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the current output to a buffer.
|
* Write the current output to a buffer.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user