Skip to content

Commit 31ed61f

Browse files
committed
Fix undo bugs
1 parent 757e142 commit 31ed61f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

fNbt/Tags/NbtCompound.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public bool TryGet([NotNull] string tagName, out NbtTag result) {
182182
protected override void DoAddRange([NotNull] IEnumerable<NbtTag> newTags) {
183183
if (newTags == null) throw new ArgumentNullException("newTags");
184184
foreach (NbtTag tag in newTags) {
185-
Add(tag);
185+
DoAdd(tag);
186186
}
187187
}
188188

fNbt/Tags/NbtContainerTag.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ public abstract class NbtContainerTag : NbtTag, IList<NbtTag>
2929

3030
public void Add(NbtTag item)
3131
{
32-
PerformAction(new DescriptionHolder("Add {0} to {1}", this, item),
32+
PerformAction(new DescriptionHolder("Add {0} to {1}", item, this),
3333
() => DoAdd(item),
3434
() => DoRemove(item)
3535
);
3636
}
3737
public void AddRange(IEnumerable<NbtTag> items)
3838
{
3939
var list = items.ToList();
40-
PerformAction(new DescriptionHolder("Add {0} to {1}", this, items),
40+
PerformAction(new DescriptionHolder("Add {0} to {1}", items, this),
4141
() => DoAddRange(items),
4242
() => { foreach (var item in list) { DoRemove(item); } }
4343
);

fNbt/Tags/NbtList.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public override bool CanAdd(NbtTagType type) {
201201
protected override void DoAddRange([NotNull] IEnumerable<NbtTag> newTags) {
202202
if (newTags == null) throw new ArgumentNullException("newTags");
203203
foreach (NbtTag tag in newTags) {
204-
Add(tag);
204+
DoAdd(tag);
205205
}
206206
}
207207

0 commit comments

Comments
 (0)