From 10466bea04f77261de0d9b77df4f7e4efbe88a19 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 30 Aug 2016 14:15:49 -0400 Subject: updated homedecor, moreblocks, pipeworks, and travelnet --- homedecor/handlers/inventory.lua | 25 +++++++++++++++++-------- homedecor/kitchen_appliances.lua | 1 + homedecor/trash_cans.lua | 3 ++- homedecor/wardrobe.lua | 3 ++- inbox/init.lua | 8 +++++--- moreblocks/README.md | 2 +- pipeworks/autocrafter.lua | 9 ++++++++- pipeworks/filter-injector.lua | 3 ++- pipeworks/sorting_tubes.lua | 25 ++++++++++++++++++++++--- pipeworks/trashcan.lua | 3 ++- pipeworks/wielder.lua | 3 ++- travelnet/elevator.lua | 2 +- travelnet/init.lua | 24 ++++++++++++++++++------ 13 files changed, 83 insertions(+), 28 deletions(-) diff --git a/homedecor/handlers/inventory.lua b/homedecor/handlers/inventory.lua index 44b6945..dc4b740 100644 --- a/homedecor/handlers/inventory.lua +++ b/homedecor/handlers/inventory.lua @@ -8,38 +8,47 @@ end local background = default.gui_bg .. default.gui_bg_img .. default.gui_slots local default_inventory_formspecs = { ["4"]="size[8,6]".. background .. - "list[context;main;2,0;4,1;]".. - "list[current_player;main;0,2;8,4;]", + "list[context;main;2,0;4,1;]" .. + "list[current_player;main;0,2;8,4;]" .. + "listring[]", ["6"]="size[8,6]".. background .. "list[context;main;1,0;6,1;]".. - "list[current_player;main;0,2;8,4;]", + "list[current_player;main;0,2;8,4;]" .. + "listring[]", ["8"]="size[8,6]".. background .. "list[context;main;0,0;8,1;]".. - "list[current_player;main;0,2;8,4;]", + "list[current_player;main;0,2;8,4;]" .. + "listring[]", ["12"]="size[8,7]".. background .. "list[context;main;1,0;6,2;]".. - "list[current_player;main;0,3;8,4;]", + "list[current_player;main;0,3;8,4;]" .. + "listring[]", ["16"]="size[8,7]".. background .. "list[context;main;0,0;8,2;]".. - "list[current_player;main;0,3;8,4;]", + "list[current_player;main;0,3;8,4;]" .. + "listring[]", ["24"]="size[8,8]".. background .. "list[context;main;0,0;8,3;]".. - "list[current_player;main;0,4;8,4;]", + "list[current_player;main;0,4;8,4;]" .. + "listring[]", ["32"]="size[8,9]".. background .. "list[context;main;0,0.3;8,4;]".. "list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,6.08;8,3;8]".. + "listring[context;main]" .. + "listring[current_player;main]" .. default.get_hotbar_bg(0,4.85), ["50"]="size[10,10]".. background .. "list[context;main;0,0;10,5;]".. - "list[current_player;main;1,6;8,4;]", + "list[current_player;main;1,6;8,4;]" .. + "listring[]", } local function get_formspec_by_size(size) diff --git a/homedecor/kitchen_appliances.lua b/homedecor/kitchen_appliances.lua index af3009b..70d0703 100644 --- a/homedecor/kitchen_appliances.lua +++ b/homedecor/kitchen_appliances.lua @@ -48,6 +48,7 @@ minetest.register_alias("homedecor:refrigerator_steel_top", "air") minetest.register_alias("homedecor:refrigerator_white_bottom_locked", "homedecor:refrigerator_white_locked") minetest.register_alias("homedecor:refrigerator_white_top_locked", "air") +minetest.register_alias("homedecor:refrigerator_locked", "homedecor:refrigerator_white_locked") minetest.register_alias("homedecor:refrigerator_steel_bottom_locked", "homedecor:refrigerator_steel_locked") minetest.register_alias("homedecor:refrigerator_steel_top_locked", "air") diff --git a/homedecor/trash_cans.lua b/homedecor/trash_cans.lua index a7aa5d3..70c45d8 100644 --- a/homedecor/trash_cans.lua +++ b/homedecor/trash_cans.lua @@ -36,7 +36,8 @@ homedecor.register("trash_can_green_open", { formspec = "size[8,9]" .. default.gui_bg .. default.gui_bg_img .. default.gui_slots .. "button[2.5,3.8;3,1;empty;Empty Trash]".. "list[context;main;2.5,0.5;3,3;]".. - "list[current_player;main;0,5;8,4;]", + "list[current_player;main;0,5;8,4;]" .. + "listring[]", }, on_receive_fields = function(pos, formname, fields, sender) if fields.empty then diff --git a/homedecor/wardrobe.lua b/homedecor/wardrobe.lua index 86b29ef..c7dde42 100644 --- a/homedecor/wardrobe.lua +++ b/homedecor/wardrobe.lua @@ -39,7 +39,8 @@ homedecor.register("wardrobe", { clothes_strings.. "vertlabel[0,5.2;STORAGE]".. "list[current_name;main;0.5,4.5;5,2;]".. - "list[current_player;main;0.5,6.8;5,2;]") + "list[current_player;main;0.5,6.8;5,2;]" .. + "listring[]") end, on_receive_fields = function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) diff --git a/inbox/init.lua b/inbox/init.lua index 6189784..d188f0d 100644 --- a/inbox/init.lua +++ b/inbox/init.lua @@ -64,7 +64,7 @@ minetest.register_node("inbox:empty", { local name = player and player:get_player_name() local owner = meta:get_string("owner") local inv = meta:get_inventory() - return player == owner and inv:is_empty("main") + return name == owner and inv:is_empty("main") end, on_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) @@ -95,7 +95,8 @@ function inbox.get_inbox_formspec(pos) local formspec = "size[8,9]".. "list[nodemeta:".. spos .. ";main;0,0;8,4;]".. - "list[current_player;main;0,5;8,4;]" + "list[current_player;main;0,5;8,4;]" .. + "listring[]" return formspec end @@ -104,6 +105,7 @@ function inbox.get_inbox_insert_formspec(pos) local formspec = "size[8,9]".. "list[nodemeta:".. spos .. ";drop;3.5,2;1,1;]".. - "list[current_player;main;0,5;8,4;]" + "list[current_player;main;0,5;8,4;]".. + "listring[]" return formspec end diff --git a/moreblocks/README.md b/moreblocks/README.md index 511fda4..e6be474 100644 --- a/moreblocks/README.md +++ b/moreblocks/README.md @@ -8,6 +8,6 @@ To install, just clone this repository into your "mods" directory. More Blocks code is licensed under the zlib license, textures are by Calinou and are licensed under CC BY-SA 3.0 Unported. -moreblocks_copperpatina.png is by pithydon licensed under WTFPL +moreblocks_copperpatina.png is by pithydon licensed under CC0 1.0 **Forum topic:** diff --git a/pipeworks/autocrafter.lua b/pipeworks/autocrafter.lua index 648a610..faf5381 100644 --- a/pipeworks/autocrafter.lua +++ b/pipeworks/autocrafter.lua @@ -183,7 +183,14 @@ local function update_meta(meta, enabled) default.gui_bg_img.. default.gui_slots.. default.get_hotbar_bg(0,7) .. - "list[current_player;main;0,7;8,4;]") + "list[current_player;main;0,7;8,4;]" .. + "listring[current_player;main]".. + "listring[context;src]" .. + "listring[context;dst]" .. + "listring[current_player;main]".. + "listring[context;recipe]" .. + "listring[context;output]" + ) -- toggling the button doesn't quite call for running a recipe change check -- so instead we run a minimal version for infotext setting only diff --git a/pipeworks/filter-injector.lua b/pipeworks/filter-injector.lua index 78e6f25..7fbabc2 100644 --- a/pipeworks/filter-injector.lua +++ b/pipeworks/filter-injector.lua @@ -45,7 +45,8 @@ local function set_filter_formspec(data, meta) "Sequence slots Randomly", "Sequence slots by Rotation"}).. exmatch_button.. - "list[current_player;main;0,4.5;8,4;]" + "list[current_player;main;0,4.5;8,4;]" .. + "listring[]" end meta:set_string("formspec", formspec) end diff --git a/pipeworks/sorting_tubes.lua b/pipeworks/sorting_tubes.lua index 6d432ae..edaa24a 100644 --- a/pipeworks/sorting_tubes.lua +++ b/pipeworks/sorting_tubes.lua @@ -31,7 +31,21 @@ if pipeworks.enable_mese_tube then "image[0,4;1,1;pipeworks_blue.png]".. "image[0,5;1,1;pipeworks_red.png]".. buttons_formspec.. - "list[current_player;main;0,7;8,4;]") + "list[current_player;main;0,7;8,4;]" .. + "listring[current_player;main]" .. + "listring[current_player;main]" .. + "listring[context;line1]" .. + "listring[current_player;main]" .. + "listring[context;line2]" .. + "listring[current_player;main]" .. + "listring[context;line3]" .. + "listring[current_player;main]" .. + "listring[context;line4]" .. + "listring[current_player;main]" .. + "listring[context;line5]" .. + "listring[current_player;main]" .. + "listring[context;line6]" + ) end pipeworks.register_tube("pipeworks:mese_tube", { @@ -119,8 +133,13 @@ if pipeworks.enable_mese_tube then if not pipeworks.may_configure(pos, player) then return 0 end update_formspec(pos) -- For old tubes local inv = minetest.get_meta(pos):get_inventory() - inv:set_stack(from_list, from_index, ItemStack("")) - return 0 + + if from_list:match("line%d") and to_list:match("line%d") then + return count + else + inv:set_stack(from_list, from_index, ItemStack("")) + return 0 + end end, }, }) diff --git a/pipeworks/trashcan.lua b/pipeworks/trashcan.lua index 87980ab..8db9edf 100644 --- a/pipeworks/trashcan.lua +++ b/pipeworks/trashcan.lua @@ -28,7 +28,8 @@ minetest.register_node("pipeworks:trashcan", { default.gui_bg_img.. default.gui_slots.. default.get_hotbar_bg(0,3) .. - "list[current_player;main;0,3;8,4;]") + "list[current_player;main;0,3;8,4;]" .. + "listring[]") meta:set_string("infotext", "Trash Can") meta:get_inventory():set_size("trash", 1) end, diff --git a/pipeworks/wielder.lua b/pipeworks/wielder.lua index 3cb1649..4e2882b 100644 --- a/pipeworks/wielder.lua +++ b/pipeworks/wielder.lua @@ -14,7 +14,8 @@ local function set_wielder_formspec(data, meta) "item_image[0,0;1,1;"..data.name_base.."_off]".. "label[1,0;"..minetest.formspec_escape(data.description).."]".. "list[current_name;"..minetest.formspec_escape(data.wield_inv_name)..";"..((8-data.wield_inv_width)*0.5)..",1;"..data.wield_inv_width..","..data.wield_inv_height..";]".. - "list[current_player;main;0,"..(2+data.wield_inv_height)..";8,4;]") + "list[current_player;main;0,"..(2+data.wield_inv_height)..";8,4;]" .. + "listring[]") meta:set_string("infotext", data.description) end diff --git a/travelnet/elevator.lua b/travelnet/elevator.lua index a407d33..32d9ea0 100644 --- a/travelnet/elevator.lua +++ b/travelnet/elevator.lua @@ -48,7 +48,7 @@ minetest.register_node("travelnet:elevator", { meta:set_string("station_name", ""); meta:set_string("station_network",""); meta:set_string("owner", placer:get_player_name() ); - -- request initinal data + -- request initial data meta:set_string("formspec", "size[12,10]".. "field[0.3,5.6;6,0.7;station_name;Name of this station:;]".. diff --git a/travelnet/init.lua b/travelnet/init.lua index 3eeb949..0814e65 100644 --- a/travelnet/init.lua +++ b/travelnet/init.lua @@ -22,6 +22,10 @@ Please configure this mod in config.lua Changelog: + 30.08.16 - If the station the traveller just travelled to no longer exists, the player is sent back to the + station where he/she came from. + 30.08.16 - Attaching a travelnet box to a non-existant network of another player is possible (requested by OldCoder). + Still requires the travelnet_attach-priv. 05.10.14 - Added an optional abm so that the travelnet network can heal itshelf in case of loss of the savefile. If you want to use this, set travelnet.enable_abm = true @@ -185,12 +189,19 @@ travelnet.update_formspec = function( pos, puncher_name ) -- add name of station + network + owner + update-button - local formspec = "size[12,10]".. + local zusatzstr = ""; + local trheight = "10"; + if( this_node and this_node.name=="locked_travelnet:travelnet" ) then + zusatzstr = "field[0.3,11;6,0.7;locks_sent_lock_command;Locked travelnet. Type /help for help:;]"; + trheight = "11.5"; + end + local formspec = "size[12,"..trheight.."]".. "label[3.3,0.0;Travelnet-Box:]".."label[6.3,0.0;Punch box to update target list.]".. "label[0.3,0.4;Name of this station:]".."label[6.3,0.4;"..(station_name or "?").."]".. "label[0.3,0.8;Assigned to Network:]" .."label[6.3,0.8;"..(station_network or "?").."]".. "label[0.3,1.2;Owned by:]" .."label[6.3,1.2;"..(owner_name or "?").."]".. - "label[3.3,1.6;Click on target to travel there:]"; + "label[3.3,1.6;Click on target to travel there:]".. + zusatzstr; -- "button_exit[5.3,0.3;8,0.8;do_update;Punch box to update destination list. Click on target to travel there.]".. local x = 0; local y = 0; @@ -318,16 +329,15 @@ travelnet.add_target = function( station_name, network_name, pos, player_name, m elseif( is_elevator ) then -- elevator networks owner_name = player_name; - elseif( not( travelnet.targets[ owner_name ] ) - or not( travelnet.targets[ owner_name ][ network_name ] )) then + elseif( not( minetest.check_player_privs(player_name, {interact=true}))) then - minetest.chat_send_player(player_name, "There is no network named "..tostring( network_name ).." owned by "..tostring( owner_name )..". Aborting."); + minetest.chat_send_player(player_name, "There is no player with interact privilege named '"..tostring( player_name ).."'. Aborting."); return; elseif( not( minetest.check_player_privs(player_name, {travelnet_attach=true})) and not( travelnet.allow_attach( player_name, owner_name, network_name ))) then - minetest.chat_send_player(player_name, "You do not have the travelnet_attach priv which is required to attach your box to the network of someone else. Aborting."); + minetest.chat_send_player(player_name, "You do not have the travelnet_attach priv which is required to attach your box to the network of someone else. Aborting."); return; end @@ -555,6 +565,8 @@ travelnet.on_receive_fields = function(pos, formname, fields, player) station_network = station_network }}; travelnet.remove_box( target_pos, nil, oldmetadata, player ); + -- send the player back as there's no receiving travelnet + player:moveto( pos, false ); -- do this only on servers where the function exists elseif( player.set_look_yaw ) then -- cgit v1.2.3