mirror of
https://github.com/HybridDog/connected_chests.git
synced 2024-11-17 11:20:17 +01:00
use the listring functionality (https://forum.minetest.net/viewtopic.php?f=18&t=12629)
This commit is contained in:
parent
971b5b3d13
commit
f14c6888d3
18
init.lua
18
init.lua
@ -2,17 +2,19 @@ local load_time_start = os.clock()
|
||||
|
||||
local creative_enabled = minetest.setting_getbool("creative_mode")
|
||||
|
||||
local big_formspec = "size[13,9]"..
|
||||
"list[current_name;main;0,0;13,5;]"..
|
||||
"list[current_player;main;2.5,5.2;8,4;]"..
|
||||
"listring[current_name;main]"..
|
||||
"listring[current_player;main]"
|
||||
|
||||
local chests = {
|
||||
["default:chest"] = function(pu, pa, par, stuff)
|
||||
minetest.add_node(pu, {name="connected_chests:chest_left", param2=par})
|
||||
minetest.add_node(pa, {name="connected_chests:chest_right", param2=par})
|
||||
|
||||
local meta = minetest.get_meta(pu)
|
||||
meta:set_string("formspec",
|
||||
"size[13,9]"..
|
||||
"list[current_name;main;0,0;13,5;]"..
|
||||
"list[current_player;main;2.5,5.2;8,4;]"
|
||||
)
|
||||
meta:set_string("formspec", big_formspec)
|
||||
meta:set_string("infotext", "Big Chest")
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size("main", 65)
|
||||
@ -25,11 +27,7 @@ local chests = {
|
||||
|
||||
local meta = minetest.get_meta(pu)
|
||||
meta:set_string("owner", owner)
|
||||
meta:set_string("formspec",
|
||||
"size[13,9]"..
|
||||
"list[current_name;main;0,0;13,5;]"..
|
||||
"list[current_player;main;2.5,5.2;8,4;]"
|
||||
)
|
||||
meta:set_string("formspec", big_formspec)
|
||||
meta:set_string("infotext", "Big Locked Chest (owned by "..
|
||||
meta:get_string("owner")..")")
|
||||
local inv = meta:get_inventory()
|
||||
|
Loading…
Reference in New Issue
Block a user