package com.r3944realms.modernlifepatch.mixin.item;

import com.dairymoose.modernlife.items.BatteryItem;
import com.r3944realms.modernlifepatch.datagen.lang.ModLangKeyValue;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.List;

@Mixin(BatteryItem.class)
public class MixinBattery {
    @Inject(method = {"appendHoverText"}, at= @At("HEAD"), cancellable = true)
    public void appendHoverText(ItemStack itemStack, Level world, List<Component> text, TooltipFlag flag, CallbackInfo ci) {
        text.add(Component.translatable(ModLangKeyValue.BATTERY_HOVER.getKey()));
        ci.cancel();
    }
}
