added listrings to the players inventory + stone workbench : fixed infotext

This commit is contained in:
cale 2016-10-15 11:21:27 +02:00
parent 6ca82c5e60
commit f0f35ef72d
3 changed files with 20 additions and 3 deletions

View File

@ -77,7 +77,9 @@ end
default.player_inventory.register_tab({
name = "Armor",
formspec = default.player_inventory.get_default_inventory_formspec() ..
"list[detached:armor_%s;main;3,0.5;2,2;]" ..
"list[detached:armor_<player_name>;main;3,0.5;2,2;]" ..
"listring[detached:armor_<player_name>;main]" ..
"listring[current_player;main]" ..
default.itemslot_bg(3,0.5,2,2)
})

View File

@ -24,6 +24,8 @@ default.craft_form_v2 = default.craft_form_v2.."list[current_player;craft;2.5,0;
default.craft_form_v2 = default.craft_form_v2..default.itemslot_bg(2.5,0,3,3)
default.craft_form_v2 = default.craft_form_v2.."list[current_player;craftpreview;6,1;1,1;]"
default.craft_form_v2 = default.craft_form_v2..default.itemslot_bg(6,1,1,1)
default.craft_form_v2 = default.craft_form_v2 .."listring[current_player;main]"
default.craft_form_v2 = default.craft_form_v2 .."listring[current_player;craft]"
minetest.register_node("default:workbench_v2", {
description = "Stone Workbench",
@ -32,7 +34,7 @@ minetest.register_node("default:workbench_v2", {
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", default.craft_form_v2)
meta:set_string("infotext", "Workbench V2")
meta:set_string("infotext", "Stone Workbench")
local inv = meta:get_inventory()
inv:set_size("main", 3*2)
end,
@ -316,6 +318,15 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = "default:string_strong",
recipe = {
{"group:plant", "group:plant", "group:plant"},
{"group:plant", "group:plant", "group:plant"},
{"group:plant", "group:plant", "group:plant"}
}
})
-- rope
minetest.register_craft({

View File

@ -55,7 +55,7 @@ function default.player_inventory.update(player)
local tab = default.player_inventory.contexts[name].tab or 1
local formspec = default.player_inventory.get_formspec(tab, name)
player:set_inventory_formspec(string.format(formspec, player:get_player_name()))
player:set_inventory_formspec(string.gsub(string.format(formspec, player:get_player_name()), "<player_name>", player:get_player_name()))
end
function default.player_inventory.get_default_inventory_formspec()
@ -137,6 +137,8 @@ default.inv_form = default.inv_form.."list[current_player;craft;1.5,1;3,1;]"
default.inv_form = default.inv_form..default.itemslot_bg(1.5,1,3,1)
default.inv_form = default.inv_form.."list[current_player;craftpreview;5.5,1;1,1;]"
default.inv_form = default.inv_form..default.itemslot_bg(5.5,1,1,1)
default.inv_form = default.inv_form.."listring[current_player;craft]"
default.inv_form = default.inv_form.."listring[current_player;main]"
default.player_inventory.register_tab({
name = "Crafting",
@ -153,6 +155,8 @@ default.craft_form = default.craft_form.."list[current_player;craft;1.5,0;3,3;]"
default.craft_form = default.craft_form..default.itemslot_bg(1.5,0,3,3)
default.craft_form = default.craft_form.."list[current_player;craftpreview;5,1;1,1;]"
default.craft_form = default.craft_form..default.itemslot_bg(5,1,1,1)
default.craft_form = default.craft_form.."listring[current_player;craft]"
default.craft_form = default.craft_form.."listring[current_player;main]"
default.player_anim = {}