mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
23e9f5db43
commit
b38ffdec27
29 changed files with 191 additions and 167 deletions
|
@ -186,15 +186,13 @@ bool ScriptApiClient::on_dignode(v3s16 p, MapNode node)
|
|||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
const NodeDefManager *ndef = getClient()->ndef();
|
||||
|
||||
// Get core.registered_on_dignode
|
||||
lua_getglobal(L, "core");
|
||||
lua_getfield(L, -1, "registered_on_dignode");
|
||||
|
||||
// Push data
|
||||
push_v3s16(L, p);
|
||||
pushnode(L, node, ndef);
|
||||
pushnode(L, node);
|
||||
|
||||
// Call functions
|
||||
try {
|
||||
|
@ -210,15 +208,13 @@ bool ScriptApiClient::on_punchnode(v3s16 p, MapNode node)
|
|||
{
|
||||
SCRIPTAPI_PRECHECKHEADER
|
||||
|
||||
const NodeDefManager *ndef = getClient()->ndef();
|
||||
|
||||
// Get core.registered_on_punchgnode
|
||||
lua_getglobal(L, "core");
|
||||
lua_getfield(L, -1, "registered_on_punchnode");
|
||||
|
||||
// Push data
|
||||
push_v3s16(L, p);
|
||||
pushnode(L, node, ndef);
|
||||
pushnode(L, node);
|
||||
|
||||
// Call functions
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue