const FLOWER_DATA_FILE = 'kubejs:data_models/blocks/flower'

// This is the model's actual registry ID.
// "data_models/" is the registry folder and is not part of the ID.
const FLOWER_MODEL_ID = 'kubejs:blocks/flower'

ServerEvents.generateData('after_mods', event => {
  event.json(FLOWER_DATA_FILE, {
    type: 'hostilenetworks:block_data_model',

    block: 'minecraft:allium',

    variants: [
      'minecraft:dandelion',
      'minecraft:poppy',
      'minecraft:blue_orchid',
      'minecraft:azure_bluet',
      'minecraft:red_tulip',
      'minecraft:orange_tulip',
      'minecraft:white_tulip',
      'minecraft:pink_tulip',
      'minecraft:oxeye_daisy',
      'minecraft:cornflower',
      'minecraft:lily_of_the_valley',
      'minecraft:wither_rose',
      'minecraft:torchflower',
      'minecraft:sunflower',
      'minecraft:lilac',
      'minecraft:peony',
      'minecraft:rose_bush',
      'minecraft:pitcher_plant'
    ],

    // HNN adds "Data Model" itself.
    name: {
      text: 'Flower'
    },

    name_color: '#C26BE8',

    display: {
      scale: 2.5
    },

    sim_cost: 128,

    input: {
      item: 'hostilenetworks:prediction_matrix'
    },

    base_drop: {
      id: 'hostilenetworks:overworld_prediction'
    },

    trivia: 'kubejs.trivia.flower',

    fabricator_drops: [
      { id: 'minecraft:white_dye', count: 16 },
      { id: 'minecraft:light_gray_dye', count: 16 },
      { id: 'minecraft:gray_dye', count: 16 },
      { id: 'minecraft:black_dye', count: 16 },
      { id: 'minecraft:brown_dye', count: 16 },
      { id: 'minecraft:red_dye', count: 16 },
      { id: 'minecraft:orange_dye', count: 16 },
      { id: 'minecraft:yellow_dye', count: 16 },
      { id: 'minecraft:lime_dye', count: 16 },
      { id: 'minecraft:green_dye', count: 16 },
      { id: 'minecraft:cyan_dye', count: 16 },
      { id: 'minecraft:light_blue_dye', count: 16 },
      { id: 'minecraft:blue_dye', count: 16 },
      { id: 'minecraft:purple_dye', count: 16 },
      { id: 'minecraft:magenta_dye', count: 16 },
      { id: 'minecraft:pink_dye', count: 16 }
    ]
  })
})

// HNN's dynamically created model stack may miss EMI's initial item indexing.
RecipeViewerEvents.addEntries('item', event => {
  event.add(
    `hostilenetworks:data_model[hostilenetworks:data_model="${FLOWER_MODEL_ID}"]`
  )
})