MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / fuse

Method fuse

src/main/java/gregapi/util/UT.java:1867–1873  ·  view source on GitHub ↗

Fuses two NBT Compounds together with the Priority lying on the content of the first NBT

(NBTTagCompound aNBT1, NBTTagCompound aNBT2)

Source from the content-addressed store, hash-verified

1865
1866 /** Fuses two NBT Compounds together with the Priority lying on the content of the first NBT */
1867 public static NBTTagCompound fuse(NBTTagCompound aNBT1, NBTTagCompound aNBT2) {
1868 if (aNBT1 == null) return aNBT2==null?make():(NBTTagCompound)aNBT2.copy();
1869 NBTTagCompound rNBT = (NBTTagCompound)aNBT1.copy();
1870 if (aNBT2 == null) return rNBT;
1871 for (Object tKey : aNBT2.func_150296_c()) if (!rNBT.hasKey(tKey.toString())) rNBT.setTag(tKey.toString(), aNBT2.getTag(tKey.toString()));
1872 return rNBT;
1873 }
1874
1875 public static NBTTagList makeInv(ItemStack... aStacks) {
1876 NBTTagList rInventory = new NBTTagList();

Callers 3

readFromNBTMethod · 0.80
readFromNBTMethod · 0.80

Calls 3

makeMethod · 0.95
copyMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected