This commit is contained in:
Elias Fleckenstein
2021-03-26 14:00:57 +01:00
233 changed files with 51190 additions and 67341 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -665,7 +665,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

View File

@@ -42,5 +42,5 @@ core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool
return -- barely noticeable, so don't even send
end
player:add_player_velocity(kdir)
player:add_velocity(kdir)
end)

View File

@@ -1,5 +1,7 @@
-- Minetest: builtin/misc.lua
local S = core.get_translator("__builtin")
--
-- Misc. API functions
--
@@ -42,15 +44,15 @@ end
function core.send_join_message(player_name)
if not core.is_singleplayer() then
core.chat_send_all("*** " .. player_name .. " joined the game.")
core.chat_send_all("*** " .. S("@1 joined the game.", player_name))
end
end
function core.send_leave_message(player_name, timed_out)
local announcement = "*** " .. player_name .. " left the game."
local announcement = "*** " .. S("@1 left the game.", player_name)
if timed_out then
announcement = announcement .. " (timed out)"
announcement = "*** " .. S("@1 left the game (timed out).", player_name)
end
core.chat_send_all(announcement)
end

View File

@@ -1,5 +1,7 @@
-- Minetest: builtin/privileges.lua
local S = core.get_translator("__builtin")
--
-- Privileges
--
@@ -15,7 +17,7 @@ function core.register_privilege(name, param)
def.give_to_admin = def.give_to_singleplayer
end
if def.description == nil then
def.description = "(no description)"
def.description = S("(no description)")
end
end
local def
@@ -28,69 +30,69 @@ function core.register_privilege(name, param)
core.registered_privileges[name] = def
end
core.register_privilege("interact", "Can interact with things and modify the world")
core.register_privilege("shout", "Can speak in chat")
core.register_privilege("basic_privs", "Can modify 'shout' and 'interact' privileges")
core.register_privilege("privs", "Can modify privileges")
core.register_privilege("interact", S("Can interact with things and modify the world"))
core.register_privilege("shout", S("Can speak in chat"))
core.register_privilege("basic_privs", S("Can modify 'shout' and 'interact' privileges"))
core.register_privilege("privs", S("Can modify privileges"))
core.register_privilege("teleport", {
description = "Can teleport self",
description = S("Can teleport self"),
give_to_singleplayer = false,
})
core.register_privilege("bring", {
description = "Can teleport other players",
description = S("Can teleport other players"),
give_to_singleplayer = false,
})
core.register_privilege("settime", {
description = "Can set the time of day using /time",
description = S("Can set the time of day using /time"),
give_to_singleplayer = false,
})
core.register_privilege("server", {
description = "Can do server maintenance stuff",
description = S("Can do server maintenance stuff"),
give_to_singleplayer = false,
give_to_admin = true,
})
core.register_privilege("protection_bypass", {
description = "Can bypass node protection in the world",
description = S("Can bypass node protection in the world"),
give_to_singleplayer = false,
})
core.register_privilege("ban", {
description = "Can ban and unban players",
description = S("Can ban and unban players"),
give_to_singleplayer = false,
give_to_admin = true,
})
core.register_privilege("kick", {
description = "Can kick players",
description = S("Can kick players"),
give_to_singleplayer = false,
give_to_admin = true,
})
core.register_privilege("give", {
description = "Can use /give and /giveme",
description = S("Can use /give and /giveme"),
give_to_singleplayer = false,
})
core.register_privilege("password", {
description = "Can use /setpassword and /clearpassword",
description = S("Can use /setpassword and /clearpassword"),
give_to_singleplayer = false,
give_to_admin = true,
})
core.register_privilege("fly", {
description = "Can use fly mode",
description = S("Can use fly mode"),
give_to_singleplayer = false,
})
core.register_privilege("fast", {
description = "Can use fast mode",
description = S("Can use fast mode"),
give_to_singleplayer = false,
})
core.register_privilege("noclip", {
description = "Can fly through solid nodes using noclip mode",
description = S("Can fly through solid nodes using noclip mode"),
give_to_singleplayer = false,
})
core.register_privilege("rollback", {
description = "Can use the rollback functionality",
description = S("Can use the rollback functionality"),
give_to_singleplayer = false,
})
core.register_privilege("debug", {
description = "Allows enabling various debug options that may affect gameplay",
description = S("Allows enabling various debug options that may affect gameplay"),
give_to_singleplayer = false,
give_to_admin = true,
})

View File

@@ -1,5 +1,7 @@
-- Minetest: builtin/misc_register.lua
local S = core.get_translator("__builtin")
--
-- Make raw registration functions inaccessible to anyone except this file
--
@@ -118,10 +120,6 @@ function core.register_item(name, itemdef)
end
itemdef.name = name
-- default short_description to first line of description
itemdef.short_description = itemdef.short_description or
(itemdef.description or ""):gsub("\n.*","")
-- Apply defaults and add to registered_* table
if itemdef.type == "node" then
-- Use the nodebox as selection box if it's not set manually
@@ -330,7 +328,7 @@ end
core.register_item(":unknown", {
type = "none",
description = "Unknown Item",
description = S("Unknown Item"),
inventory_image = "unknown_item.png",
on_place = core.item_place,
on_secondary_use = core.item_secondary_use,
@@ -340,7 +338,7 @@ core.register_item(":unknown", {
})
core.register_node(":air", {
description = "Air",
description = S("Air"),
inventory_image = "air.png",
wield_image = "air.png",
drawtype = "airlike",
@@ -357,7 +355,7 @@ core.register_node(":air", {
})
core.register_node(":ignore", {
description = "Ignore",
description = S("Ignore"),
inventory_image = "ignore.png",
wield_image = "ignore.png",
drawtype = "airlike",
@@ -370,11 +368,12 @@ core.register_node(":ignore", {
air_equivalent = true,
drop = "",
groups = {not_in_creative_inventory=1},
node_placement_prediction = "",
on_place = function(itemstack, placer, pointed_thing)
core.chat_send_player(
placer:get_player_name(),
core.colorize("#FF0000",
"You can't place 'ignore' nodes!"))
S("You can't place 'ignore' nodes!")))
return ""
end,
})

View File

@@ -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