use of appeng.api.storage.data.IAEItemStack in project PneumaticCraft by MineMaarten.
the class SemiBlockRequester method updateProvidingItems.
@Optional.Method(modid = ModIds.AE2)
private void updateProvidingItems(ICraftingProviderHelper cHelper) {
IStackWatcher sWatcher = (IStackWatcher) stackWatcher;
ICraftingWatcher cWatcher = (ICraftingWatcher) craftingWatcher;
if (sWatcher != null)
sWatcher.clear();
if (cWatcher != null)
cWatcher.clear();
for (IAEItemStack stack : getProvidingItems()) {
if (sWatcher != null)
sWatcher.add(stack);
if (cWatcher != null)
cWatcher.add(stack);
if (cHelper != null)
cHelper.setEmitable(stack);
}
}
use of appeng.api.storage.data.IAEItemStack in project PneumaticCraft by MineMaarten.
the class SemiBlockRequesterAE method getAvailableItems.
@Override
@Optional.Method(modid = ModIds.AE2)
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> arg0) {
for (IAEItemStack stack : getProvidingItems()) {
stack.setCountRequestable(stack.getStackSize());
arg0.addRequestable(stack);
}
return arg0;
}
use of appeng.api.storage.data.IAEItemStack in project LogisticsPipes by RS485.
the class AEInterfaceInventoryHandler method add.
@Override
public ItemStack add(ItemStack stack, ForgeDirection from, boolean doAdd) {
ItemStack st = stack.copy();
IAEItemStack tst = AEApi.instance().storage().createItemStack(stack);
IStorageMonitorable tmp = tile.getMonitorable(dir, source);
if (tmp == null || tmp.getItemInventory() == null) {
return st;
}
IAEItemStack overflow = tmp.getItemInventory().injectItems(tst, Actionable.MODULATE, source);
if (overflow != null) {
st.stackSize -= overflow.getStackSize();
}
return st;
}
use of appeng.api.storage.data.IAEItemStack in project LogisticsPipes by RS485.
the class AEInterfaceInventoryHandler method getSingleItem.
@Override
public ItemStack getSingleItem(ItemIdentifier item) {
IStorageMonitorable tmp = tile.getMonitorable(dir, source);
if (tmp == null || tmp.getItemInventory() == null) {
return null;
}
IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(1));
IAEItemStack extract = tmp.getItemInventory().extractItems(stack, Actionable.MODULATE, source);
if (extract == null) {
return null;
}
return extract.getItemStack();
}
use of appeng.api.storage.data.IAEItemStack in project LogisticsPipes by RS485.
the class AEInterfaceInventoryHandler method roomForItem.
@Override
public int roomForItem(ItemIdentifier item, int count) {
IStorageMonitorable tmp = tile.getMonitorable(dir, source);
if (tmp == null || tmp.getItemInventory() == null) {
return 0;
}
while (count > 0) {
IAEItemStack stack = AEApi.instance().storage().createItemStack(item.makeNormalStack(count));
if (tmp.getItemInventory().canAccept(stack)) {
return count;
}
count--;
}
return 0;
}
Aggregations