Cave pumpkin

This commit is contained in:
paulevsGitch 2021-03-20 06:13:11 +03:00
parent 72113034ea
commit 3dcafa522c
40 changed files with 474 additions and 49 deletions

View file

@ -30,6 +30,22 @@ public class WorldDataUtil {
return root;
}
public static CompoundTag getCompoundTag(String path) {
String[] parts = path.split("\\.");
CompoundTag tag = root;
for (String part: parts) {
if (tag.contains(part)) {
tag = tag.getCompound(part);
}
else {
CompoundTag t = new CompoundTag();
tag.put(part, t);
tag = t;
}
}
return tag;
}
public static void saveFile() {
try {
NbtIo.write(root, saveFile);