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

Method clearCustomName

src/main/java/net/minecraft/item/ItemStack.java:621–641  ·  view source on GitHub ↗

Clear any custom name set for this ItemStack

()

Source from the content-addressed store, hash-verified

619 * Clear any custom name set for this ItemStack
620 */
621 public void clearCustomName()
622 {
623 if (this.stackTagCompound != null)
624 {
625 if (this.stackTagCompound.hasKey("display", 10))
626 {
627 NBTTagCompound nbttagcompound = this.stackTagCompound.getCompoundTag("display");
628 nbttagcompound.removeTag("Name");
629
630 if (nbttagcompound.hasNoTags())
631 {
632 this.stackTagCompound.removeTag("display");
633
634 if (this.stackTagCompound.hasNoTags())
635 {
636 this.setTagCompound(null);
637 }
638 }
639 }
640 }
641 }
642
643 /**
644 * Returns true if the itemstack has a display name

Callers 2

updateRepairOutputMethod · 0.95
updateItemNameMethod · 0.95

Calls 7

removeTagMethod · 0.95
hasNoTagsMethod · 0.95
setTagCompoundMethod · 0.95
hasKeyMethod · 0.80
getCompoundTagMethod · 0.80
removeTagMethod · 0.45
hasNoTagsMethod · 0.45

Tested by

no test coverage detected