diff --git a/src/main/java/ca/spottedleaf/dataconverter/types/nbt/NBTMapType.java b/src/main/java/ca/spottedleaf/dataconverter/types/nbt/NBTMapType.java index 70e9708..ceb6b9b 100644 --- a/src/main/java/ca/spottedleaf/dataconverter/types/nbt/NBTMapType.java +++ b/src/main/java/ca/spottedleaf/dataconverter/types/nbt/NBTMapType.java @@ -419,8 +419,11 @@ public ListType getListUnchecked(final String key, final ListType dfl) { final Object tag = this.map.get(key); if (tag instanceof NBTListType l) return l; - if (tag instanceof ListBinaryTag) - return new NBTListType((ListBinaryTag) tag); + if (tag instanceof ListBinaryTag) { + var map = new NBTListType((ListBinaryTag) tag); + this.map.put(key, map); + return map; + } return dfl; } @@ -439,8 +442,11 @@ public MapType getMap(final String key, final MapType dfl) { final Object tag = this.map.get(key); if (tag instanceof NBTMapType m) return m; - if (tag instanceof CompoundBinaryTag) - return new NBTMapType((CompoundBinaryTag) tag); + if (tag instanceof CompoundBinaryTag) { + var map = new NBTMapType((CompoundBinaryTag) tag); + this.map.put(key, map); + return map; + } return dfl; }