lua: minetest == core?

Post Reply
User avatar
aristotle
Member
Posts: 79
Joined: Wed Mar 14, 2018 23:40
GitHub: askotos
IRC: aristotle_
In-game: aristotle
Location: Currently on Melpomene, waiting for the starship to be fixed.
Contact:

lua: minetest == core?

by aristotle » Post

First: I hope to have identified the right part of the forum to post this

When I read official docs such as lua_api.txt and code examples (eg other mods sources) I find reference to a core object.

MT 0.5 lua_api.txt lines 2009-2010, 2050-2051, 2059-2060

Code: Select all

* See also `minetest.explode_textlist_event`
  (main menu: `core.explode_textlist_event`).
...
* See also `minetest.explode_scrollbar_event`
  (main menu: `core.explode_scrollbar_event`).
...
* See also `minetest.explode_table_event`
  (main menu: `core.explode_table_event`).
What is this core object? Is this just an [old|deprecated] minetest alias or a completely different object? Is there a convention on its usage? Thank you in advance.
Happy builds & explorations! | Initiating my Creative Minetest channel on YouTube

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: lua: minetest == core?

by Krock » Post

They're pointing both to the identical table: https://github.com/minetest/minetest/bl ... it.lua#L24 (i.e. "minetest" is identical to "core", always)

Use "minetest" for creating mods and "core" when you're working with Minetest's builtin code, which is: mainmenu, common helper functions, chat commands like /status and so on.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
aristotle
Member
Posts: 79
Joined: Wed Mar 14, 2018 23:40
GitHub: askotos
IRC: aristotle_
In-game: aristotle
Location: Currently on Melpomene, waiting for the starship to be fixed.
Contact:

Re: lua: minetest == core?

by aristotle » Post

Krock wrote:They're pointing both to the identical table: https://github.com/minetest/minetest/bl ... it.lua#L24 (i.e. "minetest" is identical to "core", always)

Use "minetest" for creating mods and "core" when you're working with Minetest's builtin code, which is: mainmenu, common helper functions, chat commands like /status and so on.
Thank you. It makes sense and helps code maintenance. :)
Happy builds & explorations! | Initiating my Creative Minetest channel on YouTube

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 5 guests