forked from mtcontrib/chesttools
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
07fcfe2342
7
init.lua
7
init.lua
@ -117,14 +117,14 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
local meta = minetest.get_meta( pos );
|
local meta = minetest.get_meta( pos );
|
||||||
local chestname = meta:get_string( 'chestname' );
|
local chestname = meta:get_string( 'chestname' );
|
||||||
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
||||||
chesttools.formspec = chesttools.formspec ..
|
|
||||||
"listring[nodemeta:" .. spos .. ";main]"
|
|
||||||
if( fields.set_chestname and fields.chestname ) then
|
if( fields.set_chestname and fields.chestname ) then
|
||||||
chestname = tostring( fields.chestname );
|
chestname = tostring( fields.chestname );
|
||||||
meta:set_string( 'chestname', chestname );
|
meta:set_string( 'chestname', chestname );
|
||||||
meta:set_string("infotext", "\""..chestname.."\" Chest (owned by "..meta:get_string("owner")..")")
|
meta:set_string("infotext", "\""..chestname.."\" Chest (owned by "..meta:get_string("owner")..")")
|
||||||
-- update the normal formspec
|
-- update the normal formspec
|
||||||
meta:set_string("formspec", chesttools.formspec..
|
meta:set_string("formspec", chesttools.formspec..
|
||||||
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
"field[1.8,10.0;6,0.5;chestname;;"..chestname.."]");
|
"field[1.8,10.0;6,0.5;chestname;;"..chestname.."]");
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -465,7 +465,8 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
meta:set_string("formspec", chesttools.formspec..
|
meta:set_string("formspec", chesttools.formspec..
|
||||||
"list[current_player;main;0.5,5.5;8,4;]");
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
|
Loading…
Reference in New Issue
Block a user