Merge branch 'reflectionless' of https://github.com/Anuken/Mindustry

This commit is contained in:
Anuken
2018-08-31 16:15:43 -04:00
3 changed files with 26 additions and 18 deletions

View File

@@ -35,9 +35,8 @@ public class ByteSerializer implements Serialization {
if(id == -2){
return FrameworkSerializer.read(byteBuffer);
}else{
Class<?> type = Registrator.getByID(id);
synchronized (packetPoolLock) {
Packet packet = (Packet) Pooling.obtain(type);
Packet packet = (Packet) Pooling.obtain(Registrator.getByID(id).type);
packet.read(byteBuffer);
return packet;
}