package ru.dbotthepony.mc.otm.item.block

import net.minecraft.ChatFormatting
import net.minecraft.network.chat.Component
import net.minecraft.world.item.BlockItem
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.core.util.formatPower
import ru.dbotthepony.mc.otm.registry.game.MBlocks

class EnergyCableItem(val conf: CablesConfig.E, properties: Properties) : BlockItem(MBlocks.ENERGY_CABLES[conf]!!, properties) {
	override fun appendHoverText(
		stack: ItemStack,
		context: TooltipContext,
		tooltip: MutableList<Component>,
		flag: TooltipFlag
	) {
		super.appendHoverText(stack, context, tooltip, flag)

		tooltip.add(
			Component.translatable("otm.item.power.throughput_mono", conf.throughput.formatPower())
				.withStyle(ChatFormatting.GRAY))
	}

}
