mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Luanti rename: builtin (#15324)
This commit is contained in:
parent
409e75b94d
commit
ad4b13a0e9
69 changed files with 77 additions and 112 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue