Compare commits
15 Commits
nalc-1.2.0
...
master
Author | SHA1 | Date | |
---|---|---|---|
435b8cdda5 | |||
543144c693 | |||
7d32cb06c7 | |||
054b9e62a2 | |||
470774008a | |||
9289a1ae9d | |||
eefeb09d8a | |||
80d4ce0d84 | |||
81b601b374 | |||
d335f5cf03 | |||
c851ab7e16 | |||
6d2bfe336a | |||
a532518d61 | |||
d1093fe448 | |||
31366d3fc9 |
165
init.lua
@ -18,6 +18,7 @@ chesttools.update_price = {
|
|||||||
{'default:chest', 'default:steel_ingot', 0, 'normal', 1, 'nothing'},
|
{'default:chest', 'default:steel_ingot', 0, 'normal', 1, 'nothing'},
|
||||||
{'default:chest_locked', 'default:steel_ingot', 1, 'locked', 2, 'steel ingot'},
|
{'default:chest_locked', 'default:steel_ingot', 1, 'locked', 2, 'steel ingot'},
|
||||||
{'chesttools:shared_chest', 'default:steel_ingot', 2, 'shared', 3, 'steel ingot(s)'},
|
{'chesttools:shared_chest', 'default:steel_ingot', 2, 'shared', 3, 'steel ingot(s)'},
|
||||||
|
{'chesttools:shared_chest_wall', 'default:steel_ingot', 2, 'shared', 3, 'steel ingot(s)'},
|
||||||
{'locks:shared_locked_chest', 'default:steel_ingot', 3, 'locks', 4, 'steel ingot(s)'},
|
{'locks:shared_locked_chest', 'default:steel_ingot', 3, 'locks', 4, 'steel ingot(s)'},
|
||||||
{'technic:iron_chest', 'technic:iron_chest', 1, 'iron', 5, 'Iron chest'},
|
{'technic:iron_chest', 'technic:iron_chest', 1, 'iron', 5, 'Iron chest'},
|
||||||
{'technic:iron_locked_chest', 'technic:iron_locked_chest', 1, 'iron_locked', 6, 'Iron locked chest'},
|
{'technic:iron_locked_chest', 'technic:iron_locked_chest', 1, 'iron_locked', 6, 'Iron locked chest'},
|
||||||
@ -33,22 +34,25 @@ chesttools.update_price = {
|
|||||||
|
|
||||||
chesttools.chest_add = {};
|
chesttools.chest_add = {};
|
||||||
chesttools.chest_add.tiles = {
|
chesttools.chest_add.tiles = {
|
||||||
"chesttools_blue_chest_top.png", "chesttools_blue_chest_top.png", "chesttools_blue_chest_side.png",
|
-- "chesttools_blue_chest_top.png", "chesttools_blue_chest_top.png", "chesttools_blue_chest_side.png",
|
||||||
"chesttools_blue_chest_side.png", "chesttools_blue_chest_side.png", "chesttools_blue_chest_lock.png"};
|
-- "chesttools_blue_chest_side.png", "chesttools_blue_chest_side.png", "chesttools_blue_chest_lock.png"};
|
||||||
|
"chesttools_white_chest_top.png", "chesttools_white_chest_top.png", "chesttools_white_chest_side.png",
|
||||||
|
"chesttools_white_chest_side.png", "chesttools_white_chest_side.png", "chesttools_white_chest_lock.png"};
|
||||||
chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2};
|
chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2};
|
||||||
chesttools.chest_add.tube = {};
|
chesttools.chest_add.tube = {};
|
||||||
|
|
||||||
|
|
||||||
-- additional/changed definitions for pipeworks;
|
-- additional/changed definitions for pipeworks;
|
||||||
-- taken from pipeworks/compat.lua
|
-- taken from pipeworks/compat.lua
|
||||||
if( minetest.get_modpath( 'pipeworks' )) then
|
local has_pipeworks = minetest.get_modpath( 'pipeworks' )
|
||||||
|
if( has_pipeworks ) then
|
||||||
chesttools.chest_add.tiles = {
|
chesttools.chest_add.tiles = {
|
||||||
"chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png",
|
chesttools.chest_add.tiles[1].."^pipeworks_tube_connection_wooden.png",
|
||||||
"chesttools_blue_chest_top.png^pipeworks_tube_connection_wooden.png",
|
chesttools.chest_add.tiles[1].."^pipeworks_tube_connection_wooden.png",
|
||||||
"chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png",
|
chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png",
|
||||||
"chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png",
|
chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png",
|
||||||
"chesttools_blue_chest_side.png^pipeworks_tube_connection_wooden.png",
|
chesttools.chest_add.tiles[3].."^pipeworks_tube_connection_wooden.png",
|
||||||
"chesttools_blue_chest_lock.png"};
|
chesttools.chest_add.tiles[6]};
|
||||||
chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,
|
chesttools.chest_add.groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2,
|
||||||
tubedevice = 1, tubedevice_receiver = 1 };
|
tubedevice = 1, tubedevice_receiver = 1 };
|
||||||
chesttools.chest_add.tube = {
|
chesttools.chest_add.tube = {
|
||||||
@ -69,9 +73,11 @@ end
|
|||||||
|
|
||||||
chesttools.formspec = "size[9,10]"..
|
chesttools.formspec = "size[9,10]"..
|
||||||
"list[current_name;main;0.5,0.3;8,4;]"..
|
"list[current_name;main;0.5,0.3;8,4;]"..
|
||||||
"label[0.0,9.7;Title/Content:]"..
|
"label[0.5,9.7;Name:]"..
|
||||||
"field[1.8,10.0;6,0.5;chestname;;]"..
|
"field[1.8,10.0;6,0.5;chestname;;]"..
|
||||||
"button[7.5,9.7;1,0.5;set_chestname;Store]"..
|
"button[7.5,9.7;1,0.5;set_chestname;Store\nName]"..
|
||||||
|
-- "button[8.6,9.7;0.5,0.5;change_color;C]"..
|
||||||
|
"image_button[8.4,9.7;0.5,0.5;chesttools_palette.png;change_color;]"..
|
||||||
"label[0.0,4.4;Main]"..
|
"label[0.0,4.4;Main]"..
|
||||||
"button[1.0,4.5;1,0.5;craft;Craft]"..
|
"button[1.0,4.5;1,0.5;craft;Craft]"..
|
||||||
"button[7.0,4.5;0.5,0.5;drop_all;DA]"..
|
"button[7.0,4.5;0.5,0.5;drop_all;DA]"..
|
||||||
@ -90,11 +96,14 @@ end
|
|||||||
|
|
||||||
|
|
||||||
chesttools.may_use = function( pos, player )
|
chesttools.may_use = function( pos, player )
|
||||||
if( not( player )) then
|
if not (pos and player and player.is_player and player:is_player() and not player.is_fake_player) then
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
local name = player:get_player_name();
|
local name = player:get_player_name();
|
||||||
local meta = minetest.get_meta( pos );
|
local meta = minetest.get_meta( pos );
|
||||||
|
if(not(meta)) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
local owner = meta:get_string( 'owner' )
|
local owner = meta:get_string( 'owner' )
|
||||||
-- the owner can access the chest
|
-- the owner can access the chest
|
||||||
if( owner == name or owner == "" ) then
|
if( owner == name or owner == "" ) then
|
||||||
@ -114,26 +123,46 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if( fields.change_color ) then
|
||||||
|
local node = minetest.get_node( pos )
|
||||||
|
local add = 0
|
||||||
|
if(node and node.name and minetest.registered_nodes[node.name]) then
|
||||||
|
local def = minetest.registered_nodes[node.name]
|
||||||
|
if(def and def.paramtype2 == "colorfacedir") then
|
||||||
|
add = 32
|
||||||
|
elseif(def and def.paramtype2 == "colorwallmounted") then
|
||||||
|
add = 8
|
||||||
|
end
|
||||||
|
minetest.swap_node(pos, {name=node.name, param2=(node.param2 + add) % 256})
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local meta = minetest.get_meta( pos );
|
local meta = minetest.get_meta( pos );
|
||||||
local chestname = meta:get_string( 'chestname' );
|
local chestname = meta:get_string( 'chestname' );
|
||||||
if( fields.set_chestname and fields.chestname ) then
|
local spos = pos.x .. "," .. pos.y .. "," .. pos.z
|
||||||
|
if( fields.set_chestname and fields.chestname and fields.chestname ~= 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..
|
||||||
"field[1.8,10.0;6,0.5;chestname;;"..chestname.."]");
|
"listring[current_name;main]"..
|
||||||
|
"listring[current_player;main]"..
|
||||||
|
"field[1.8,10.0;6,0.5;chestname;;"..chestname.."]");
|
||||||
end
|
end
|
||||||
|
|
||||||
local formspec = "size[9,10]"..
|
local formspec = "size[9,10]"..
|
||||||
"label[0.0,9.7;Title/Content:]"..
|
"label[0.5,9.7;Name:]"..
|
||||||
"field[1.8,10.0;6,0.5;chestname;;"..tostring( chestname or "unconfigured").."]"..
|
"field[1.8,10.0;6,0.5;chestname;;"..tostring( chestname or "unconfigured").."]"..
|
||||||
"button[7.5,9.7;1,0.5;set_chestname;Store]"..
|
"button[7.5,9.7;1,0.5;set_chestname;Store\nName]"..
|
||||||
|
-- "button[8.6,9.7;0.5,0.5;change_color;C]"..
|
||||||
|
"image_button[8.4,9.7;0.5,0.5;chesttools_palette.png;change_color;]"..
|
||||||
"list[current_name;main;0.5,0.3;8,4;]"..
|
"list[current_name;main;0.5,0.3;8,4;]"..
|
||||||
"button[7.0,4.5;0.5,0.5;drop_all;DA]"..
|
"button[7.0,4.5;0.5,0.5;drop_all;DA]"..
|
||||||
"button[7.5,4.5;0.5,0.5;take_all;TA]"..
|
"button[7.5,4.5;0.5,0.5;take_all;TA]"..
|
||||||
"button[8.0,4.5;0.5,0.5;swap_all;SA]"..
|
"button[8.0,4.5;0.5,0.5;swap_all;SA]"..
|
||||||
"button[8.5,4.5;0.5,0.5;filter_all;FA]";
|
"button[8.5,4.5;0.5,0.5;filter_all;FA]"
|
||||||
local bm = "button[0.0,4.5;1,0.5;main;Main]";
|
local bm = "button[0.0,4.5;1,0.5;main;Main]";
|
||||||
local bc = "button[1.0,4.5;1,0.5;craft;Craft]";
|
local bc = "button[1.0,4.5;1,0.5;craft;Craft]";
|
||||||
local b1 = "button[2.0,4.5;1,0.5;bag1;Bag 1]";
|
local b1 = "button[2.0,4.5;1,0.5;bag1;Bag 1]";
|
||||||
@ -141,6 +170,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
local b3 = "button[4.0,4.5;1,0.5;bag3;Bag 3]";
|
local b3 = "button[4.0,4.5;1,0.5;bag3;Bag 3]";
|
||||||
local b4 = "button[5.0,4.5;1,0.5;bag4;Bag 4]";
|
local b4 = "button[5.0,4.5;1,0.5;bag4;Bag 4]";
|
||||||
|
|
||||||
|
|
||||||
local selected = '';
|
local selected = '';
|
||||||
if( fields.drop_all or fields.take_all or fields.swap_all or fields.filter_all ) then
|
if( fields.drop_all or fields.take_all or fields.swap_all or fields.filter_all ) then
|
||||||
-- check if the player has sufficient access to the chest
|
-- check if the player has sufficient access to the chest
|
||||||
@ -161,7 +191,7 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
selected = 'main';
|
selected = 'main';
|
||||||
end
|
end
|
||||||
local inv_list = 'main';
|
local inv_list = 'main';
|
||||||
if( selected == 'main' ) then
|
if( selected == 'main' ) then
|
||||||
inv_list = 'main';
|
inv_list = 'main';
|
||||||
elseif( selected == 'craft' ) then
|
elseif( selected == 'craft' ) then
|
||||||
inv_list = 'craft';
|
inv_list = 'craft';
|
||||||
@ -219,7 +249,9 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
if( fields[ 'main'] or selected=='main' or fields['set_chestname']) then
|
if( fields[ 'main'] or selected=='main' or fields['set_chestname']) then
|
||||||
bag_nr = 0;
|
bag_nr = 0;
|
||||||
formspec = formspec..
|
formspec = formspec..
|
||||||
"list[current_player;main;0.5,5.5;8,4;]";
|
"list[current_player;main;0.5,5.5;8,4;]"..
|
||||||
|
"listring[nodemeta:" .. spos .. ";main]"..
|
||||||
|
"listring[current_player;main]"
|
||||||
bm = "label[0.0,4.4;Main]";
|
bm = "label[0.0,4.4;Main]";
|
||||||
selected = 'main';
|
selected = 'main';
|
||||||
|
|
||||||
@ -228,7 +260,9 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
formspec = formspec..
|
formspec = formspec..
|
||||||
"label[0,5.5;Crafting]"..
|
"label[0,5.5;Crafting]"..
|
||||||
"list[current_player;craftpreview;6.5,6.5;1,1;]"..
|
"list[current_player;craftpreview;6.5,6.5;1,1;]"..
|
||||||
"list[current_player;craft;2.5,6.5;3,3;]";
|
"list[current_player;craft;2.5,6.5;3,3;]"..
|
||||||
|
"listring[nodemeta:" .. spos .. ";main]"..
|
||||||
|
"listring[current_player;craft]"
|
||||||
bc = "label[1.0,4.4;Craft]";
|
bc = "label[1.0,4.4;Craft]";
|
||||||
selected = 'craft';
|
selected = 'craft';
|
||||||
|
|
||||||
@ -258,10 +292,16 @@ chesttools.on_receive_fields = function(pos, formname, fields, player)
|
|||||||
local pname_esc = minetest.formspec_escape(player:get_player_name());
|
local pname_esc = minetest.formspec_escape(player:get_player_name());
|
||||||
formspec = formspec.."list[detached:"..pname_esc.."_bags;bag"..
|
formspec = formspec.."list[detached:"..pname_esc.."_bags;bag"..
|
||||||
tostring(bag_nr)..";1.5,5.5;1,1;]";
|
tostring(bag_nr)..";1.5,5.5;1,1;]";
|
||||||
|
local bag = minetest.get_inventory({type="detached", name=pname_esc.."_bags"},"bag"..tostring(bag_nr))
|
||||||
local slots = 4*8;
|
local slots = 4*8;
|
||||||
if( slots and slots>0 ) then -- no bag present?
|
if( bag and not(bag:get_stack("bag"..tostring(bag_nr),1):is_empty())) then -- no bag present?
|
||||||
formspec = formspec..
|
formspec = formspec..
|
||||||
"list[current_player;bag"..tostring(bag_nr).."contents;0.5,6.5;8,"..tostring(slots/8)..";]";
|
"list[current_player;bag"..tostring(bag_nr).."contents;0.5,6.5;8,"..tostring(slots/8)..";]"..
|
||||||
|
"listring[nodemeta:" .. spos .. ";main]"..
|
||||||
|
"listring[current_player;bag"..tostring(bag_nr).."contents]"
|
||||||
|
else
|
||||||
|
formspec = formspec..
|
||||||
|
"label[0.5,6.5;You have no bag in this slot.]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -349,24 +389,13 @@ chesttools.update_chest = function(pos, formname, fields, player)
|
|||||||
player_inv:add_item( 'main', old_price_item..' '..tostring(old_price_amount));
|
player_inv:add_item( 'main', old_price_item..' '..tostring(old_price_amount));
|
||||||
end
|
end
|
||||||
|
|
||||||
-- set the owner field
|
|
||||||
meta:set_string( 'owner', pname );
|
|
||||||
|
|
||||||
if( fields.locked ) then
|
|
||||||
meta:set_string("infotext", "Locked Chest (owned by "..meta:get_string("owner")..")")
|
|
||||||
elseif( fields.shared ) then
|
|
||||||
meta:set_string("infotext", "Shared Chest (owned by "..meta:get_string("owner")..")")
|
|
||||||
else
|
|
||||||
meta:set_string("infotext", "Chest")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- copy the old inventory
|
-- copy the old inventory
|
||||||
local inv = meta:get_inventory();
|
local inv = meta:get_inventory();
|
||||||
local main_inv = {};
|
local main_inv = {};
|
||||||
local inv_size = inv:get_size("main");
|
local inv_size = inv:get_size("main");
|
||||||
for i=1, inv_size do
|
for i=1, inv_size do
|
||||||
main_inv[ i ] = inv:get_stack( "main", i);
|
main_inv[ i ] = inv:get_stack( "main", i);
|
||||||
print("Found: "..tostring( main_inv[ i ]:get_name()));
|
-- print("Found: "..tostring( main_inv[ i ]:get_name()));
|
||||||
end
|
end
|
||||||
|
|
||||||
-- actually change and initialize the new chest
|
-- actually change and initialize the new chest
|
||||||
@ -374,6 +403,14 @@ chesttools.update_chest = function(pos, formname, fields, player)
|
|||||||
-- make sure the player owns the new chest
|
-- make sure the player owns the new chest
|
||||||
meta:set_string("owner", pname);
|
meta:set_string("owner", pname);
|
||||||
|
|
||||||
|
if( fields.locked ) then
|
||||||
|
meta:set_string("infotext", "Locked Chest (owned by "..pname..")")
|
||||||
|
elseif( fields.shared ) then
|
||||||
|
meta:set_string("infotext", "Shared Chest (owned by "..pname..")")
|
||||||
|
else
|
||||||
|
meta:set_string("infotext", "Chest")
|
||||||
|
end
|
||||||
|
|
||||||
-- put the inventory back
|
-- put the inventory back
|
||||||
local new_inv = meta:get_inventory();
|
local new_inv = meta:get_inventory();
|
||||||
local new_inv_size = inv:get_size("main");
|
local new_inv_size = inv:get_size("main");
|
||||||
@ -413,10 +450,12 @@ chesttools.form_input_handler = function( player, formname, fields)
|
|||||||
end
|
end
|
||||||
if( formname == "chesttools:shared_chest") then
|
if( formname == "chesttools:shared_chest") then
|
||||||
chesttools.on_receive_fields(pos, formname, fields, player);
|
chesttools.on_receive_fields(pos, formname, fields, player);
|
||||||
|
return true; -- this function was responsible for handling the input
|
||||||
elseif( formname == "chesttools:update") then
|
elseif( formname == "chesttools:update") then
|
||||||
chesttools.update_chest( pos, formname, fields, player);
|
chesttools.update_chest( pos, formname, fields, player);
|
||||||
|
return true; -- this function was responsible for handling the input
|
||||||
end
|
end
|
||||||
|
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -426,13 +465,15 @@ end
|
|||||||
minetest.register_on_player_receive_fields( chesttools.form_input_handler );
|
minetest.register_on_player_receive_fields( chesttools.form_input_handler );
|
||||||
|
|
||||||
|
|
||||||
minetest.register_node( 'chesttools:shared_chest', {
|
chesttools.register_chest = function(node_name, desc, name, paramtype2, palette, tiles)
|
||||||
description = 'Shared chest which can be used by all who can build at that spot',
|
minetest.register_node( node_name, {
|
||||||
name = 'shared chest',
|
description = desc,
|
||||||
tiles = chesttools.chest_add.tiles,
|
name = name,
|
||||||
|
tiles = tiles,
|
||||||
groups = chesttools.chest_add.groups,
|
groups = chesttools.chest_add.groups,
|
||||||
tube = chesttools.chest_add.tube,
|
tube = chesttools.chest_add.tube,
|
||||||
paramtype2 = "facedir",
|
paramtype2 = paramtype2,
|
||||||
|
palette = palette,
|
||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
@ -441,6 +482,9 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name() or "")
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
meta:set_string("infotext", "Shared Chest (owned by "..meta:get_string("owner")..")")
|
meta:set_string("infotext", "Shared Chest (owned by "..meta:get_string("owner")..")")
|
||||||
|
if has_pipeworks then
|
||||||
|
pipeworks.after_place(pos)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
@ -450,13 +494,15 @@ 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)
|
||||||
local meta = minetest.get_meta(pos);
|
local player_name = (player and player.get_player_name and player:get_player_name()) or ""
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main") and player:get_player_name() == meta:get_string('owner');
|
return player_name and inv:is_empty("main") and not minetest.is_protected(pos, player_name)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
allow_metadata_inventory_move = function(pos, from_list, from_index,
|
||||||
@ -557,11 +603,19 @@ minetest.register_node( 'chesttools:shared_chest', {
|
|||||||
formspec = 'size['..tostring(offset)..',6.5]'..formspec;
|
formspec = 'size['..tostring(offset)..',6.5]'..formspec;
|
||||||
-- only show the formspec if it really is a chest that can be updated
|
-- only show the formspec if it really is a chest that can be updated
|
||||||
if( can_be_upgraded ) then
|
if( can_be_upgraded ) then
|
||||||
minetest.show_formspec( name, "chesttools:update", formspec );
|
minetest.show_formspec( name, "chesttools:update", formspec );
|
||||||
end
|
end
|
||||||
return nil;
|
return nil;
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
chesttools.register_chest("chesttools:shared_chest",
|
||||||
|
'Shared chest which can be used by all who can build at that spot',
|
||||||
|
'shared chest',
|
||||||
|
'colorfacedir',
|
||||||
|
'chesttools_palette.png',
|
||||||
|
chesttools.chest_add.tiles)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'chesttools:shared_chest',
|
output = 'chesttools:shared_chest',
|
||||||
@ -569,4 +623,23 @@ minetest.register_craft({
|
|||||||
recipe = { 'default:steel_ingot', 'default:chest_locked' },
|
recipe = { 'default:steel_ingot', 'default:chest_locked' },
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.log("action", "[chesttools] loaded.")
|
chesttools.register_chest("chesttools:shared_chest_wall",
|
||||||
|
'Shared chest which can be used by all who can build at that spot (wallmounted)',
|
||||||
|
'shared chest (wallmounted)',
|
||||||
|
'colorwallmounted',
|
||||||
|
'chesttools_palette_wallmounted.png',
|
||||||
|
{chesttools.chest_add.tiles[6],
|
||||||
|
chesttools.chest_add.tiles[3].."^[transformR180",
|
||||||
|
chesttools.chest_add.tiles[3].."^[transformR270",
|
||||||
|
chesttools.chest_add.tiles[3].."^[transformR90",
|
||||||
|
chesttools.chest_add.tiles[1].."^[transformR90",
|
||||||
|
chesttools.chest_add.tiles[1].."^[transformR90",
|
||||||
|
chesttools.chest_add.tiles[1],
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = 'chesttools:shared_chest_wall',
|
||||||
|
type = 'shapeless',
|
||||||
|
recipe = { 'default:steel_ingot', 'chesttools:shared_chest' },
|
||||||
|
})
|
||||||
|
|
||||||
|
5
mod.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
name = chesttools
|
||||||
|
description = With these chests, you can access your bags and craft inventory with one click and move items between bag and chest. Other buttons speed up inventory movement even more: "DA": drop all from the selected inventory to the chest, "TA": take all from the chest and move it to your selected inventory, "SA": swap all items between chest and selected inventory and "FA": filter all - drop those items form your selected inventory to the chest of which there is already at least one in the chest. If the place where the chest stands is protected, everyone who can build there can access the chest (shared chest). You can also set a description text for the chests. Interaction with tubes is possible.
|
||||||
|
depends = default
|
||||||
|
author = Sokomine
|
||||||
|
title = Very useful chests which allow quick access to your bags.
|
BIN
textures/chesttools_blue_chest_front.png
Normal file
After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 742 B |
BIN
textures/chesttools_palette.png
Normal file
After Width: | Height: | Size: 160 B |
BIN
textures/chesttools_palette_wallmounted.png
Normal file
After Width: | Height: | Size: 136 B |
BIN
textures/chesttools_white_chest_lock.png
Normal file
After Width: | Height: | Size: 717 B |
BIN
textures/chesttools_white_chest_side.png
Normal file
After Width: | Height: | Size: 538 B |
BIN
textures/chesttools_white_chest_top.png
Normal file
After Width: | Height: | Size: 559 B |