Scribing tables made of different wood

master
Kotolegokot 2012-11-25 18:17:26 +06:00
parent e7788156eb
commit 43f8b36216
3 changed files with 62 additions and 60 deletions

View File

@ -1,2 +1,2 @@
default default
metals trees

View File

@ -1,14 +1,5 @@
scribing_table = {} scribing_table = {}
minetest.register_craft({
output = 'scribing_table:self',
recipe = {
{'','default:stick',''},
{'default:wood','default:glass','default:wood'},
{'default:wood','default:wood','default:wood'},
}
})
realtest.registered_instrument_plans = {} realtest.registered_instrument_plans = {}
function realtest.register_instrument_plan(name, PlanDef) function realtest.register_instrument_plan(name, PlanDef)
if PlanDef.bitmap then if PlanDef.bitmap then
@ -132,56 +123,67 @@ local function check_recipe(pos)
end end
end end
minetest.register_node("scribing_table:self", { for i, tree_name in ipairs(realtest.registered_trees_list) do
description = "Scribing Table", local tree = realtest.registered_trees[tree_name]
tiles = {"scribing_table_top.png", "default_wood.png", "default_wood.png^scribing_table_side.png"}, minetest.register_node("scribing_table:scribing_table_"..i, {
drawtype = "nodebox", description = tree.description.." Scribing Table",
paramtype = "light", tiles = {tree.textures[3].."^scribing_table_top.png", tree.textures[3], tree.textures[3].."^scribing_table_side.png"},
node_box = { drawtype = "nodebox",
type = "fixed", paramtype = "light",
fixed = { node_box = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5}, type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.3,0.5},
},
}, },
}, selection_box = {
selection_box = { type = "fixed",
type = "fixed", fixed = {
fixed = { {-0.5,-0.5,-0.5,0.5,0.3,0.5},
{-0.5,-0.5,-0.5,0.5,0.3,0.5}, },
}, },
}, groups = {oddly_breakable_by_hand=3, dig_immediate=2},
groups = {oddly_breakable_by_hand=3, dig_immediate=2}, sounds = default.node_sound_stone_defaults(),
sounds = default.node_sound_stone_defaults(), on_construct = function(pos)
on_construct = function(pos) local meta = minetest.env:get_meta(pos)
local meta = minetest.env:get_meta(pos) meta:set_string("formspec",
meta:set_string("formspec", "size[8,10]"..
"size[8,10]".. "list[current_name;paper;6.5,0.5;1,1;]"..
"list[current_name;paper;6,0;1,1;]".. "list[current_name;dye;0.5,0.5;5,5;]"..
"list[current_name;dye;0,0;5,5;]".. "list[current_name;res;6.5,4.5;1,1;]"..
"list[current_name;res;6,4;1,1;]".. "image[5.5,1.5;2,3.4;scribing_table_arrow.png]"..
"image[5,1;2,3.4;scribing_table_arrow.png]".. "list[current_player;main;0,6;8,4;]"
"list[current_player;main;0,6;8,4;]" )
) meta:set_string("infotext", "Scribing Table")
meta:set_string("infotext", "Scribing Table") local inv = meta:get_inventory()
local inv = meta:get_inventory() inv:set_size("paper", 1)
inv:set_size("paper", 1) inv:set_size("dye", 25)
inv:set_size("dye", 25) inv:set_size("res", 1)
inv:set_size("res", 1) end,
end, on_metadata_inventory_move = function(pos, from_list, from_index,to_list, to_index, count, player)
on_metadata_inventory_move = function(pos, from_list, from_index,to_list, to_index, count, player) check_recipe(pos)
check_recipe(pos) end,
end, on_metadata_inventory_put = function(pos, listname, index, stack, player)
on_metadata_inventory_put = function(pos, listname, index, stack, player) check_recipe(pos)
check_recipe(pos) end,
end, on_metadata_inventory_take = function(pos, listname, index, stack, player)
on_metadata_inventory_take = function(pos, listname, index, stack, player) check_recipe(pos)
check_recipe(pos) end,
end, can_dig = function(pos,player)
can_dig = function(pos,player) local meta = minetest.env:get_meta(pos)
local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory()
local inv = meta:get_inventory() if inv:is_empty("paper") and inv:is_empty("dye") and inv:is_empty("res") then
if inv:is_empty("paper") and inv:is_empty("dye") and inv:is_empty("res") then return true
return true end
end return false
return false end,
end, })
minetest.register_craft({
output = "scribing_table:scribing_table_"..i,
recipe = {
{"","group:stick",""},
{tree.name.."_planks","default:glass",tree.name.."_planks"},
{tree.name.."_planks",tree.name.."_planks",tree.name.."_planks"},
}
}) })
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 900 B