more_chests/wifi.lua
Megaf eb750bd15f Changes to be committed:
new file:   cobble.lua
	new file:   depends.txt
	new file:   dropbox.lua
	new file:   init.lua
	new file:   secret.lua
	new file:   shared.lua
	new file:   textures/chests.0gb.us_dropbox_front.png
	new file:   textures/chests.0gb.us_dropbox_right.png
	new file:   textures/chests.0gb.us_secret_front.png
	new file:   textures/chests.0gb.us_shared_front.png
	new file:   textures/chests.0gb.us_wifi_front_animated.png
	new file:   textures/chests.0gb.us_wifi_side.png
	new file:   textures/chests.0gb.us_wifi_top.png
	new file:   wifi.lua
2014-06-11 01:37:20 -03:00

47 lines
1.7 KiB
Lua

minetest.register_node("more_chests:wifi", {
description = "Wifi Chest",
tiles = {"chests.0gb.us_wifi_top.png", "chests.0gb.us_wifi_top.png", "chests.0gb.us_wifi_side.png",
"chests.0gb.us_wifi_side.png", "chests.0gb.us_wifi_side.png",
{name="chests.0gb.us_wifi_front_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
},
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.env:get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_player;more_chests:wifi;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Wifi Chest")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in wifi chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to wifi chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from wifi chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_craft({
output = 'more_chests:wifi',
recipe = {
{'default:wood','default:mese','default:wood'},
{'default:wood','default:steel_ingot','default:wood'},
{'default:wood','default:wood','default:wood'}
}
})
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("more_chests:wifi", 8*4)
end)