From 801121220a5da503cf40eea2a65ed473a198e593 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 2 Oct 2019 14:27:44 -0300 Subject: [PATCH] experiments with nbt --- src/main/java/carpet/script/value/NBTSerializableValue.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/carpet/script/value/NBTSerializableValue.java b/src/main/java/carpet/script/value/NBTSerializableValue.java index 65eddd74..bfa83caf 100644 --- a/src/main/java/carpet/script/value/NBTSerializableValue.java +++ b/src/main/java/carpet/script/value/NBTSerializableValue.java @@ -218,14 +218,15 @@ public class NBTSerializableValue extends Value implements ContainerValueInterfa Tag tagToInsert = value instanceof NBTSerializableValue ? ((NBTSerializableValue) value).getTag() : new NBTSerializableValue(value.getString()).getTag(); - CarpetSettings.LOG.error("Inserting tag of class: "+tagToInsert.getClass().getSimpleName()); + CarpetSettings.LOG.error("Inserting tag "+tagToInsert.asString()+" of class: "+tagToInsert.getClass().getSimpleName()); Tag tag = getTag().copy(); try { - Collection collection_1 = path.get(tag); //, CompoundTag::new); + Collection collection_1 = path.putIfAbsent(tag, CompoundTag::new); for(Tag t: collection_1) { + CarpetSettings.LOG.error("Found target: "+t.asString()); ((CompoundTag)t).copyFrom((CompoundTag) tagToInsert); } if (collection_1.size() > 0)