public static CompoundTag toTag(boolean isClientSync) {
CompoundTag mainTag = new CompoundTag();
for (Identifier registryId : Registry.REGISTRIES.keys()) {
if (REGISTRY_BLACKLIST.contains(registryId)) {
continue;
} else if (isClientSync && REGISTRY_BLACKLIST_NETWORK.contains(registryId)) {
continue;
}
ModifiableRegistry registry = Registry.REGISTRIES.get(registryId);
if (registry instanceof IdRegistry && registry instanceof RemappableRegistry) {
CompoundTag registryTag = new CompoundTag();
for (Identifier identifier : (Set<Identifier>) registry.keys()) {
registryTag.putInt(identifier.toString(), registry.getRawId(registry.get(identifier)));
}
mainTag.put(registryId.toString(), registryTag);
}
}
CompoundTag tag = new CompoundTag();
tag.putInt("version", 1);
tag.put("registries", mainTag);
return tag;
}