MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getTooltip

Method getTooltip

src/main/java/net/minecraft/item/ItemStack.java:651–864  ·  view source on GitHub ↗
(EntityPlayer playerIn, boolean advanced)

Source from the content-addressed store, hash-verified

649 }
650
651 public List<String> getTooltip(EntityPlayer playerIn, boolean advanced)
652 {
653 List<String> list = Lists.<String>newArrayList();
654 String s = this.getDisplayName();
655
656 if (this.hasDisplayName())
657 {
658 s = ChatFormatting.ITALIC + s;
659 }
660
661 s = s + ChatFormatting.RESET;
662
663 if (advanced)
664 {
665 String s1 = "";
666
667 if (!s.isEmpty())
668 {
669 s = s + " (";
670 s1 = ")";
671 }
672
673 int i = Item.getIdFromItem(this.item);
674
675 if (this.getHasSubtypes())
676 {
677 s = s + String.format("#%04d/%d%s", new Object[] {i, this.itemDamage, s1});
678 }
679 else
680 {
681 s = s + String.format("#%04d%s", new Object[] {i, s1});
682 }
683 }
684 else if (!this.hasDisplayName() && this.item == Items.filled_map)
685 {
686 s = s + " #" + this.itemDamage;
687 }
688
689 list.add(s);
690 int i1 = 0;
691
692 if (this.hasTagCompound() && this.stackTagCompound.hasKey("HideFlags", 99))
693 {
694 i1 = this.stackTagCompound.getInteger("HideFlags");
695 }
696
697 if ((i1 & 32) == 0)
698 {
699 this.item.addInformation(this, playerIn, list, advanced);
700 }
701
702 if (this.hasTagCompound())
703 {
704 if ((i1 & 1) == 0)
705 {
706 NBTTagList nbttaglist = this.getEnchantmentTagList();
707
708 if (nbttaglist != null)

Callers 3

updateCreativeSearchMethod · 0.95
renderToolTipMethod · 0.80
renderToolTipMethod · 0.80

Calls 15

getDisplayNameMethod · 0.95
hasDisplayNameMethod · 0.95
getIdFromItemMethod · 0.95
getHasSubtypesMethod · 0.95
hasTagCompoundMethod · 0.95
hasKeyMethod · 0.95
getIntegerMethod · 0.95
getEnchantmentTagListMethod · 0.95
tagCountMethod · 0.95
getCompoundTagAtMethod · 0.95
getEnchantmentByIdMethod · 0.95
translateToLocalMethod · 0.95

Tested by

no test coverage detected