tweaks
This commit is contained in:
parent
9b8d1749ba
commit
4a62a8252c
@ -6,28 +6,28 @@ local material = {
|
|||||||
"copperblock", "bronzeblock", "goldblock", "steelblock", "diamondblock",
|
"copperblock", "bronzeblock", "goldblock", "steelblock", "diamondblock",
|
||||||
"meselamp", "glass", "obsidian_glass" }
|
"meselamp", "glass", "obsidian_glass" }
|
||||||
|
|
||||||
local def = {
|
local def = { -- node name, yield, nodebox shape
|
||||||
{"nanoslab", "32", {-0.5, -0.5, -0.5, 0, -0.4375, 0}},
|
{"nanoslab", "16", {-0.5, -0.5, -0.5, 0, -0.4375, 0}},
|
||||||
{"microslab_half", "16", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0}},
|
{"microslab_half", "16", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0}},
|
||||||
{"microslab", "8", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}},
|
{"microslab", "8", {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}},
|
||||||
{"panel", "4", {-0.5, -0.5, -0.5, 0.5, 0, 0}},
|
{"panel", "4", {-0.5, -0.5, -0.5, 0.5, 0, 0}},
|
||||||
{"slab", "2", {-0.5, -0.5, -0.5, 0.5, 0, 0.5}},
|
{"slab", "2", {-0.5, -0.5, -0.5, 0.5, 0, 0.5}},
|
||||||
{"outerstair", "2", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0, 0.5, 0.5}}},
|
{"outerstair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0, 0.5, 0.5}}},
|
||||||
{"stair", "2", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}}},
|
{"stair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}}},
|
||||||
{"innerstair", "2", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}, {-0.5, 0, -0.5, 0, 0.5, 0}}}
|
{"innerstair", "1", {{-0.5, -0.5, -0.5, 0.5, 0, 0.5}, {-0.5, 0, 0, 0.5, 0.5, 0.5}, {-0.5, 0, -0.5, 0, 0.5, 0}}}
|
||||||
}
|
}
|
||||||
|
|
||||||
function xdecor.on_construct(pos)
|
local function xconstruct(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local nodespec = ""
|
local nodebtn = ""
|
||||||
|
|
||||||
for j=1, #def do
|
for i=1, #def do
|
||||||
nodespec = nodespec..
|
nodebtn = nodebtn..
|
||||||
"item_image_button["..(j-1)..",0.5;1,1;xdecor:"..def[j][1].."_cloud;"..def[j][1]..";]"
|
"item_image_button["..(i-1)..",0.5;1,1;xdecor:"..def[i][1].."_cloud;"..def[i][1]..";]"
|
||||||
end
|
end
|
||||||
meta:set_string("formspec", "size[8,7;]"..fancy_gui..
|
meta:set_string("formspec", "size[8,7;]"..fancy_gui..
|
||||||
"label[0,0;Cut your material into...]"..
|
"label[0,0;Cut your material into...]"..
|
||||||
nodespec..
|
nodebtn..
|
||||||
"label[0,1.5;Input]"..
|
"label[0,1.5;Input]"..
|
||||||
"list[current_name;input;0,2;1,1;]"..
|
"list[current_name;input;0,2;1,1;]"..
|
||||||
"image[1,2;1,1;xdecor_saw.png]"..
|
"image[1,2;1,1;xdecor_saw.png]"..
|
||||||
@ -39,7 +39,7 @@ function xdecor.on_construct(pos)
|
|||||||
"label[6.8,1.5;Hammer]]"..
|
"label[6.8,1.5;Hammer]]"..
|
||||||
"list[current_name;fuel;7,2;1,1;]"..
|
"list[current_name;fuel;7,2;1,1;]"..
|
||||||
"list[current_player;main;0,3.25;8,4;]")
|
"list[current_player;main;0,3.25;8,4;]")
|
||||||
meta:set_string("infotext", "Work Bench")
|
meta:set_string("infotext", "Work Table")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("output", 1)
|
inv:set_size("output", 1)
|
||||||
inv:set_size("input", 1)
|
inv:set_size("input", 1)
|
||||||
@ -47,7 +47,7 @@ function xdecor.on_construct(pos)
|
|||||||
inv:set_size("fuel", 1)
|
inv:set_size("fuel", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
function xdecor.on_receive_fields(pos, formname, fields, sender)
|
local function xfields(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local inputstack = inv:get_stack("input", 1)
|
local inputstack = inv:get_stack("input", 1)
|
||||||
@ -73,7 +73,7 @@ function xdecor.on_receive_fields(pos, formname, fields, sender)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function xdecor.can_dig(pos, player)
|
local function xdig(pos, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if not inv:is_empty("input") or not inv:is_empty("output")
|
if not inv:is_empty("input") or not inv:is_empty("output")
|
||||||
@ -83,14 +83,14 @@ function xdecor.can_dig(pos, player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
xdecor.register("worktable", {
|
xdecor.register("worktable", {
|
||||||
description = "Work Table", infotext = "Work Table",
|
description = "Work Table", groups = {snappy=3},
|
||||||
sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
|
sounds = default.node_sound_wood_defaults(),
|
||||||
tiles = {"xdecor_worktable_top.png", "xdecor_worktable_top.png",
|
tiles = {"xdecor_worktable_top.png", "xdecor_worktable_top.png",
|
||||||
"xdecor_worktable_sides.png", "xdecor_worktable_sides.png",
|
"xdecor_worktable_sides.png", "xdecor_worktable_sides.png",
|
||||||
"xdecor_worktable_front.png", "xdecor_worktable_front.png"},
|
"xdecor_worktable_front.png", "xdecor_worktable_front.png"},
|
||||||
on_construct = xdecor.on_construct,
|
on_construct = xconstruct,
|
||||||
on_receive_fields = xdecor.on_receive_fields,
|
on_receive_fields = xfields,
|
||||||
can_dig = xdecor.can_dig })
|
can_dig = xdig })
|
||||||
|
|
||||||
local function lightlvl(material)
|
local function lightlvl(material)
|
||||||
if (material == "meselamp") then return 12 else return 0 end
|
if (material == "meselamp") then return 12 else return 0 end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user