Skip to content

Commit de5cb1b

Browse files
committed
Fix sorted recursive compounds not signaling changes
1 parent f0b62cb commit de5cb1b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fNbt/Tags/NbtCompound.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,11 @@ private void DoUnsortRoot(List<NbtTag> order)
257257
private void DoSort(IComparer<NbtTag> sorter, bool recursive)
258258
{
259259
var tags = Tags.OrderBy(x => x, sorter).ToList();
260-
foreach (var tag in tags)
260+
if (recursive)
261261
{
262-
if (recursive)
262+
foreach (var tag in tags)
263263
{
264+
tag.RaiseChangedLoop();
264265
if (tag is NbtCompound sub)
265266
sub.DoSort(sorter, true);
266267
else if (tag is NbtList list)

fNbt/Tags/NbtTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected void PerformAction(DescriptionHolder description, Action action, Actio
4949
RaiseActionPerformed(undoable);
5050
}
5151

52-
private void RaiseChangedLoop()
52+
internal void RaiseChangedLoop()
5353
{
5454
var tag = this;
5555
while (tag != null)

0 commit comments

Comments
 (0)