
* Added explicit Tooltip for unbound items and restructured Bindable inheritance - Added a "Item is not bound" tooltip to ItemBindableBase - Streamlined inheritance. All Sigils now extend ItemBindableBase at some point. - removed redundant hasTextCompound check * Removed TextHelper usages in the affected files. * Nobody likes tooltips. * Forgot the translation entry. * Reverted change
35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
package WayofTime.bloodmagic.item;
|
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
import WayofTime.bloodmagic.core.data.Binding;
|
|
import WayofTime.bloodmagic.iface.IBindable;
|
|
import net.minecraft.client.util.ITooltipFlag;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.util.text.TextComponentTranslation;
|
|
import net.minecraft.world.World;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
import java.util.List;
|
|
|
|
public class ItemBindableBase extends Item implements IBindable {
|
|
public ItemBindableBase() {
|
|
super();
|
|
|
|
setCreativeTab(BloodMagic.TAB_BM);
|
|
setMaxStackSize(1);
|
|
}
|
|
|
|
@Override
|
|
@SideOnly(Side.CLIENT)
|
|
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
|
|
if (!stack.hasTagCompound())
|
|
return;
|
|
|
|
Binding binding = getBinding(stack);
|
|
if (binding != null)
|
|
tooltip.add(new TextComponentTranslation("tooltip.bloodmagic.currentOwner", binding.getOwnerName()).getFormattedText());
|
|
}
|
|
}
|