updated homedecor, moreblocks, pipeworks, and travelnet
parent
7a63e51fb5
commit
10466bea04
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:** <https://forum.minetest.net/viewtopic.php?f=11&t=509>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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:;]"..
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue