Fixed reconstructor commanding in multiplayer

This commit is contained in:
Anuken
2023-06-17 17:54:29 -04:00
parent 6ed336ad95
commit 70516752fc
4 changed files with 14 additions and 3 deletions

View File

@@ -128,6 +128,9 @@ public class TypeIO{
for(Object obj : objs){
writeObject(write, obj);
}
}else if(object instanceof UnitCommand command){
write.b(23);
write.s(command.id);
}else{
throw new IllegalArgumentException("Unknown object type: " + object.getClass());
}
@@ -200,6 +203,7 @@ public class TypeIO{
for(int i = 0; i < objlen; i++) objs[i] = readObjectBoxed(read, box);
yield objs;
}
case 23 -> UnitCommand.all.get(read.us());
default -> throw new IllegalArgumentException("Unknown object type: " + type);
};
}