1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Rename minetest.* to core.* in devtest

This commit is contained in:
Lars Müller 2024-10-28 15:57:54 +01:00 committed by GitHub
parent d849d51c2d
commit 88c7a54e08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 914 additions and 914 deletions

View file

@ -1,28 +1,28 @@
minetest.register_tool("testtools:privatizer", {
core.register_tool("testtools:privatizer", {
description = "Node Meta Privatizer".."\n"..
"Punch: Marks 'infotext' and 'formspec' meta fields of chest as private",
inventory_image = "testtools_privatizer.png",
groups = { testtool = 1, disable_repair = 1 },
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
local node = minetest.get_node(pointed_thing.under)
if minetest.get_item_group(node.name, "meta_is_privatizable") == 1 then
local node = core.get_node(pointed_thing.under)
if core.get_item_group(node.name, "meta_is_privatizable") == 1 then
local p = pointed_thing.under
minetest.log("action", "[testtools] Privatizer used at "..minetest.pos_to_string(p))
minetest.get_meta(p):mark_as_private({"infotext", "formspec"})
core.log("action", "[testtools] Privatizer used at "..core.pos_to_string(p))
core.get_meta(p):mark_as_private({"infotext", "formspec"})
if user and user:is_player() then
minetest.chat_send_player(user:get_player_name(), "Node metadata (infotext, formspec) set private!")
core.chat_send_player(user:get_player_name(), "Node metadata (infotext, formspec) set private!")
end
return
elseif node.name == "chest_of_everything:chest" then
if user and user:is_player() then
minetest.chat_send_player(user:get_player_name(), "Privatizer can't be used on the Chest of Everything. Use it on a normal chest.")
core.chat_send_player(user:get_player_name(), "Privatizer can't be used on the Chest of Everything. Use it on a normal chest.")
end
return
end
end
if user and user:is_player() then
minetest.chat_send_player(user:get_player_name(), "Privatizer can only be used on chest!")
core.chat_send_player(user:get_player_name(), "Privatizer can only be used on chest!")
end
end,
})