big_wifi_chest/init.lua

52 lines
1.8 KiB
Lua
Raw Normal View History

2019-11-11 05:48:36 -08:00
minetest.register_node("big_wifi_chest:big_wifi_chest", {
description = "Big Wifi Chest",
tiles = {"wifi_top.png", "wifi_top.png", "wifi_side.png",
"wifi_side.png", "wifi_side.png", "wifi_front.png"},
paramtype2 = "facedir",
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2,},
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
2019-11-11 05:52:32 -08:00
"size[16,13]"..
2019-11-11 05:48:36 -08:00
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
2019-11-11 05:52:32 -08:00
"list[current_player;big_wifi_chest:big_wifi_chest;0,0.3;16,8;]"..
2019-12-02 02:26:45 -08:00
"list[current_player;main;4,8.85;8,1;]" ..
2019-11-11 05:52:32 -08:00
"list[current_player;main;4,10.08;8,3;8]" ..
"listring[current_player;big_wifi_chest:big_wifi_chest]" ..
2019-11-11 05:48:36 -08:00
"listring[current_player;main]" ..
2019-11-11 05:52:32 -08:00
default.get_hotbar_bg(0,8.85))
2019-11-11 05:48:36 -08:00
meta:set_string("infotext", "Big Wifi Chest")
end,
on_metadata_inventory_move = function(pos, _, _, _, _, _, player)
minetest.log("action", player:get_player_name()..
2019-11-11 05:52:32 -08:00
" moves stuff in big wifi chest at "..minetest.pos_to_string(pos))
2019-11-11 05:48:36 -08:00
end,
on_metadata_inventory_put = function(pos, _, _, _, player)
minetest.log("action", player:get_player_name()..
2019-11-11 05:52:32 -08:00
" moves stuff to big wifi chest at "..minetest.pos_to_string(pos))
2019-11-11 05:48:36 -08:00
end,
on_metadata_inventory_take = function(pos, _, _, _, player)
minetest.log("action", player:get_player_name()..
2019-11-11 05:52:32 -08:00
" takes stuff from big wifi chest at "..minetest.pos_to_string(pos))
2019-11-11 05:48:36 -08:00
end,
})
minetest.register_craft({
2019-11-11 05:52:32 -08:00
output = 'big_wifi_chest:big_wifi_chest',
2019-11-11 05:48:36 -08:00
recipe = {
2019-11-11 05:52:32 -08:00
{'default:mese','default:mese','default:mese'},
2019-11-11 05:48:36 -08:00
{'default:wood','default:steel_ingot','default:wood'},
2019-11-11 05:52:32 -08:00
{'default:mese','default:mese','default:mese'}
2019-11-11 05:48:36 -08:00
}
})
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
2019-11-11 05:52:32 -08:00
inv:set_size("big_wifi_chest:big_wifi_chest", 16*8)
2019-11-11 05:48:36 -08:00
end)