// priority: 0

ServerEvents.recipes(event => {
    event.remove({ type: 'exnihilosequentia:sifting', input: 'minecraft:oak_leaves'})
    event.remove({ type: 'exnihilosequentia:sifting', input: 'minecraft:dirt'})
    event.remove({ output: 'minecraft:moss_block'})
    event.remove({ output: 'exnihilosequentia:oak_sieve'})
    event.remove({ output: 'minecraft:white_wool'})
    event.remove({ output: 'exnihilosequentia:oak_barrel'})
    event.remove({ type: 'exnihilosequentia:compost', input: '#minecraft:saplings'})
    event.remove({ type: 'exnihilosequentia:compost', input: '#minecraft:leaves'})
    event.remove({ output: '#minecraft:planks'})
    event.remove({ output: 'sawmill:sawmill'})
    event.remove({ id: 'strainers:dirt'})
    event.remove({ output: '#minecraft:beds'})

    event.shaped('kubejs:wispy_leaves', [
        'DL',
        'LD'
    ], {
        L: 'minecraft:oak_leaves',
        D: 'voidblock:dust'
    })

    event.shaped('minecraft:white_wool', [
        'WW',
        'WW'
    ], {
        W: 'kubejs:wispy_leaves'
    })

    event.shaped('minecraft:crafting_table', [
        'LW',
        'SS'
    ], {
        L: 'kubejs:wispy_leaves',
        W: 'minecraft:white_wool',
        S: 'minecraft:stick'
    })

    event.shaped('exnihilosequentia:oak_sieve', [
        'S S',
        'SWS',
        'S S'
    ], {
        S: 'minecraft:stick',
        W: 'minecraft:white_wool'
    })

    event.shaped('minecraft:moss_block', [
        'DLD',
        'LDL',
        'DLD'
    ], {
        D: 'voidblock:dust',
        L: 'minecraft:oak_leaves'
    })

    event.shaped('kubejs:block_of_sticks', [
        'SSS',
        'SSS',
        'SSS'
    ], {
        S: 'minecraft:stick'
    })

    event.shapeless('9x minecraft:stick', [
        'kubejs:block_of_sticks'
    ])

    event.shaped('exnihilosequentia:oak_barrel', [
        'S S',
        'S S',
        'SSS'
    ], {
        S: 'kubejs:block_of_sticks',
    })

    event.shaped('sawmill:sawmill', [
        'SSS',
        'SWS',
        'BBB'
    ], {
        S: 'minecraft:stick',
        W: 'minecraft:white_wool',
        B: 'kubejs:block_of_sticks'
    })

    event.recipes.sawmill.woodcutting('3x minecraft:oak_planks', 'minecraft:oak_log')
    event.recipes.sawmill.woodcutting('3x minecraft:spruce_planks', 'minecraft:spruce_log')
    event.recipes.sawmill.woodcutting('3x minecraft:birch_planks', 'minecraft:birch_log')
    event.recipes.sawmill.woodcutting('3x minecraft:jungle_planks', 'minecraft:jungle_log')
    event.recipes.sawmill.woodcutting('3x minecraft:acacia_planks', 'minecraft:acacia_log')
    event.recipes.sawmill.woodcutting('3x minecraft:dark_oak_planks', 'minecraft:dark_oak_log')
    event.recipes.sawmill.woodcutting('3x minecraft:crimson_planks', 'minecraft:crimson_stem')
    event.recipes.sawmill.woodcutting('3x minecraft:warped_planks', 'minecraft:warped_stem')
    event.recipes.sawmill.woodcutting('3x minecraft:cherry_planks', 'minecraft:cherry_log')
    event.recipes.sawmill.woodcutting('3x minecraft:mangrove_planks', 'minecraft:mangrove_log')

    event.recipes.sawmill.woodcutting('3x minecraft:oak_planks', 'minecraft:stripped_oak_log')
    event.recipes.sawmill.woodcutting('3x minecraft:spruce_planks', 'minecraft:stripped_spruce_log')
    event.recipes.sawmill.woodcutting('3x minecraft:birch_planks', 'minecraft:stripped_birch_log')
    event.recipes.sawmill.woodcutting('3x minecraft:jungle_planks', 'minecraft:stripped_jungle_log')
    event.recipes.sawmill.woodcutting('3x minecraft:acacia_planks', 'minecraft:stripped_acacia_log')
    event.recipes.sawmill.woodcutting('3x minecraft:dark_oak_planks', 'minecraft:stripped_dark_oak_log')
    event.recipes.sawmill.woodcutting('3x minecraft:crimson_planks', 'minecraft:stripped_crimson_stem')
    event.recipes.sawmill.woodcutting('3x minecraft:warped_planks', 'minecraft:stripped_warped_stem')
    event.recipes.sawmill.woodcutting('3x minecraft:cherry_planks', 'minecraft:stripped_cherry_log')
    event.recipes.sawmill.woodcutting('3x minecraft:mangrove_planks', 'minecraft:stripped_mangrove_log')

    event.recipes.exnihilosequentia.compost('minecraft:moss_block', 1000)

    event.recipes.exnihilosequentia.sifting('minecraft:oak_leaves', 'minecraft:oak_sapling', [
        {
            chance: 0.2,
            mesh: "none"
        }],
        false
    )

    event.recipes.exnihilosequentia.sifting('minecraft:oak_leaves', 'minecraft:stick', [
        {
            chance: 0.4,
            mesh: "none"
        }],
        false
    )

    event.recipes.exnihilosequentia.sifting('minecraft:oak_leaves', 'minecraft:apple', [
        {
            chance: 0.2,
            mesh: "none"
        }],
        false
    )
})

LootJS.modifiers((event) => {
    event
    .addBlockLootModifier("minecraft:oak_leaves")
    .removeLoot("minecraft:oak_sapling")
    .removeLoot("minecraft:apple")
    .removeLoot("minecraft:stick")
    .removeLoot("exnihilosequentia:silkworm")
    .randomChance(0.75)
    .addLoot("minecraft:stick")

    event
    .addBlockLootModifier("minecraft:white_wool")
    .removeLoot("minecraft:white_wool")
    .addLoot("3x minecraft:string")
})

