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

Method getSubCompound

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

Get an NBTTagCompound from this stack's NBT data. @param key The NBTTagCompound to get @param create Whether a new, empty compound should be created if none is present yet

(String key, boolean create)

Source from the content-addressed store, hash-verified

549 * @param create Whether a new, empty compound should be created if none is present yet
550 */
551 public NBTTagCompound getSubCompound(String key, boolean create)
552 {
553 if (this.stackTagCompound != null && this.stackTagCompound.hasKey(key, 10))
554 {
555 return this.stackTagCompound.getCompoundTag(key);
556 }
557 else if (create)
558 {
559 NBTTagCompound nbttagcompound = new NBTTagCompound();
560 this.setTagInfo(key, nbttagcompound);
561 return nbttagcompound;
562 }
563 else
564 {
565 return null;
566 }
567 }
568
569 public NBTTagList getEnchantmentTagList()
570 {

Callers 6

getCraftingResultMethod · 0.95
addInformationMethod · 0.80
getBaseColorMethod · 0.80
getBaseColorMethod · 0.80
getPatternsMethod · 0.80
removeBannerDataMethod · 0.80

Calls 3

setTagInfoMethod · 0.95
hasKeyMethod · 0.80
getCompoundTagMethod · 0.80

Tested by

no test coverage detected