Luanti 5.17.0-dev
Loading...
Searching...
No Matches
l_craft.cpp File Reference
#include "lua_api/l_craft.h"
#include "common/c_content.h"
#include "common/c_converter.h"
#include "common/helper.h"
#include "craftdef.h"
#include "log.h"
#include "lua_api/l_internal.h"
#include "lua_api/l_item.h"
#include "server.h"
Include dependency graph for l_craft.cpp:

Functions

static void push_craft_result_input (lua_State *L, IGameDef *gdef, const CraftInput &input, bool push_itemstacks, bool undocumented_0_4_14_compat)
 Pushes to table @ Lua top: method, (type), width, items.
static void push_craft_result_output (lua_State *L, IGameDef *gdef, bool is_craft_valid, const char *output_field, const CraftOutput &output, bool push_itemstacks)
 Pushes to table @ Lua top: item.
static void push_craft_recipe (lua_State *L, IGameDef *gdef, const CraftDefinition *recipe, const CraftOutput &tmpout)

Function Documentation

◆ push_craft_recipe()

void push_craft_recipe ( lua_State * L,
IGameDef * gdef,
const CraftDefinition * recipe,
const CraftOutput & tmpout )
static

References CRAFT_METHOD_COOKING, CRAFT_METHOD_FUEL, CRAFT_METHOD_NORMAL, CraftDefinition::getInput(), CraftDefinition::getOutput(), CraftInput::method, push_craft_result_input(), push_craft_result_output(), setintfield(), and CraftOutput::time.

Referenced by ModApiCraft::l_get_all_craft_recipes(), and ModApiCraft::l_get_craft_recipe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_craft_result_input()

void push_craft_result_input ( lua_State * L,
IGameDef * gdef,
const CraftInput & input,
bool push_itemstacks,
bool undocumented_0_4_14_compat )
static

Pushes to table @ Lua top: method, (type), width, items.

References enum_to_string(), ModApiCraft::es_CraftMethod, CraftInput::items, CraftInput::method, push_items(), setintfield(), and CraftInput::width.

Referenced by ModApiCraft::l_get_craft_result(), and push_craft_recipe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_craft_result_output()

void push_craft_result_output ( lua_State * L,
IGameDef * gdef,
bool is_craft_valid,
const char * output_field,
const CraftOutput & output,
bool push_itemstacks )
static

Pushes to table @ Lua top: item.

References LuaItemStack::create(), ItemStack::deSerialize(), FATAL_ERROR_IF, IGameDef::idef(), and CraftOutput::item.

Referenced by ModApiCraft::l_get_craft_result(), and push_craft_recipe().

Here is the call graph for this function:
Here is the caller graph for this function: