This commit is contained in:
Anuken
2021-07-01 10:22:28 -04:00
parent f7e4936445
commit 2ea1671739
3 changed files with 12 additions and 13 deletions

View File

@@ -391,15 +391,7 @@ public class ArcNetProvider implements NetProvider{
//no compression, copy over buffer
if(compression == 0){
buffer.position(0).limit(length);
if(byteBuffer.hasArray()){
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
}else{
byte[] readcopy = new byte[length];
int pos = byteBuffer.position();
byteBuffer.get(readcopy);
byteBuffer.position(pos);
buffer.put(readcopy);
}
buffer.put(byteBuffer.array(), byteBuffer.position(), length);
buffer.position(0);
packet.read(reads.get(), length);
//move read packets forward