if(r != null) target[i] = r.getPipe();
}
}
}
CraftingTemplate template = new CraftingTemplate(craftingStack, this, priority);
//Check all materials
for (int i = 0; i < 9; i++){
ItemIdentifierStack resourceStack = getMaterials(i);
if (resourceStack == null || resourceStack.getStackSize() == 0) continue;
CraftingRequirement req = new CraftingRequirement();
req.stack = resourceStack;
if(getUpgradeManager().isFuzzyCrafter())
{
if((fuzzyCraftingFlagArray[i] & 0x1) != 0)
req.use_od = true;
if((fuzzyCraftingFlagArray[i] & 0x2) != 0)
req.ignore_dmg = true;
if((fuzzyCraftingFlagArray[i] & 0x4) != 0)
req.ignore_nbt = true;
if((fuzzyCraftingFlagArray[i] & 0x8) != 0)
req.use_category = true;
}
template.addRequirement(req, target[i], new CraftingChassieInformation(i, this.getPositionInt()));
}
int liquidCrafter = this.getUpgradeManager().getFluidCrafter();
IRequestFluid[] liquidTarget = new IRequestFluid[liquidCrafter];
if(!getUpgradeManager().isAdvancedSatelliteCrafter()) {
if(liquidSatelliteId != 0) {
IRouter r = getFluidSatelliteRouter(-1);
if(r != null) {
IRequestFluid sat = (IRequestFluid) r.getPipe();
for(int i=0;i<liquidCrafter;i++) {
liquidTarget[i] = sat;
}
}
}
} else {
for(int i=0;i<liquidCrafter;i++) {
if(liquidSatelliteIdArray[i] != 0) {
IRouter r = getFluidSatelliteRouter(i);
if(r != null) liquidTarget[i] = (IRequestFluid) r.getPipe();
}
}
}
for (int i = 0; i < liquidCrafter; i++){
FluidIdentifier liquid = getFluidMaterial(i);
int amount = getFluidAmount()[i];
if (liquid == null || amount <= 0 || liquidTarget[i] == null) continue;
template.addRequirement(liquid, amount, liquidTarget[i]);
}
if(this.getUpgradeManager().hasByproductExtractor() && getByproductItem() != null) {
template.addByproduct(getByproductItem());
}
return template;
}