writer.beginArray();
for (Map.Entry<UUID, WorkerInfo> i : workerStack.entrySet()) {
adapter.setCurrentUUID(i.getKey());
serializer.toJson(i.getValue(), WorkerInfo.class, writer);
}
writer.endArray();
writer.close();
outputStream.close();
getLogger().log(Level.INFO, "Villagers information serialized.");
} catch (Exception ex) {
getLogger().log(Level.SEVERE, "Can't serialize villagers informations.", ex);