コード例 #1
0
 public void fromNbt(NBTTagCompound tag) {
   clear();
   NBTTagList elements = tag.getTagList("elements", Constants.NBT.TAG_COMPOUND);
   for (int i = 0; i < elements.tagCount(); ++i) {
     NBTTagCompound element = elements.getCompoundTagAt(i);
     Key k = Key.fromNbt(element.getCompoundTag("key"));
     Element e = Element.fromNbt(element.getCompoundTag("element"));
     _elements.put(k, e);
     if (e.whitelisted()) _whitelist.add(k);
   }
   _exportable.fromNbt(tag.getCompoundTag("exportable"));
   if (tag.hasKey("export"))
     _export = ItemHelper.readItemStackFromNBT(tag.getCompoundTag("export"));
   _total = tag.getInteger("total");
 }
コード例 #2
0
 public static Key fromNbt(NBTTagCompound tag) {
   return Key.of(ItemHelper.readItemStackFromNBT(tag));
 }