mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-26 06:22:17 -08:00
log revision changes
This commit is contained in:
parent
f685c30178
commit
7a6f69fc88
1 changed files with 3 additions and 0 deletions
|
|
@ -61,11 +61,14 @@ public class EntityIO{
|
|||
//keep track of fields present in the entity
|
||||
presentFields.addAll(fields.map(f -> f.name));
|
||||
|
||||
Revision previous = revisions.isEmpty() ? null : revisions.peek();
|
||||
|
||||
//add new revision if it doesn't match or there are no revisions
|
||||
if(revisions.isEmpty() || !revisions.peek().equal(fields)){
|
||||
revisions.add(new Revision(nextRevision,
|
||||
fields.map(f -> new RevisionField(f.name, f.type.toString(),
|
||||
f.type.isPrimitive() ? BaseProcessor.typeSize(f.type.toString()) : -1))));
|
||||
Log.warn("Adding new revision @ for @.\nPrevious = @\nNew = @\n", nextRevision, name, previous == null ? null : previous.fields.toString(", ", f -> f.name), fields.toString(", ", f -> f.name));
|
||||
//write revision
|
||||
directory.child(nextRevision + ".json").writeString(json.toJson(revisions.peek()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue