use of logisticspipes.utils.item.ItemIdentifierStack in project LogisticsPipes by RS485.
the class PipeTransportLogistics method writeToNBT.
public void writeToNBT(NBTTagCompound nbt) {
{
NBTTagList nbttaglist = new NBTTagList();
for (LPTravelingItem item : items) {
if (item instanceof LPTravelingItemServer) {
NBTTagCompound dataTag = new NBTTagCompound();
nbttaglist.appendTag(dataTag);
((LPTravelingItemServer) item).writeToNBT(dataTag);
}
}
nbt.setTag("travelingEntities", nbttaglist);
}
NBTTagList nbttaglist2 = new NBTTagList();
for (Pair<ItemIdentifierStack, Pair<Integer, Integer>> stack : _itemBuffer) {
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
stack.getValue1().makeNormalStack().writeToNBT(nbttagcompound1);
nbttaglist2.appendTag(nbttagcompound1);
}
nbt.setTag("buffercontents", nbttaglist2);
}
use of logisticspipes.utils.item.ItemIdentifierStack in project LogisticsPipes by RS485.
the class ItemDisplay method setItemList.
public void setItemList(Collection<ItemIdentifierStack> allItems) {
listbyserver = true;
_allItems.clear();
_allItems.addAll(allItems);
Collections.sort(_allItems, new StackComparitor());
boolean found = false;
if (selectedItem == null) {
return;
}
for (ItemIdentifierStack itemStack : _allItems) {
if (itemStack.getItem().equals(selectedItem.getItem())) {
selectedItem = itemStack;
found = true;
break;
}
}
if (!found) {
selectedItem = null;
}
}
use of logisticspipes.utils.item.ItemIdentifierStack in project LogisticsPipes by RS485.
the class LPDataIOWrapper method readItemIdentifierStack.
@Override
public ItemIdentifierStack readItemIdentifierStack() {
int stacksize = readInt();
if (stacksize == -1) {
return null;
}
ItemIdentifier item = readItemIdentifier();
return new ItemIdentifierStack(item, stacksize);
}
Aggregations