package net.minecraft.world.level.levelgen.structure.templatesystem;

import java.util.function.Function;
import net.minecraft.core.Registry;
import com.mojang.serialization.Codec;

public interface StructureProcessorType<P extends StructureProcessor> {
    public static final StructureProcessorType<BlockIgnoreProcessor> BLOCK_IGNORE = StructureProcessorType.<BlockIgnoreProcessor>register("block_ignore", BlockIgnoreProcessor.CODEC);
    public static final StructureProcessorType<BlockRotProcessor> BLOCK_ROT = StructureProcessorType.<BlockRotProcessor>register("block_rot", BlockRotProcessor.CODEC);
    public static final StructureProcessorType<GravityProcessor> GRAVITY = StructureProcessorType.<GravityProcessor>register("gravity", GravityProcessor.CODEC);
    public static final StructureProcessorType<JigsawReplacementProcessor> JIGSAW_REPLACEMENT = StructureProcessorType.<JigsawReplacementProcessor>register("jigsaw_replacement", JigsawReplacementProcessor.CODEC);
    public static final StructureProcessorType<RuleProcessor> RULE = StructureProcessorType.<RuleProcessor>register("rule", RuleProcessor.CODEC);
    public static final StructureProcessorType<NopProcessor> NOP = StructureProcessorType.<NopProcessor>register("nop", NopProcessor.CODEC);
    public static final StructureProcessorType<BlockAgeProcessor> BLOCK_AGE = StructureProcessorType.<BlockAgeProcessor>register("block_age", BlockAgeProcessor.CODEC);
    public static final StructureProcessorType<BlackstoneReplaceProcessor> BLACKSTONE_REPLACE = StructureProcessorType.<BlackstoneReplaceProcessor>register("blackstone_replace", BlackstoneReplaceProcessor.CODEC);
    public static final StructureProcessorType<LavaSubmergedBlockProcessor> LAVA_SUBMERGED_BLOCK = StructureProcessorType.<LavaSubmergedBlockProcessor>register("lava_submerged_block", LavaSubmergedBlockProcessor.CODEC);
    public static final Codec<StructureProcessor> CODEC = Registry.STRUCTURE_PROCESSOR.dispatch("processor_type", (Function)StructureProcessor::getType, (Function)StructureProcessorType::codec);
    
    Codec<P> codec();
    
    default <P extends StructureProcessor> StructureProcessorType<P> register(final String string, final Codec<P> codec) {
        return Registry.<StructureProcessorType<P>>register(Registry.STRUCTURE_PROCESSOR, string, () -> codec);
    }
}
