package ru.dbotthepony.mc.otm.datagen.tags

import net.minecraft.world.item.Tiers
import net.minecraft.world.level.block.Block
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MRegistry

fun addMineableTags(tagsProvider: TagsProvider) {
	tagsProvider.requiresPickaxe(
		MBlocks.MATTER_CABLE,
		MBlocks.STORAGE_CABLE
	)

	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.PAINTER, Tiers.STONE)
	tagsProvider.requiresPickaxe(MBlocks.ENERGY_CABLES.values, Tiers.STONE)
	tagsProvider.requiresPickaxe(MBlocks.GRILL.values, Tiers.STONE)

	tagsProvider.requiresPickaxe(listOf<Block>(
		*MBlocks.ANDROID_STATION.values.toTypedArray(),
		*MBlocks.BATTERY_BANK.values.toTypedArray(),
		*MBlocks.MATTER_DECOMPOSER.values.toTypedArray(),
		*MBlocks.MATTER_CAPACITOR_BANK.values.toTypedArray(),
		MBlocks.PATTERN_STORAGE,
		*MBlocks.MATTER_SCANNER.values.toTypedArray(),
		*MBlocks.MATTER_PANEL.values.toTypedArray(),
		*MBlocks.MATTER_REPLICATOR.values.toTypedArray(),
		*MBlocks.MATTER_BOTTLER.values.toTypedArray(),
		*MBlocks.ENERGY_COUNTER.values.toTypedArray(),
		*MBlocks.CHEMICAL_GENERATOR.values.toTypedArray(),
		*MBlocks.PLATE_PRESS.values.toTypedArray(),
		*MBlocks.TWIN_PLATE_PRESS.values.toTypedArray(),
		*MBlocks.MATTER_RECYCLER.values.toTypedArray(),
		MBlocks.MATTER_ENTANGLER,

		*MBlocks.POWERED_FURNACE.values.toTypedArray(),
		*MBlocks.POWERED_SMOKER.values.toTypedArray(),
		*MBlocks.POWERED_BLAST_FURNACE.values.toTypedArray(),

		MBlocks.STORAGE_BUS,
		MBlocks.STORAGE_IMPORTER,
		MBlocks.STORAGE_EXPORTER,

		*MBlocks.DRIVE_VIEWER.values.toTypedArray(),
		MBlocks.DRIVE_RACK,
		*MBlocks.ITEM_MONITOR.values.toTypedArray(),
		*MBlocks.STORAGE_POWER_SUPPLIER.values.toTypedArray(),

		MBlocks.PHANTOM_ATTRACTOR,
		*MBlocks.ENERGY_SERVO.values.toTypedArray(),

		MBlocks.TRITANIUM_INGOT_BLOCK,
		MBlocks.WITHERED_STEEL_BLOCK,

		MBlocks.METAL_JUNK,
		MBlocks.METAL_MESH,
		MBlocks.TRITANIUM_BARS,
		MBlocks.METAL_RAILING,

		MBlocks.ENGINE,
		MBlocks.HOLO_SIGN,
		*MBlocks.COBBLESTONE_GENERATOR.values.toTypedArray(),
		*MBlocks.ESSENCE_STORAGE.values.toTypedArray(),
		*MBlocks.MATTER_RECONSTRUCTOR.values.toTypedArray(),
		MBlocks.FLUID_TANK,
		*MBlocks.ANDROID_CHARGER.values.toTypedArray(),

		MBlocks.TRITANIUM_HULL,
		MBlocks.BLACK_HOLE_GENERATOR,
		MBlocks.MATTER_INJECTOR,
		MBlocks.ANTIMATTER_INJECTOR,
		MBlocks.HIGH_ENERGY_PARTICLE_COLLECTOR,

		MBlocks.ITEM_INPUT_HATCH,
		MBlocks.ITEM_OUTPUT_HATCH,
		MBlocks.ENERGY_INPUT_HATCH,
		MBlocks.ENERGY_OUTPUT_HATCH,
		MBlocks.MATTER_INPUT_HATCH,
		MBlocks.MATTER_OUTPUT_HATCH,
		MBlocks.ENERGY_INPUT_INTERFACE,
		MBlocks.ENERGY_OUTPUT_INTERFACE,

		MBlocks.FLYWHEEL_SHAFT,
		MBlocks.FLYWHEEL_BEARING,
		MBlocks.FLYWHEEL_HOUSING,
		MBlocks.FLYWHEEL_BATTERY,

		MBlocks.GENERATOR_BLOCK,
		MBlocks.MODULAR_FRAME,
		MBlocks.HEAVY_MODULAR_FRAME,

		MBlocks.REINFORCED_REDSTONE_LAMP,
		MBlocks.REINFORCED_REDSTONE_LAMP_INVERTED,
	), Tiers.IRON)

	tagsProvider.requiresPickaxe(listOf(
		MBlocks.DILITHIUM_ORE,
		MBlocks.DEEPSLATE_DILITHIUM_ORE,
		MBlocks.DILITHIUM_CRYSTAL_BLOCK,
		MBlocks.ROFLITE_ALLOY_BLOCK,

		MBlocks.GRAVITATION_STABILIZER,
		MBlocks.GRAVITATION_STABILIZER_LENS,
	), Tiers.DIAMOND)

	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL.values.stream().flatMap { it.stream() }, Tiers.IRON)

	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ORE, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.DEEPSLATE_TRITANIUM_ORE, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_RAW_BLOCK, Tiers.IRON)

	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_BLOCK.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_STAIRS.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_WALL.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_STRIPED_SLAB.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.CARBON_FIBRE_BLOCK, Tiers.IRON)

	tagsProvider.requiresPickaxe(MBlocks.INFINITE_WATER_SOURCE, Tiers.STONE)

	tagsProvider.requiresPickaxe(MRegistry.CARGO_CRATES.allBlocks.values, Tiers.IRON)

	tagsProvider.requiresPickaxe(MRegistry.VENT.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.VENT_ALTERNATIVE.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_BLOCK.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.COMPUTER_TERMINAL.allBlocks.values, Tiers.STONE)
	tagsProvider.requiresPickaxe(MRegistry.STAR_CHAIR.allBlocks.values, Tiers.STONE)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_SLAB.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_WALL.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_PRESSURE_PLATE.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STAIRS.allBlocks.values, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_BLOCK.flatBlocks, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_STAIRS.flatBlocks, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_WALL.flatBlocks, Tiers.IRON)
	tagsProvider.requiresPickaxe(MRegistry.TRITANIUM_STRIPED_SLAB.flatBlocks, Tiers.IRON)

	tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES.blocks.values)
	tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_STAIRS.blocks.values)
	tagsProvider.requiresPickaxe(MRegistry.FLOOR_TILES_SLAB.blocks.values)
	tagsProvider.requiresShovel(MRegistry.UNREFINED_FLOOR_TILES.blocks.values)

	tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS.allBlocks.values, Tiers.STONE)
	tagsProvider.requiresPickaxe(MRegistry.INDUSTRIAL_GLASS_PANE.allBlocks.values, Tiers.STONE)
	tagsProvider.requiresPickaxe(MRegistry.DECORATIVE_CRATE.allBlocks.values, Tiers.STONE)

	tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.LABORATORY_LAMP_INVERTED, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.METAL_BEAM, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.METAL_BEAM_CENTER, Tiers.IRON)
	tagsProvider.requiresPickaxe(MBlocks.DANGER_STRIPE_BLOCK)

}
