let addGenericData = (/** @type {Internal.DataPackEventJS} */ event) => {
    let addTFCDrinkables = (id, item, thirst, hunger, saturation) => {
        let json = JsonIO.toObject(
            {
                "ingredient": [
                    item
                ],
                "thirst": thirst,
                "food": {
                    "hunger": hunger,
                    "saturation": saturation
                }
            }
        )

        event.addJson(`tfc:tfc/drinkables/${id}.json`, json)
    }

    addTFCDrinkables('maple_syrup', 'gregitas:maple_syrup', 10, 10, 10)
    const TFCGrainsToAlchohol = [
        {
          id: 'barley',
          color: 0x8B4513,
          name: 'Barley',
          alcohol: 'beer'
        },
        {
          id: 'maize',
          color: 0xFFD700,
          name: 'Maize',
          alcohol: 'corn_whiskey'
        },
        {
          id: 'oat',
          color: 0x8B4513,
          name: 'Oat',
          alcohol: 'yeast_starter'
        },
        {
          id: 'rye',
          color: 0x8B4513,
          name: 'Rye',
          alcohol: 'rye_whiskey'
        },
        {
          id: 'rice',
          color: 0xFFD700,
          name: 'Rice',
          alcohol: 'sake'
        },
        {
          id: 'wheat',
          color: 0xFFD700,
          name: 'Wheat',
          alcohol: 'whiskey'
        }
      ]
    

    let addTFCFoodItems = (id, item, hunger, saturation, water, decay, grain, fruit, veg, protein, dairy) => {
        let json = JsonIO.toObject(
            {
                "ingredient": {
                    "item": item
                },
                "hunger": hunger,
                "saturation": saturation,
                "water": water,
                "decay_modifier": decay,
                "grain": grain,
                "fruit": fruit,
                "vegetables": veg,
                "protein": protein,
                "dairy": dairy
            } 
        )

        event.addJson(`tfc:tfc/food_items/${id}.json`, json)
    }
    TFCGrainsToAlchohol.forEach((grain) => {
        addTFCFoodItems(`${grain.id}_mash`, `gregitas:${grain.id}_mash`, 0, 0, 0, 1.0, 1, 0, 0, 0, 0)
    })
    addTFCFoodItems('chocolate_glazed_berries', 'create:chocolate_glazed_berries', 4, 2, 5, 2.5, 0, 1, 0, 0, 1)
    addTFCFoodItems('honey_cake_slice', 'kubejs:honey_cake_slice', 4, 2.5, 0, 0.7, 1, 2, 0, 0, 0)
    addTFCFoodItems('honeyed_apple', 'create:honeyed_apple', 4, 2.5, 0, 0.7, 0, 2, 0, 0, 0)
    addTFCFoodItems('sweet_roll', 'create:sweet_roll', 4, 3.5, 0, 1.7, 2, 0, 0, 0, 1)
    addTFCFoodItems('maple_glazed_roll', 'gregitas:maple_glazed_roll', 4, 3.5, 0, 2.1, 2.5, 0, 0, 0, 0)
    
    let addTFCFuels = (id, fuel, duration, temp) => {
        let json = JsonIO.toObject(
            {
                "ingredient": [
                    {
                        "item": fuel
                    }
                ],
                "duration": duration,
                "temperature": temp
            }
        )

        event.addJson(`tfc:tfc/fuels/${id}.json`, json)
    }

    addTFCFuels('coal_coke', 'gtceu:coke_gem', 1100, 1415)
    addTFCFuels('coal_coke_block', 'gtceu:coke_block', 9900, 1415)
    addTFCFuels('coal_coke_flawless', 'gtceu:flawless_coke_gem', 2200, 1415)
    addTFCFuels('coal_coke_exquisite', 'gtceu:exquisite_coke_gem', 4400, 1415)

    let addTFCItemDamageResistances = (id, item, piercing, slashing, crushing) => {
        let json = JsonIO.toObject(
            {
                "ingredients": [
                    {
                        "item": item
                    }
                ],
                "piercing": piercing,
                "slashing": slashing,
                "crushing": crushing
            }
        )

        event.addJson(`tfc:tfc/item_damage_resistances/${id}.json`, json)
    }

    addTFCItemDamageResistances('create_diving_helmet', 'create:diving_helmet', 2, 2, 2)
    addTFCItemDamageResistances('create_diving_boots', 'create:diving_boots', 2, 2, 2)
    addTFCItemDamageResistances('create_copper_backtank', 'create:copper_backtank', 2, 2, 2)

    addTFCItemDamageResistances('ie_faraday_helmet', 'immersiveengineering:armor_faraday_helmet', 5, 3, 5)
    addTFCItemDamageResistances('ie_faraday_chestplate', 'immersiveengineering:armor_faraday_chestplate', 5, 3, 5)
    addTFCItemDamageResistances('ie_faraday_leggings', 'immersiveengineering:armor_faraday_leggings', 5, 3, 5)
    addTFCItemDamageResistances('ie_faraday_boots', 'immersiveengineering:armor_faraday_boots', 5, 3, 5)

    addTFCItemDamageResistances('ie_steel_helmet', 'immersiveengineering:armor_steel_helmet', 7, 4, 6)
    addTFCItemDamageResistances('ie_steel_chestplate', 'immersiveengineering:armor_steel_chestplate', 7, 4, 6)
    addTFCItemDamageResistances('ie_steel_leggings', 'immersiveengineering:armor_steel_leggings', 7, 4, 6)
    addTFCItemDamageResistances('ie_steel_boots', 'immersiveengineering:armor_steel_boots', 7, 4, 6)

    let addTFCItemHeatsItem = (id, item, heat, forge, weld) => {
        let json = JsonIO.toObject(
            {
                "ingredient": {
                    "item": item,
                },
                "heat_capacity": heat,
                "forging_temperature": forge,
                "welding_temperature": weld
            }
        )

        event.addJson(`tfc:tfc/item_heats/${id}.json`, json)
    }

    addTFCItemHeatsItem('andesite_alloy', 'create:andesite_alloy', 4.762, 252, 336)
    addTFCItemHeatsItem('compressed_coke_clay', 'gtceu:compressed_coke_clay', 1.0, 1.0, 1.0)
    addTFCItemHeatsItem('igneous_alloy_dust', 'gregitas_core:igneous_alloy_dust', 4.762, 4.762, 4.762)
    addTFCItemHeatsItem('pebbles', 'scguns:pebbles', 1.0, 1.0, 1.0)
    addTFCItemHeatsItem('seaweed', 'tfc:groundcover/seaweed', 1.0, 1.0, 1.0)   
  

  global.immGeoOres.forEach((ore) => {
    addTFCItemHeatsItem(`poor_${ore.ore}`, `immersivegeology:poor_ore_${ore.ore}`, global.immGeoOresCap[ore.ore], 1.0, 1.0)
    addTFCItemHeatsItem(`normal_${ore.ore}`, `immersivegeology:normal_ore_${ore.ore}`, global.immGeoOresCap[ore.ore], 1.0, 1.0)
    addTFCItemHeatsItem(`rich_${ore.ore}`, `immersivegeology:rich_ore_${ore.ore}`, global.immGeoOresCap[ore.ore], 1.0, 1.0)
  })

    let addTFCKnappingTypes = (id, tag, count, sound, consume_after, disabled_texture, particles, icon_item) => {
        let json = JsonIO.toObject(
            {
                "input": {
                    "ingredient": {
                        "tag": tag
                    },
                    "count": count
                },
                "click_sound": sound,
                "consume_after_complete": consume_after,
                "use_disabled_texture": disabled_texture,
                "spawns_particles": particles,
                "jei_icon_item": {
                    "item": icon_item
                }
            }
        )

        event.addJson(`tfc:tfc/knapping_types/${id}.json`, json)
    }

    addTFCKnappingTypes('flint', 'tfc:flint_knapping', 1, 'tfc:item.knapping.stone', false, false, false, 'minecraft:flint')
    addTFCKnappingTypes('rubber', 'tfc:rubber_knapping', 3, 'tfc:item.knapping.leather', false, false, false, 'gtceu:rubber_plate')

    let addTFCLampFuels = (id, fuel, duration) => {
        let json = JsonIO.toObject(
            {
                "fluid": fuel,
                "burn_rate": duration,
                "valid_lamps": {
                    "type": "tfc:tag",
                    "tag": "tfc:lamps"
                }
            }
        )

        event.addJson(`tfc:tfc/lamp_fuels/${id}.json`, json)
    }

    addTFCLampFuels('creosote', 'gtceu:creosote', 4000)

    let addTFCMetals = (id, tier, fluid, meltTemp, heatCapacity, item) => {
        let json = JsonIO.toObject(
            {
                "tier": tier,
                "fluid": fluid,
                "melt_temperature": meltTemp,
                "specific_heat_capacity": heatCapacity,
                "ingots": {
                  "item": item
                }
            }
        )

        event.addJson(`tfc:tfc/metals/${id}.json`, json)
    }

    addTFCMetals('igneous_alloy', 1, 'gregitas_core:igneous_alloy', 420, 0.01429, 'create:andesite_alloy')
}
