mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-26 06:53:05 +00:00
Stamp transformed data with the current versions before it replaces the original
This commit is contained in:
2 files changed
+39
-3
No files matched your search
@@ -24,8 +24,8 @@ public final class VersionedPass {
|
||||
}
|
||||
|
||||
/// Runs `step` for every transformer whose stamp on `root` differs from its current version. The steps work on a
|
||||
/// copy of `root`, which replaces the contents of `root` once every step has succeeded. A failing step throws the
|
||||
/// [#failure] for `subjectName` and `subject`, and leaves `root` as read.
|
||||
/// copy of `root`, which is stamped with the current versions and replaces the contents of `root` once every step
|
||||
/// has succeeded. A failing step throws the [#failure] for `subjectName` and `subject`, and leaves `root` as read.
|
||||
///
|
||||
/// @return a copy of the stamps `root` was read with, or null if unstamped
|
||||
public static NBTTagCompound runAtomically(NBTTagCompound root, Iterable<IVersionedTransformer> transformers,
|
||||
@@ -47,7 +47,10 @@ public final class VersionedPass {
|
||||
throw failure(t, transformer, stored, current, subjectName, subject);
|
||||
}
|
||||
}
|
||||
if (working != null) replaceContents(root, working);
|
||||
if (working != null) {
|
||||
VersionStamps.write(working, carried, transformers);
|
||||
replaceContents(root, working);
|
||||
}
|
||||
return carried;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user