Beispiel #1
0
CraftInput createInput(const CraftPointerInput &cpi)
{
	std::vector<std::string> items;
	for(u32 i=0; i<cpi.items.size(); i++){
		if(cpi.items[i] == NULL)
			items.push_back("");
		else{
			std::ostringstream oss(std::ios::binary);
			cpi.items[i]->serialize(oss);
			items.push_back(oss.str());
		}
	}
	return CraftInput(cpi.width, items);
}
Beispiel #2
0
CraftInput CraftDefinitionFuel::getInput(const CraftOutput &output, IGameDef *gamedef) const
{
	std::vector<std::string> rec;
	rec.push_back(recipe);
	return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef));
}
Beispiel #3
0
CraftInput CraftDefinitionToolRepair::getInput(const CraftOutput &output, IGameDef *gamedef) const
{
	std::vector<ItemStack> stack;
	stack.push_back(ItemStack());
	return CraftInput(CRAFT_METHOD_COOKING,additional_wear,stack);
}
Beispiel #4
0
CraftInput CraftDefinitionShapeless::getInput(const CraftOutput &output, IGameDef *gamedef) const
{
	return CraftInput(CRAFT_METHOD_NORMAL,0,craftGetItems(recipe,gamedef));
}