package com.dairymoose.modernlife.core;

import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.crafting.conditions.IConditionSerializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/* loaded from: outputsrg.jar:com/dairymoose/modernlife/core/CraftingFlagConditionSerializer.class */
public class CraftingFlagConditionSerializer implements IConditionSerializer<CraftingFlagCondition> {
    private static final Logger LOGGER = LogManager.getLogger();

    public void write(JsonObject json, CraftingFlagCondition condition) {
        json.addProperty("crafting_flag", condition.crafting_flag);
    }

    /* renamed from: read */
    public CraftingFlagCondition m157read(JsonObject json) {
        JsonPrimitive primitive = json.getAsJsonPrimitive("crafting_flag");
        if (primitive == null) {
            return new CraftingFlagCondition("");
        }
        return new CraftingFlagCondition(primitive.getAsString());
    }

    public ResourceLocation getID() {
        return new ResourceLocation("modernlife", "crafting_flag");
    }
}
