// priority: 0

settings.logAddedRecipes = true
settings.logRemovedRecipes = true
settings.logSkippedRecipes = false
settings.logErroringRecipes = true

console.info('Hello, World! (You will see this line every time server resources reload)')

onEvent('recipes', event => {
	// Change recipes here
})

onEvent('item.tags', event => {
	// Get the #forge:cobblestone tag collection and add Diamond Ore to it
	// event.get('forge:cobblestone').add('minecraft:diamond_ore')
	event.get('minecraft:logs').add('kubejs:mechanized_block')
	event.get('minecraft:planks').add('kubejs:mechanized_plank')
	event.get('minecraft:non_flammable_wood').add('kubejs:mechanized_block')
	event.get('forge:rods').add('kubejs:mechanized_rod')
	event.get('forge:rods/wooden').add('kubejs:mechanized_rod')
	event.removeAll('industrialforegoing:sludge')
	event.add('industrialforegoing:sludge', 'minecraft:clay')
	event.add('minecraft:piglin_loved', 'mekanism:mekasuit_boots')
	event.add('minecraft:piglin_loved', 'mekanism:mekasuit_helmet')
	event.add('minecraft:piglin_loved', 'mekanism:mekasuit_bodyarmor')
	event.add('minecraft:piglin_loved', 'mekanism:mekasuit_pants')
	event.add('undergarden:portal_frame_blocks', 'kubejs:stone_bricks')
	//event.add('', 'mekanism:upgrades')

	// Get the #forge:cobblestone tag collection and remove Mossy Cobblestone from it
	// event.get('forge:cobblestone').remove('minecraft:mossy_cobblestone')
})


onEvent('recipes', event => {

event.replaceInput({}, 'minecraft:stone_bricks', 'kubejs:stone_bricks')
event.replaceOutput({}, 'minecraft:stone_bricks', 'kubejs:stone_bricks')

event.shaped('kubejs:stone_bricks', [
    'AA',
    'AA'
  ], {
    A: 'minecraft:stone'
  })


onEvent('worldgen.remove', event => {
  event.removeFeatureById('underground_structures', 'minecraft:stronghold')
})
})

/*
onEvent('block.right_click', event => {
	event.right_click('kubejs:theuniverse')
	event.player.tell('Hi!')
})
*/

onEvent('block.right_click', event => {
  if(event.item.id == "extendedcrafting:the_ultimate_ingot" && event.block.id == "kubejs:theuniverse") {
    event.server.runCommand(`execute positioned ${event.block.x} ${event.block.y} ${event.block.z} run fill ^2 ^-1 ^-2 ^-2 ^-1 ^-6 minecraft:dirt`),
	event.server.runCommand(`execute positioned ${event.block.x} ${event.block.y} ${event.block.z} run fill ^2 ^ ^-2 ^-2 ^ ^-6 minecraft:stone_bricks`),
	event.server.runCommand(`execute positioned ${event.block.x} ${event.block.y} ${event.block.z} run fill ^1 ^ ^-3 ^-1 ^ ^-5 overworldmirror:portal`)
  }
})


onEvent('player.chat', (event) => {
  // Check if message equals creeper, ignoring case
  if (event.message.trim().equalsIgnoreCase('creeper')) {
    // Schedule task in 1 tick, because if you reply immidiently, it will print before player's message
    event.server.scheduleInTicks(1, event.server, (callback) => {
      // Tell everyone Aw man, colored green. Callback data is the server
      callback.data.tell(Text.green('Aw man'))
    })
  }
})
