package net.halbear.aotg.registries;

import net.halbear.aotg.AgeoftheGods;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.BushTwistyBranchingTrunkPlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.ThinTwistyBranchingTrunkPlacer;
import net.halbear.aotg.custom.WorldGen.GenerationFeatures.TwistyBranchingTrunkPlacer;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister;

public class ModTreeGen {
    public static final DeferredRegister<TrunkPlacerType<?>> TRUNK_PLACERS =
        DeferredRegister.create(Registries.TRUNK_PLACER_TYPE, AgeoftheGods.MODID);

    public static final DeferredHolder<TrunkPlacerType<?>, TrunkPlacerType<TwistyBranchingTrunkPlacer>> TWISTY_TRUNK_PLACER =
            TRUNK_PLACERS.register("twisty_trunk_placer", () -> new TrunkPlacerType<>(TwistyBranchingTrunkPlacer.CODEC));

    public static final DeferredHolder<TrunkPlacerType<?>, TrunkPlacerType<ThinTwistyBranchingTrunkPlacer>> TALL_TWISTY_TRUNK_PLACER =
            TRUNK_PLACERS.register("tall_twisty_trunk_placer", () -> new TrunkPlacerType<>(ThinTwistyBranchingTrunkPlacer.CODEC));

    public static final DeferredHolder<TrunkPlacerType<?>, TrunkPlacerType<BushTwistyBranchingTrunkPlacer>> BUSH_TWISTY_TRUNK_PLACER =
            TRUNK_PLACERS.register("bush_twisty_trunk_placer", () -> new TrunkPlacerType<>(BushTwistyBranchingTrunkPlacer.CODEC));

    public static void register(IEventBus eventBus) {
        TRUNK_PLACERS.register(eventBus);
    }
}
