package net.minecraft.client.resources.metadata.animation;

import net.minecraft.util.GsonHelper;
import com.google.gson.JsonObject;
import net.minecraft.server.packs.metadata.MetadataSectionSerializer;

public class VillagerMetadataSectionSerializer implements MetadataSectionSerializer<VillagerMetaDataSection> {
    @Override
    public VillagerMetaDataSection fromJson(final JsonObject jsonObject) {
        return new VillagerMetaDataSection(VillagerMetaDataSection.Hat.getByName(GsonHelper.getAsString(jsonObject, "hat", "none")));
    }
    
    @Override
    public String getMetadataSectionName() {
        return "villager";
    }
}
