mirror of
https://github.com/minetest/minetest.git
synced 2024-11-09 01:03:46 +01:00
Replace 'minetest.' with 'core.' in builtin
This commit is contained in:
parent
9736b9cea5
commit
4db7fb4a3b
@ -115,7 +115,7 @@ core.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local event = minetest.explode_table_event(fields.list)
|
local event = core.explode_table_event(fields.list)
|
||||||
if event.type ~= "INV" then
|
if event.type ~= "INV" then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
core.show_formspec(name, "__builtin:help_cmds",
|
core.show_formspec(name, "__builtin:help_cmds",
|
||||||
|
@ -678,7 +678,7 @@ end
|
|||||||
-- Item definition defaults
|
-- 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 = {
|
core.nodedef_default = {
|
||||||
-- Item properties
|
-- Item properties
|
||||||
|
@ -84,8 +84,8 @@ local function update_builtin_statbars(player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if hud.id_breathbar and (not show_breathbar or breath == breath_max) then
|
if hud.id_breathbar and (not show_breathbar or breath == breath_max) then
|
||||||
minetest.after(1, function(player_name, breath_bar)
|
core.after(1, function(player_name, breath_bar)
|
||||||
local player = minetest.get_player_by_name(player_name)
|
local player = core.get_player_by_name(player_name)
|
||||||
if player then
|
if player then
|
||||||
player:hud_remove(breath_bar)
|
player:hud_remove(breath_bar)
|
||||||
end
|
end
|
||||||
|
@ -74,7 +74,7 @@ local function get_formspec(data)
|
|||||||
"label[1.75,0;" .. data.worldspec.name .. "]"
|
"label[1.75,0;" .. data.worldspec.name .. "]"
|
||||||
|
|
||||||
if mod.is_modpack or mod.type == "game" then
|
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)
|
core.get_content_info(mod.path).description)
|
||||||
if info == "" then
|
if info == "" then
|
||||||
if mod.is_modpack then
|
if mod.is_modpack then
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
--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()
|
function create_store_dlg()
|
||||||
return messagebox("store",
|
return messagebox("store",
|
||||||
fgettext("ContentDB is not available when Minetest was compiled without cURL"))
|
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.
|
-- before the package list is ordered based on installed state.
|
||||||
local store = { packages = {}, packages_full = {}, packages_full_unordered = {} }
|
local store = { packages = {}, packages_full = {}, packages_full_unordered = {} }
|
||||||
|
|
||||||
local http = minetest.get_http_api()
|
local http = core.get_http_api()
|
||||||
|
|
||||||
-- Screenshot
|
-- Screenshot
|
||||||
local screenshot_dir = core.get_cache_path() .. DIR_DELIM .. "cdb"
|
local screenshot_dir = core.get_cache_path() .. DIR_DELIM .. "cdb"
|
||||||
@ -152,7 +152,7 @@ local function start_install(package)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function queue_download(package)
|
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
|
if number_downloading < max_concurrent_downloads then
|
||||||
start_install(package)
|
start_install(package)
|
||||||
else
|
else
|
||||||
@ -320,7 +320,7 @@ function install_dialog.get_formspec()
|
|||||||
selected_game_idx = i
|
selected_game_idx = i
|
||||||
end
|
end
|
||||||
|
|
||||||
games[i] = minetest.formspec_escape(games[i].name)
|
games[i] = core.formspec_escape(games[i].name)
|
||||||
end
|
end
|
||||||
|
|
||||||
local selected_game = pkgmgr.games[selected_game_idx]
|
local selected_game = pkgmgr.games[selected_game_idx]
|
||||||
@ -331,7 +331,7 @@ function install_dialog.get_formspec()
|
|||||||
local formatted_deps = {}
|
local formatted_deps = {}
|
||||||
for _, dep in pairs(install_dialog.dependencies) do
|
for _, dep in pairs(install_dialog.dependencies) do
|
||||||
formatted_deps[#formatted_deps + 1] = "#fff"
|
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
|
if dep.installed then
|
||||||
formatted_deps[#formatted_deps + 1] = "#ccf"
|
formatted_deps[#formatted_deps + 1] = "#ccf"
|
||||||
formatted_deps[#formatted_deps + 1] = fgettext("Already installed")
|
formatted_deps[#formatted_deps + 1] = fgettext("Already installed")
|
||||||
@ -402,7 +402,7 @@ function install_dialog.handle_submit(this, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if fields.will_install_deps ~= nil then
|
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
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ function store.load()
|
|||||||
end
|
end
|
||||||
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 })
|
local response = http.fetch_sync({ url = url, timeout = timeout })
|
||||||
if not response.succeeded then
|
if not response.succeeded then
|
||||||
return
|
return
|
||||||
@ -793,8 +793,8 @@ function store.get_formspec(dlgdata)
|
|||||||
-- title
|
-- title
|
||||||
formspec[#formspec + 1] = "label[1.875,0.1;"
|
formspec[#formspec + 1] = "label[1.875,0.1;"
|
||||||
formspec[#formspec + 1] = core.formspec_escape(
|
formspec[#formspec + 1] = core.formspec_escape(
|
||||||
minetest.colorize(mt_color_green, package.title) ..
|
core.colorize(mt_color_green, package.title) ..
|
||||||
minetest.colorize("#BFBFBF", " by " .. package.author))
|
core.colorize("#BFBFBF", " by " .. package.author))
|
||||||
formspec[#formspec + 1] = "]"
|
formspec[#formspec + 1] = "]"
|
||||||
|
|
||||||
-- buttons
|
-- buttons
|
||||||
|
@ -443,7 +443,7 @@ local function create_world_buttonhandler(this, fields)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if fields["mgv6_biomes"] then
|
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
|
for b=1, #mgv6_biomes do
|
||||||
if entry == mgv6_biomes[b][1] then
|
if entry == mgv6_biomes[b][1] then
|
||||||
local ftable = core.settings:get_flags("mgv6_spflags")
|
local ftable = core.settings:get_flags("mgv6_spflags")
|
||||||
|
@ -459,7 +459,7 @@ function pkgmgr.enable_mod(this, toset)
|
|||||||
if not toset then
|
if not toset then
|
||||||
-- Mod(s) were disabled, so no dependencies need to be enabled
|
-- Mod(s) were disabled, so no dependencies need to be enabled
|
||||||
table.sort(toggled_mods)
|
table.sort(toggled_mods)
|
||||||
minetest.log("info", "Following mods were disabled: " ..
|
core.log("info", "Following mods were disabled: " ..
|
||||||
table.concat(toggled_mods, ", "))
|
table.concat(toggled_mods, ", "))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -496,7 +496,7 @@ function pkgmgr.enable_mod(this, toset)
|
|||||||
enabled_mods[name] = true
|
enabled_mods[name] = true
|
||||||
local mod_to_enable = list[mod_ids[name]]
|
local mod_to_enable = list[mod_ids[name]]
|
||||||
if not mod_to_enable then
|
if not mod_to_enable then
|
||||||
minetest.log("warning", "Mod dependency \"" .. name ..
|
core.log("warning", "Mod dependency \"" .. name ..
|
||||||
"\" not found!")
|
"\" not found!")
|
||||||
else
|
else
|
||||||
if mod_to_enable.enabled == false then
|
if mod_to_enable.enabled == false then
|
||||||
@ -517,7 +517,7 @@ function pkgmgr.enable_mod(this, toset)
|
|||||||
|
|
||||||
-- Log the list of enabled mods
|
-- Log the list of enabled mods
|
||||||
table.sort(toggled_mods)
|
table.sort(toggled_mods)
|
||||||
minetest.log("info", "Following mods were enabled: " ..
|
core.log("info", "Following mods were enabled: " ..
|
||||||
table.concat(toggled_mods, ", "))
|
table.concat(toggled_mods, ", "))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user