// priority: 0

StartupEvents.registry("item", (event) => {
    event.create('stoneopolis:void_apple').displayName('Void Apple')
    event.create('stoneopolis:void_chunk').displayName('Void Chunk').burnTime(200)
    event.create('stoneopolis:void_string').displayName('Void String')

    event.create('stoneopolis:void_nugget').displayName('Void Nugget').texture("minecraft:item/iron_nugget").color(0, 0x000000)
    event.create('stoneopolis:void_ingot').displayName('Void Ingot').texture("minecraft:item/iron_ingot").color(0, 0x000000)
  //  event.create('stoneopolis:void_gem').displayName('Void Gem').texture("minecraft:item/diamond").color(0, 0x000000)
    
    event.create('stoneopolis:concrete_dust').displayName('Concrete Dust')
    event.create('stoneopolis:bottled_void').displayName('Bottled Void')

    event.create('stoneopolis:geode_fragment').displayName('Geode Fragment').texture("opolisutilities:item/ender_pearl_fragment").color(0, 0x000000)
    event.create('stoneopolis:lava_fragment').displayName('Lava Fragment').texture("opolisutilities:item/ender_pearl_fragment").color(0, 0xFF4E44)
    event.create('stoneopolis:cluster_template').displayName('Cluster Template')

    event.create('stoneopolis:lapistone_alloy').displayName('Lapi-Stone Alloy')
    event.create('stoneopolis:lapistone_nugget').displayName('Lapi-Stone Nugget')

    event.create('stoneopolis:fire_stick').displayName('Fire Stick')
    event.create('stoneopolis:routing_stick').displayName('Routing Stick').texture("caveopolis:item/stone_stick").glow(true)

    event.create('stoneopolis:raw_diamond').displayName('Raw Diamond').tag("forge:raw_materials/diamond").tag("forge:raw_materials")

    event.create('stoneopolis:netherite_bone').displayName('Netherite Bone')
    event.create('stoneopolis:netherite_nugget').displayName('Netherite Nugget').tag("forge:nuggets").tag("forge:nuggets/netherite")
    event.create('stoneopolis:nether_skull_fragment').displayName('Nether Skull Fragment')
    event.create('stoneopolis:nether_star_fragment').displayName('Nether Star Fragment').glow(true)

    event.create('stoneopolis:bright_color_core').displayName('Bright Color Core').glow(true)
    event.create('stoneopolis:dark_color_core').displayName('Dark Color Core').glow(true)
    event.create('stoneopolis:blank_color_core').displayName('Blank Color Core')
    event.create('stoneopolis:rainbow_color_core').displayName('Rainbow Color Core').tag("stoneopolis:rainbow_color_core").glow(true)
    event.create('stoneopolis:rainbow_dye').displayName('Rainbow Dye').glow(true)
    event.create('stoneopolis:rainbow_lens').displayName('Rainbow Lens')

    event.create('stoneopolis:black_iron_dust').displayName('Black Iron Dust').tag("forge:dusts").tag("forge:dusts/black_iron")

    event.create('stoneopolis:emerald_ingot').displayName('Emerald Ingot').tag("forge:ingots").tag("forge:ingots/emerald")
    event.create('stoneopolis:stone_ingot').displayName('Stone Ingot').tag("forge:ingots")

    event.create('stoneopolis:pig_iron').displayName('Pig Iron').tag("forge:ingots")

    event.create('stoneopolis:cluster_grower').displayName('Cluster Grower').texture("opolisutilities:item/sapling_grower").glow(true)
    
    event.create('stoneopolis:stone_charm').displayName('Stone Charm').tag('curios:charm')
    event.create('stoneopolis:budding_charm').displayName('Budding Charm').tag('curios:charm')

    event.create('stoneopolis:grass_seed').displayName('Grass Seed').texture("minecraft:item/wheat_seeds").color(0, 0xCCFFAF)
    
    event.create('stoneopolis:canvas_of_nothing').displayName('Canvas Of Nothing').texture("minecraft:item/painting").color(0, 0x000000)
    event.create('stoneopolis:dragon_egg_collector').displayName('Dragon Egg Collector').glow(true).texture("opolisutilities:item/opolis_wrench")
    event.create('stoneopolis:ingot_of_duplication').displayName('Ingot Of Duplication').glow(true).texture("minecraft:item/iron_ingot")

  //  event.create('stoneopolis:void_bucks').displayName('Void Bucks').texture("opolisutilities:item/b_bucks").color(0, 0x000000).tag('opolisutilities:wallet_item')

    function pureCore(color, colorCaps) {
      event.create(`stoneopolis:pure_${color}_color_core`).displayName(`Pure ${colorCaps} Color Core`).glow(true)
    }

    pureCore("black", "Black")
    pureCore("white", "White")
    pureCore("blue", "Blue")
    pureCore("light_blue", "Light Blue")
    pureCore("light_gray", "Light Gray")
    pureCore("gray", "Gray")
    pureCore("yellow", "Yellow")
    pureCore("orange", "Orange")
    pureCore("brown", "Brown")
    pureCore("magenta", "Magenta")
    pureCore("pink", "Pink")
    pureCore("purple", "Purple")
    pureCore("lime", "Lime")
    pureCore("green", "Green")
    pureCore("cyan", "Cyan")
    pureCore("red", "Red")
    pureCore("rainbow", "Rainbow")


    //Void Resource (Ingots, Nuggets)

    function voidOres(name, stringName, textureNugget, textureIngot) {
      event.create(`stoneopolis:void_${name}_nugget`).tag('forge:nuggets').texture(textureNugget).color(0, 0xA2A5A2).displayName(`Void ${stringName} Nugget`)
      event.create(`stoneopolis:void_${name}_ingot`).tag('forge:ingots').texture(textureIngot).color(0, 0xA2A5A2).displayName(`Void ${stringName} Ingot`)
    }

    voidOres('iron', 'Iron', "minecraft:item/iron_nugget", "minecraft:item/iron_ingot")
    voidOres('gold', 'Gold', "minecraft:item/gold_nugget", "minecraft:item/gold_ingot")
    voidOres('copper', 'Copper', "opolisutilities:item/copper_nugget", "minecraft:item/copper_ingot")
    voidOres('lead', 'Lead', "alltheores:item/lead_nugget", "alltheores:item/lead_ingot")
    voidOres('tin', 'Tin', "alltheores:item/tin_nugget", "alltheores:item/tin_ingot")

})

ItemEvents.modification(event => {

    event.modify("stoneopolis:void_apple", (item) => {
      item.setFoodProperties((food) => {
        food.saturation(0.87);
        food.hunger(4);
      })
    })


    function moreBucketsFix (bucket) {

      event.modify(bucket, (item) => {
        item.maxStackSize = 1
      })
    }

    moreBucketsFix(['morebuckets:tin_bucket', 'morebuckets:aluminum_bucket', 'morebuckets:diamond_bucket', 'morebuckets:emerald_bucket', 'morebuckets:golden_bucket', 'morebuckets:bronze_bucket', 'morebuckets:rubber_bucket', 'morebuckets:silver_bucket', 'morebuckets:steel_bucket', 'morebuckets:obsidian_bucket', 'morebuckets:quartz_bucket', 'morebuckets:copper_bucket'])

})

  