Replace 'minetest.' with 'core.' in builtin

This commit is contained in:
rubenwardy 2021-02-10 11:02:34 +00:00
parent 9736b9cea5
commit 4db7fb4a3b
7 changed files with 18 additions and 18 deletions

@ -115,7 +115,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
return
end
local event = minetest.explode_table_event(fields.list)
local event = core.explode_table_event(fields.list)
if event.type ~= "INV" then
local name = player:get_player_name()
core.show_formspec(name, "__builtin:help_cmds",

@ -678,7 +678,7 @@ end
-- Item definition defaults
--
local default_stack_max = tonumber(minetest.settings:get("default_stack_max")) or 99
local default_stack_max = tonumber(core.settings:get("default_stack_max")) or 99
core.nodedef_default = {
-- Item properties

@ -84,8 +84,8 @@ local function update_builtin_statbars(player)
end
if hud.id_breathbar and (not show_breathbar or breath == breath_max) then
minetest.after(1, function(player_name, breath_bar)
local player = minetest.get_player_by_name(player_name)
core.after(1, function(player_name, breath_bar)
local player = core.get_player_by_name(player_name)
if player then
player:hud_remove(breath_bar)
end

@ -74,7 +74,7 @@ local function get_formspec(data)
"label[1.75,0;" .. data.worldspec.name .. "]"
if mod.is_modpack or mod.type == "game" then
local info = minetest.formspec_escape(
local info = core.formspec_escape(
core.get_content_info(mod.path).description)
if info == "" then
if mod.is_modpack then

@ -15,7 +15,7 @@
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
if not minetest.get_http_api then
if not core.get_http_api then
function create_store_dlg()
return messagebox("store",
fgettext("ContentDB is not available when Minetest was compiled without cURL"))
@ -27,7 +27,7 @@ end
-- before the package list is ordered based on installed state.
local store = { packages = {}, packages_full = {}, packages_full_unordered = {} }
local http = minetest.get_http_api()
local http = core.get_http_api()
-- Screenshot
local screenshot_dir = core.get_cache_path() .. DIR_DELIM .. "cdb"
@ -152,7 +152,7 @@ local function start_install(package)
end
local function queue_download(package)
local max_concurrent_downloads = tonumber(minetest.settings:get("contentdb_max_concurrent_downloads"))
local max_concurrent_downloads = tonumber(core.settings:get("contentdb_max_concurrent_downloads"))
if number_downloading < max_concurrent_downloads then
start_install(package)
else
@ -320,7 +320,7 @@ function install_dialog.get_formspec()
selected_game_idx = i
end
games[i] = minetest.formspec_escape(games[i].name)
games[i] = core.formspec_escape(games[i].name)
end
local selected_game = pkgmgr.games[selected_game_idx]
@ -331,7 +331,7 @@ function install_dialog.get_formspec()
local formatted_deps = {}
for _, dep in pairs(install_dialog.dependencies) do
formatted_deps[#formatted_deps + 1] = "#fff"
formatted_deps[#formatted_deps + 1] = minetest.formspec_escape(dep.name)
formatted_deps[#formatted_deps + 1] = core.formspec_escape(dep.name)
if dep.installed then
formatted_deps[#formatted_deps + 1] = "#ccf"
formatted_deps[#formatted_deps + 1] = fgettext("Already installed")
@ -402,7 +402,7 @@ function install_dialog.handle_submit(this, fields)
end
if fields.will_install_deps ~= nil then
install_dialog.will_install_deps = minetest.is_yes(fields.will_install_deps)
install_dialog.will_install_deps = core.is_yes(fields.will_install_deps)
return true
end
@ -553,7 +553,7 @@ function store.load()
end
end
local timeout = tonumber(minetest.settings:get("curl_file_download_timeout"))
local timeout = tonumber(core.settings:get("curl_file_download_timeout"))
local response = http.fetch_sync({ url = url, timeout = timeout })
if not response.succeeded then
return
@ -793,8 +793,8 @@ function store.get_formspec(dlgdata)
-- title
formspec[#formspec + 1] = "label[1.875,0.1;"
formspec[#formspec + 1] = core.formspec_escape(
minetest.colorize(mt_color_green, package.title) ..
minetest.colorize("#BFBFBF", " by " .. package.author))
core.colorize(mt_color_green, package.title) ..
core.colorize("#BFBFBF", " by " .. package.author))
formspec[#formspec + 1] = "]"
-- buttons

@ -443,7 +443,7 @@ local function create_world_buttonhandler(this, fields)
end
if fields["mgv6_biomes"] then
local entry = minetest.formspec_escape(fields["mgv6_biomes"])
local entry = core.formspec_escape(fields["mgv6_biomes"])
for b=1, #mgv6_biomes do
if entry == mgv6_biomes[b][1] then
local ftable = core.settings:get_flags("mgv6_spflags")

@ -459,7 +459,7 @@ function pkgmgr.enable_mod(this, toset)
if not toset then
-- Mod(s) were disabled, so no dependencies need to be enabled
table.sort(toggled_mods)
minetest.log("info", "Following mods were disabled: " ..
core.log("info", "Following mods were disabled: " ..
table.concat(toggled_mods, ", "))
return
end
@ -496,7 +496,7 @@ function pkgmgr.enable_mod(this, toset)
enabled_mods[name] = true
local mod_to_enable = list[mod_ids[name]]
if not mod_to_enable then
minetest.log("warning", "Mod dependency \"" .. name ..
core.log("warning", "Mod dependency \"" .. name ..
"\" not found!")
else
if mod_to_enable.enabled == false then
@ -517,7 +517,7 @@ function pkgmgr.enable_mod(this, toset)
-- Log the list of enabled mods
table.sort(toggled_mods)
minetest.log("info", "Following mods were enabled: " ..
core.log("info", "Following mods were enabled: " ..
table.concat(toggled_mods, ", "))
end