Skip to content
This repository was archived by the owner on Nov 27, 2017. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/main/java/com/evilco/mc/nbt/tag/TagCompound.java
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,10 @@ public void setTag (@Nonnull ITag tag) {
// check arguments
Preconditions.checkNotNull (tag, "tag");

// delete previous
if (this.tags.containsKey (tag)) this.tags.get (tag.getName ()).setParent (null);

// store tag
this.tags.put (tag.getName (), tag);
ITag previous = this.tags.put (tag.getName (), tag);
// delete previous
previous.setParent(null);

// update parent
tag.setParent (this);
Expand Down Expand Up @@ -350,4 +349,4 @@ public void write (NbtOutputStream outputStream, boolean anonymous) throws IOExc
// write end tag
outputStream.writeByte (TagType.END.typeID);
}
}
}