package com.miningmark48.pearcelmod.item;
import com.miningmark48.pearcelmod.utility.KeyCheck;
import com.miningmark48.pearcelmod.utility.Translate;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import java.util.List;
public class ItemPearcelCrook extends ItemSword {
public ItemPearcelCrook(ToolMaterial material) {
super(material);
setMaxDamage(64);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
if (KeyCheck.isHoldingShift()) {
list.add(Translate.toLocal("tooltip.item.pearcel_crook.line1"));
}else{
list.add(Translate.toLocal("tooltip.item.hold") + " " + TextFormatting.AQUA + TextFormatting.ITALIC + Translate.toLocal("tooltip.item.shift"));
}
}
@Override
public boolean onBlockDestroyed(ItemStack stack, World worldIn, IBlockState state, BlockPos pos, EntityLivingBase entityLiving)
{
if ((double)state.getBlockHardness(worldIn, pos) != 0.0D)
{
stack.damageItem(1, entityLiving);
}
return true;
}
}