NBTTagCompound itemnbt = (NBTTagCompound) list.getCompoundTagAt(i);
NBTTagCompound itemNBTContent = itemnbt.getCompoundTag("nbt");
if(!itemnbt.hasKey("nbt")) {
itemNBTContent = null;
}
ItemIdentifierStack stack = ItemIdentifier.get(Item.getItemById(itemnbt.getInteger("id")), itemnbt.getInteger("data"), itemNBTContent).makeStack(itemnbt.getInteger("amount"));
transaction.add(stack);
}
RequestTree.request(transaction, requester, new RequestLog() {
@Override
public void handleMissingItems(Map<ItemIdentifier,Integer> items) {
Collection<ItemIdentifierStack> coll = new ArrayList<ItemIdentifierStack>(items.size());
for(Entry<ItemIdentifier,Integer>e:items.entrySet()) {
coll.add(new ItemIdentifierStack(e.getKey(), e.getValue()));
}
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(MissingItems.class).setItems(coll).setFlag(true), player);
}
@Override
public void handleSucessfullRequestOf(ItemIdentifier item, int count, LinkedLogisticsOrderList parts) {}
@Override
public void handleSucessfullRequestOfList(Map<ItemIdentifier,Integer> items, LinkedLogisticsOrderList parts) {
Collection<ItemIdentifierStack> coll = new ArrayList<ItemIdentifierStack>(items.size());
for(Entry<ItemIdentifier,Integer>e:items.entrySet()) {
coll.add(new ItemIdentifierStack(e.getKey(), e.getValue()));
}
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(MissingItems.class).setItems(coll).setFlag(false), player);
if(requester instanceof IRequestWatcher) {
((IRequestWatcher)requester).handleOrderList(transaction.get(0), parts);
}