Luanti rename: builtin (#15324)

This commit is contained in:
Wuzzy 2024-10-28 19:40:18 +01:00 committed by GitHub
parent 409e75b94d
commit ad4b13a0e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
69 changed files with 77 additions and 112 deletions

@ -1,5 +1,3 @@
-- Minetest: builtin/client/chatcommands.lua
core.register_on_sending_chat_message(function(message)
if message:sub(1,2) == ".." then
return false

@ -1,4 +1,3 @@
-- Minetest: builtin/client/init.lua
local scriptpath = core.get_builtin_path()
local clientpath = scriptpath.."client"..DIR_DELIM
local commonpath = scriptpath.."common"..DIR_DELIM

@ -155,7 +155,7 @@ end
function core.after(after, func, ...)
assert(tonumber(after) and not core.is_nan(after) and type(func) == "function",
"Invalid minetest.after invocation")
"Invalid core.after invocation")
local new_job = {
mod_origin = core.get_last_run_mod(),

@ -1,5 +1,3 @@
-- Minetest: builtin/common/chatcommands.lua
-- For server-side translations (if INIT == "game")
-- Otherwise, use core.gettext
local S = core.get_translator("__builtin")

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,3 @@
-- Minetest: builtin/item_s.lua
-- The distinction of what goes here is a bit tricky, basically it's everything
-- that does not (directly or indirectly) need access to ServerEnvironment,
-- Server or writable access to IGameDef on the engine side.

@ -11,8 +11,8 @@ end
core.known_metatables = known_metatables
function core.register_async_metatable(...)
core.log("deprecated", "minetest.register_async_metatable is deprecated. " ..
"Use minetest.register_portable_metatable instead.")
core.log("deprecated", "core.register_async_metatable is deprecated. " ..
"Use core.register_portable_metatable instead.")
return core.register_portable_metatable(...)
end

@ -1,5 +1,3 @@
-- Minetest: builtin/misc_helpers.lua
--------------------------------------------------------------------------------
-- Localize functions to avoid table lookups (better performance).
local string_sub, string_find = string.sub, string.find

@ -204,18 +204,18 @@ local function dummy_func() end
function core.deserialize(str, safe)
-- Backwards compatibility
if str == nil then
core.log("deprecated", "minetest.deserialize called with nil (expected string).")
core.log("deprecated", "core.deserialize called with nil (expected string).")
return nil, "Invalid type: Expected a string, got nil"
end
local t = type(str)
if t ~= "string" then
error(("minetest.deserialize called with %s (expected string)."):format(t))
error(("core.deserialize called with %s (expected string)."):format(t))
end
local func, err = loadstring(str)
if not func then return nil, err end
-- math.huge was serialized to inf and NaNs to nan by Lua in Minetest 5.6, so we have to support this here
-- math.huge was serialized to inf and NaNs to nan by Lua in engine version 5.6, so we have to support this here
local env = {inf = math_huge, nan = 0/0}
if safe then
env.loadstring = dummy_func

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--Copyright (C) 2023 Gregor Parzefall
--

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -10,7 +10,7 @@ end
function core.handle_async(func, callback, ...)
assert(type(func) == "function" and type(callback) == "function",
"Invalid minetest.handle_async invocation")
"Invalid core.handle_async invocation")
local args = {n = select("#", ...), ...}
local mod_origin = core.get_last_run_mod()

@ -1,5 +1,3 @@
-- Minetest: builtin/auth.lua
--
-- Builtin authentication handler
--
@ -95,11 +93,11 @@ core.builtin_auth_handler = {
for priv, value in pairs(privileges) do
-- Warnings for improper API usage
if value == false then
core.log('deprecated', "`false` value given to `minetest.set_player_privs`, "..
core.log('deprecated', "`false` value given to `core.set_player_privs`, "..
"this is almost certainly a bug, "..
"granting a privilege rather than revoking it")
elseif value ~= true then
core.log('deprecated', "non-`true` value given to `minetest.set_player_privs`")
core.log('deprecated', "non-`true` value given to `core.set_player_privs`")
end
-- Run grant callbacks
if prev_privs[priv] == nil then
@ -196,7 +194,7 @@ function core.change_player_privs(name, changes)
elseif change == false then
privs[priv] = nil
else
error("non-bool value given to `minetest.change_player_privs`")
error("non-bool value given to `core.change_player_privs`")
end
end
core.set_player_privs(name, privs)

@ -1,5 +1,3 @@
-- Minetest: builtin/game/chat.lua
local S = core.get_translator("__builtin")
-- Helper function that implements search and replace without pattern matching

@ -1,5 +1,3 @@
-- Minetest: builtin/constants.lua
--
-- Constants values for use with the Lua API
--

@ -1,5 +1,3 @@
-- Minetest: builtin/deprecated.lua
--
-- EnvRef
--
@ -35,9 +33,9 @@ local settings = core.settings
local function setting_proxy(name)
return function(...)
core.log("deprecated", "WARNING: minetest.setting_* "..
core.log("deprecated", "WARNING: core.setting_* "..
"functions are deprecated. "..
"Use methods on the minetest.settings object.")
"Use methods on the core.settings object.")
return settings[name](settings, ...)
end
end

@ -1,5 +1,3 @@
-- Minetest: builtin/detached_inventory.lua
core.detached_inventories = {}
local create_detached_inventory_raw = core.create_detached_inventory_raw

@ -1,5 +1,3 @@
-- Minetest: builtin/item.lua
local builtin_shared = ...
local SCALE = 0.667

@ -1,5 +1,3 @@
-- Minetest: builtin/features.lua
core.features = {
glasslike_framed = true,
nodebox_as_selectionbox = true,

@ -1,5 +1,3 @@
-- Minetest: builtin/item.lua
local builtin_shared = ...
local function copy_pointed_thing(pointed_thing)

@ -1,5 +1,3 @@
-- Minetest: builtin/item_entity.lua
function core.spawn_item(pos, item)
-- Take item in any format
local stack = ItemStack(item)

@ -1,5 +1,3 @@
-- Minetest: builtin/misc.lua
local S = core.get_translator("__builtin")
--

@ -1,4 +1,3 @@
-- Minetest: builtin/misc_s.lua
-- The distinction of what goes here is a bit tricky, basically it's everything
-- that does not (directly or indirectly) need access to ServerEnvironment,
-- Server or writable access to IGameDef on the engine side.

@ -1,5 +1,3 @@
-- Minetest: builtin/privileges.lua
local S = core.get_translator("__builtin")
--

@ -1,5 +1,3 @@
-- Minetest: builtin/register.lua
local builtin_shared = ...
local S = core.get_translator("__builtin")

@ -1,5 +1,3 @@
-- Minetest: builtin/static_spawn.lua
local static_spawnpoint_string = core.settings:get("static_spawnpoint")
if static_spawnpoint_string and
static_spawnpoint_string ~= "" and

@ -35,7 +35,7 @@ end
local log = function(...) end
--local log = print
minetest.register_allow_player_inventory_action(function(_, action, inv, info)
core.register_allow_player_inventory_action(function(_, action, inv, info)
log("\tallow " .. action, info.count or info.stack:to_string())
if action == "move" then
@ -69,7 +69,7 @@ minetest.register_allow_player_inventory_action(function(_, action, inv, info)
return -- Unlimited
end)
minetest.register_on_player_inventory_action(function(_, action, inv, info)
core.register_on_player_inventory_action(function(_, action, inv, info)
log("\ton " .. action, info.count or info.stack:to_string())
if action == "take" or action == "put" then

@ -1,5 +1,5 @@
--
-- This file contains built-in stuff in Minetest implemented in Lua.
-- This file contains built-in stuff in Luanti implemented in Lua.
--
-- It is always loaded and executed after registration of the C API,
-- before loading and running any mods.

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2018-24 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2018-20 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
@ -487,7 +487,7 @@ end
local function handle_events(event)
if event == "DialogShow" then
-- Don't show the "MINETEST" header behind the dialog.
-- Don't show the header image behind the dialog.
mm_game_theme.set_engine(true)
-- If ContentDB is already loaded, auto-install packages here.

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2018-24 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2018-24 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2018-24 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2023 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify
@ -840,7 +840,7 @@ function pkgmgr.get_contentdb_id(content)
return content.author:lower() .. "/" .. content.name
end
-- Until Minetest 5.8.0, Minetest Game was bundled with Minetest.
-- Until version 5.8.0, Minetest Game was bundled with the engine.
-- Unfortunately, the bundled MTG was not versioned (missing "release"
-- field in game.conf).
-- Therefore, we consider any installation of MTG that is not versioned,

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2023-24 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
@ -40,7 +40,7 @@ function get_screenshot(package, screenshot_url, level)
return defaulttexturedir .. "no_screenshot.png"
end
-- Minetest only supports png and jpg
-- Luanti only supports png and jpg
local ext = get_file_extension(screenshot_url)
if ext ~= "png" and ext ~= "jpg" then
screenshot_url = screenshot_url:sub(0, -#ext - 1) .. "png"

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2023 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2023 Gregor Parzefall
--
--This program is free software; you can redistribute it and/or modify
@ -68,15 +68,15 @@ end
local function get_formspec(dialogdata)
local markup = table.concat({
"<big>", fgettext("Minetest Game is no longer installed by default"), "</big>\n",
fgettext("For a long time, the Minetest engine shipped with a default game called \"Minetest Game\". " ..
"Since Minetest 5.8.0, Minetest ships without a default game."), "\n",
fgettext("For a long time, Luanti shipped with a default game called \"Minetest Game\". " ..
"Since version 5.8.0, Luanti ships without a default game."), "\n",
fgettext("If you want to continue playing in your Minetest Game worlds, you need to reinstall Minetest Game."),
})
return table.concat({
"formspec_version[6]",
"size[12.8,7]",
"hypertext[0.375,0.375;12.05,5.2;text;", minetest.formspec_escape(markup), "]",
"hypertext[0.375,0.375;12.05,5.2;text;", core.formspec_escape(markup), "]",
"container[0.375,5.825]",
"style[dismiss;bgcolor=red]",
"button[0,0;4,0.8;dismiss;", fgettext("Dismiss"), "]",
@ -114,7 +114,7 @@ local function eventhandler(event)
return true
elseif event == "MenuQuit" then
-- Don't allow closing the dialog with ESC, but still allow exiting
-- Minetest.
-- Luanti
core.close()
return true
end

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,5 +1,5 @@
--[[
Minetest
Luanti
Copyright (C) 2018-2020 SmallJoker, 2022 rubenwardy
This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2020 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2015 PilzAdam
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
@ -743,7 +743,7 @@ end
local function eventhandler(event)
if event == "DialogShow" then
-- Don't show the "MINETEST" header behind the dialog.
-- Don't show the header image behind the dialog.
mm_game_theme.set_engine(true)
return true
end

@ -13,7 +13,7 @@ local minetest_example_header = [[
# ../minetest.conf
# ../../minetest.conf
# Any other path can be chosen by passing the path as a parameter
# to the program, eg. "minetest.exe --config ../minetest.conf.example".
# to the program, eg. "luanti.exe --config ../minetest.conf.example".
# Further documentation:
# https://wiki.minetest.net/

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2015 PilzAdam
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
-- Minetest
-- Luanti
-- SPDX-License-Identifier: LGPL-2.1-or-later
return {

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2021-2 x2048
--Copyright (C) 2022-3 rubenwardy
--

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2013 sapier
--
--This program is free software; you can redistribute it and/or modify
@ -79,7 +79,7 @@ return {
"button[0.1,3.4;5.3,0.5;label_button;" ..
core.formspec_escape(version.project .. " " .. version.string) .. "]" ..
"button_url[1.5,4.1;2.5,0.8;homepage;luanti.org;https://www.luanti.org/]" ..
"hypertext[5.5,0.25;9.75,6.6;credits;" .. minetest.formspec_escape(hypertext) .. "]"
"hypertext[5.5,0.25;9.75,6.6;credits;" .. core.formspec_escape(hypertext) .. "]"
-- Render information
local active_renderer_info = fgettext("Active renderer:") .. " " ..

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--Copyright (C) 2018 rubenwardy <rw@rubenwardy.com>
--

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2014 sapier
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2016 T4im
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2016 T4im
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2016 T4im
--
--This program is free software; you can redistribute it and/or modify

@ -1,4 +1,4 @@
--Minetest
--Luanti
--Copyright (C) 2016 T4im
--
--This program is free software; you can redistribute it and/or modify

@ -199,7 +199,7 @@ virtual_joystick_triggers_aux1 (Virtual joystick triggers Aux1 button) bool fals
# Easy to use and well-known from other games that shall not be named.
#
# * long_tap
# Known from the classic Minetest mobile controls.
# Known from the classic Luanti mobile controls.
# Combat is more or less impossible.
#
# Requires: touchscreen
@ -764,7 +764,7 @@ chat_font_size (Chat font size) int 0 0 72
# The URL for the content repository
contentdb_url (ContentDB URL) string https://content.minetest.net
# If enabled and you have ContentDB packages installed, Minetest may contact ContentDB to
# If enabled and you have ContentDB packages installed, Luanti may contact ContentDB to
# check for package updates when opening the mainmenu.
contentdb_enable_updates_indicator (Enable updates available indicator on content tab) bool true
@ -772,7 +772,7 @@ contentdb_enable_updates_indicator (Enable updates available indicator on conten
# "nonfree" can be used to hide packages which do not qualify as 'free software',
# as defined by the Free Software Foundation.
# You can also specify content ratings.
# These flags are independent from Minetest versions,
# These flags are independent from Luanti versions,
# so see a full list at https://content.minetest.net/help/content_flags/
contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default
@ -795,7 +795,7 @@ serverlist_url (Serverlist URL) string servers.minetest.net
# If disabled, new accounts will be registered automatically when logging in.
enable_split_login_register (Enable split login/register) bool true
# URL to JSON file which provides information about the newest Minetest release.
# URL to JSON file which provides information about the newest Luanti release.
# If this is empty the engine will never check for updates.
update_information_url (Update information URL) string https://www.minetest.net/release_info.json
@ -809,7 +809,7 @@ name (Admin name) string
[**Serverlist and MOTD]
# Name of the server, to be displayed when players join and in the serverlist.
server_name (Server name) string Minetest server
server_name (Server name) string Luanti server
# Description of server, to be displayed when players join and in the serverlist.
server_description (Server description) string mine here
@ -856,7 +856,7 @@ strict_protocol_version_checking (Strict protocol checking) bool false
# Older clients are compatible in the sense that they will not crash when connecting
# to new servers, but they may not support all new features that you are expecting.
# This allows for more fine-grained control than strict_protocol_version_checking.
# Minetest still enforces its own internal minimum, and enabling
# Luanti still enforces its own internal minimum, and enabling
# strict_protocol_version_checking will effectively override this.
protocol_version_min (Protocol version minimum) int 1 1 65535
@ -1805,7 +1805,7 @@ instrument.lbm (Loading Block Modifiers) bool true
instrument.chatcommand (Chat commands) bool true
# Instrument global callback functions on registration.
# (anything you pass to a minetest.register_*() function)
# (anything you pass to a core.register_*() function)
instrument.global_callback (Global callbacks) bool true
# Instrument builtin.
@ -1873,7 +1873,7 @@ enable_mesh_cache (Mesh cache) bool false
mesh_generation_interval (Mapblock mesh generation delay) int 0 0 50
# Number of threads to use for mesh generation.
# Value of 0 (default) will let Minetest autodetect the number of available threads.
# Value of 0 (default) will let Luanti autodetect the number of available threads.
mesh_generation_threads (Mapblock mesh generation threads) int 0 0 8
# True = 256
@ -2007,7 +2007,7 @@ lighting_boost_spread (Light curve boost spread) float 0.2 0.0 0.4
[**Networking]
# Prometheus listener address.
# If Minetest is compiled with ENABLE_PROMETHEUS option enabled,
# If Luanti is compiled with ENABLE_PROMETHEUS option enabled,
# enable metrics listener for Prometheus on that address.
# Metrics can be fetched on http://127.0.0.1:30000/metrics
prometheus_listener_address (Prometheus listener address) string 127.0.0.1:30000
@ -2214,7 +2214,7 @@ curl_file_download_timeout (cURL file download timeout) int 300000 5000 21474836
# Adjust the detected display density, used for scaling UI elements.
display_density_factor (Display Density Scaling Factor) float 1 0.5 5.0
# Windows systems only: Start Minetest with the command line window in the background.
# Windows systems only: Start Luanti with the command line window in the background.
# Contains the same information as the file debug.txt (default name).
enable_console (Enable console window) bool false