use of logisticspipes.interfaces.ICraftingResultHandler in project LogisticsPipes by RS485.
the class LogisticsSolderingTileEntity method tryCraft.
private boolean tryCraft() {
ItemIdentifierStack content = inv.getIDStackInSlot(10);
ICraftingResultHandler handler = getHandlerForRecipe();
ItemStack toAdd = getTagetForRecipe(false);
if (handler != null) {
handler.handleCrafting(toAdd);
}
if (content != null) {
if (!content.getItem().equals(toAdd)) {
return false;
}
if (content.getStackSize() + toAdd.stackSize > content.getItem().getMaxStackSize()) {
return false;
}
toAdd.stackSize += content.getStackSize();
}
//dummy
getTagetForRecipe(true);
inv.setInventorySlotContents(10, toAdd);
inv.decrStackSize(9, 1);
inv.markDirty();
super.markDirty();
updateInventory();
return true;
}
Aggregations