Clear any custom name set for this ItemStack
()
| 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 |
no test coverage detected