1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +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,9 +1,9 @@
local function print_to_everything(msg)
minetest.log("action", "[chest] " .. msg)
minetest.chat_send_all(msg)
core.log("action", "[chest] " .. msg)
core.chat_send_all(msg)
end
minetest.register_node("chest:chest", {
core.register_node("chest:chest", {
description = "Chest" .. "\n" ..
"32 inventory slots",
tiles ={"chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:0,0",
@ -13,7 +13,7 @@ minetest.register_node("chest:chest", {
groups = {dig_immediate=2,choppy=3,meta_is_privatizable=1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
@ -24,7 +24,7 @@ minetest.register_node("chest:chest", {
inv:set_size("main", 8*4)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local meta = core.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,

View file

@ -2,12 +2,12 @@ local ALLOW_PUT_MAX = 1
local ALLOW_TAKE_MAX = 4
local function print_to_everything(msg)
minetest.log("action", "[chest] " .. msg)
minetest.chat_send_all(msg)
core.log("action", "[chest] " .. msg)
core.chat_send_all(msg)
end
-- Create a detached inventory
local inv = minetest.create_detached_inventory("detached_inventory", {
local inv = core.create_detached_inventory("detached_inventory", {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
print_to_everything("Detached inventory: "..player:get_player_name().." triggered allow_move")
return count -- Allow all
@ -34,7 +34,7 @@ inv:set_size("main", 8*3)
-- Add a special chest to grant access to this inventory
minetest.register_node("chest:detached_chest", {
core.register_node("chest:detached_chest", {
description = "Detached Chest" .. "\n" ..
"Grants access to a shared detached inventory" .."\n" ..
"Max. item put count: "..ALLOW_PUT_MAX .."\n"..
@ -46,7 +46,7 @@ minetest.register_node("chest:detached_chest", {
groups = {dig_immediate=2,choppy=3,meta_is_privatizable=1},
is_ground_content = false,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[detached:detached_inventory;main;0,0;8,3;0]"..

View file

@ -1,2 +1,2 @@
dofile(minetest.get_modpath("chest").."/chest.lua")
dofile(minetest.get_modpath("chest").."/detached.lua")
dofile(core.get_modpath("chest").."/chest.lua")
dofile(core.get_modpath("chest").."/detached.lua")