Mode | Name | Size | |
-rw-r--r-- | testnodes_1.png | 107 | logplain |
-rw-r--r-- | testnodes_1g.png | 104 | logplain |
-rw-r--r-- | testnodes_1w.png | 121 | logplain |
-rw-r--r-- | testnodes_1wg.png | 122 | logplain |
-rw-r--r-- | testnodes_2.png | 112 | logplain |
-rw-r--r-- | testnodes_2g.png | 110 | logplain |
-rw-r--r-- | testnodes_2w.png | 134 | logplain |
-rw-r--r-- | testnodes_2wg.png | 135 | logplain |
-rw-r--r-- | testnodes_3.png | 105 | logplain |
-rw-r--r-- | testnodes_3g.png | 103 | logplain |
-rw-r--r-- | testnodes_3w.png | 112 | logplain |
-rw-r--r-- | testnodes_3wg.png | 112 | logplain |
-rw-r--r-- | testnodes_4.png | 97 | logplain |
-rw-r--r-- | testnodes_4g.png | 95 | logplain |
-rw-r--r-- | testnodes_4w.png | 128 | logplain |
-rw-r--r-- | testnodes_4wg.png | 128 | logplain |
-rw-r--r-- | testnodes_5.png | 98 | logplain |
-rw-r--r-- | testnodes_5g.png | 98 | logplain |
-rw-r--r-- | testnodes_5w.png | 117 | logplain |
-rw-r--r-- | testnodes_5wg.png | 117 | logplain |
-rw-r--r-- | testnodes_6.png | 100 | logplain |
-rw-r--r-- | testnodes_6g.png | 98 | logplain |
-rw-r--r-- | testnodes_6w.png | 117 | logplain |
-rw-r--r-- | testnodes_6wg.png | 117 | logplain |
-rw-r--r-- | testnodes_airlike.png | 92 | logplain |
-rw-r--r-- | testnodes_allfaces.png | 150 | logplain |
-rw-r--r-- | testnodes_allfaces_optional.png | 150 | logplain |
-rw-r--r-- | testnodes_alpha.png | 96 | logplain |
-rw-r--r-- | testnodes_alpha128.png | 136 | logplain |
-rw-r--r-- | testnodes_alpha191.png | 132 | logplain |
-rw-r--r-- | testnodes_alpha64.png | 134 | logplain |
-rw-r--r-- | testnodes_anim.png | 274 | logplain |
-rw-r--r-- | testnodes_attached_botto
objectrefGetOrCreate(L, player); // player
PCALL_RES(lua_pcall(L, 5, 1, error_handler));
if(!lua_isnumber(L, -1))
throw LuaError("allow_metadata_inventory_put should"
" return a number, guilty node: " + nodename);
int num = luaL_checkinteger(L, -1);
lua_pop(L, 2); // Pop integer and error handler
return num;
}
// Return number of accepted items to be taken
int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p,
const std::string &listname, int index, ItemStack &stack,
ServerActiveObject *player)
{
SCRIPTAPI_PRECHECKHEADER
int error_handler = PUSH_ERROR_HANDLER(L);
INodeDefManager *ndef = getServer()->ndef();
// If node doesn't exist, we don't know what callback to call
MapNode node = getEnv()->getMap().getNodeNoEx(p);
if (node.getContent() == CONTENT_IGNORE)
return 0;
// Push callback function on stack
std::string nodename = ndef->get(node).name;
if (!getItemCallback(nodename.c_str(), "allow_metadata_inventory_take"))
return stack.count;
// Call function(pos, listname, index, count, player)
push_v3s16(L, p); // pos
lua_pushstring(L, listname.c_str()); // listname
lua_pushinteger(L, index + 1); // index
LuaItemStack::create(L, stack); // stack
objectrefGetOrCreate(L, player); // player
PCALL_RES(lua_pcall(L, 5, 1, error_handler));
if (!lua_isnumber(L, -1))
throw LuaError("allow_metadata_inventory_take should"
" return a number, guilty node: " + nodename);
int num = luaL_checkinteger(L, -1);
lua_pop(L, 2); // Pop integer and error handler
return num;
}
// Report moved items
void ScriptApiNodemeta::nodemeta_inventory_OnMove(v3s16 p,
const std::string &from_list, int from_index,
const std::string &to_list, int to_index,
int count, ServerActiveObject *player)
{
SCRIPTAPI_PRECHECKHEADER
int error_handler = PUSH_ERROR_HANDLER(L);
INodeDefManager *ndef = getServer()->ndef();
// If node doesn't exist, we don't know what callback to call
MapNode node = getEnv()->getMap().getNodeNoEx(p);
if (node.getContent() == CONTENT_IGNORE)
return;
// Push callback function on stack
std::string nodename = ndef->get(node).name;
if (!getItemCallback(nodename.c_str(), "on_metadata_inventory_move"))
return;
// function(pos, from_list, from_index, to_list, to_index, count, player)
push_v3s16(L, p); // pos
lua_pushstring(L, from_list.c_str()); // from_list
lua_pushinteger(L, from_index + 1); // from_index
lua_pushstring(L, to_list.c_str()); // to_list
lua_pushinteger(L, to_index + 1); // to_index
lua_pushinteger(L, count); // count
objectrefGetOrCreate(L, player); // player
PCALL_RES(lua_pcall(L, 7, 0, error_handler));
lua_pop(L, 1); // Pop error handler
}
// Report put items
void ScriptApid=f128f4cba14aad9c7bbf46b79bb6147a49a3595b'>plain |
-rw-r--r-- | testnodes_glasslike_detail.png | 167 | generated by cgit v1.2.3 (git 2.39.1) at 2025-02-16 08:47:52 +0000
|