fix: wrap immutable map in MinecraftStructure writer

- fixes #2781
Dieser Commit ist enthalten in:
dordsor21 2024-06-14 19:18:35 +01:00
Ursprung 031fdf2efd
Commit 4a5ff8e306
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B

Datei anzeigen

@ -236,11 +236,11 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
BaseEntity state = entity.getState();
if (state != null) {
CompoundTag nbt = state.getNbtData();
Map<String, Tag> nbtMap = nbt.getValue();
Map<String, Tag> nbtMap = new HashMap<>(nbt.getValue());
// Replace rotation data
nbtMap.put("Rotation", writeRotation(entity.getLocation()));
nbtMap.put("id", new StringTag(state.getType().id()));
Map<String, Object> entityMap = FaweCache.INSTANCE.asMap("pos", pos, "blockPos", blockPos, "nbt", nbt);
Map<String, Object> entityMap = FaweCache.INSTANCE.asMap("pos", pos, "blockPos", blockPos, "nbt", new CompoundTag(nbtMap));
entities.add(entityMap);
}
}