Add new nodes and functional working bench
@ -6,6 +6,7 @@
|
|||||||
### Credits ###
|
### Credits ###
|
||||||
|
|
||||||
##### Textures : Gambit, VanessaE, kilbith. #####
|
##### Textures : Gambit, VanessaE, kilbith. #####
|
||||||
##### Code : VanessaE, t4im, kilbith. #####
|
##### Code : VanessaE, t4im, kilbith, Krock. #####
|
||||||
|
|
||||||
![Preview](http://i.imgur.com/teTQM6V.png)
|
![Preview](http://i.imgur.com/teTQM6V.png)
|
||||||
|
![Preview2](http://i.imgur.com/FZzmpep.png)
|
||||||
|
50
crafts.lua
@ -1,9 +1,20 @@
|
|||||||
minetest.register_craft({ output = "xdecor:candle", recipe = {{"default:torch"}} })
|
minetest.register_craft({ output = "xdecor:candle",
|
||||||
minetest.register_craft({ output = "xdecor:cabinet_half 2", recipe = {{"xdecor:cabinet"}} })
|
recipe = {{"default:torch"}} })
|
||||||
minetest.register_craft({ output = "xdecor:cushion 2", recipe = {{"wool:red", "wool:red"}} })
|
|
||||||
minetest.register_craft({ output = "xdecor:painting", recipe = {{"default:sign_wall", "dye:blue"}} })
|
minetest.register_craft({ output = "xdecor:cabinet_half 2",
|
||||||
minetest.register_craft({ output = "xdecor:moonbrick", recipe = {{"default:brick", "default:stone"}} })
|
recipe = {{"xdecor:cabinet"}} })
|
||||||
minetest.register_craft({ output = "xdecor:flint_steel", recipe = {{"default:obsidian_shard", "default:steel_ingot"}} })
|
|
||||||
|
minetest.register_craft({ output = "xdecor:cushion 2",
|
||||||
|
recipe = {{"wool:red", "wool:red"}} })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:painting",
|
||||||
|
recipe = {{"default:sign_wall", "dye:blue"}} })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:moonbrick",
|
||||||
|
recipe = {{"default:brick", "default:stone"}} })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:flint_steel",
|
||||||
|
recipe = {{"default:obsidian_shard", "default:steel_ingot"}} })
|
||||||
|
|
||||||
minetest.register_craft({ output = "xdecor:barrel", recipe = {
|
minetest.register_craft({ output = "xdecor:barrel", recipe = {
|
||||||
{"group:wood", "group:wood", "group:wood"},
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
@ -28,6 +39,10 @@ minetest.register_craft({ output = "xdecor:chair", recipe = {
|
|||||||
{"group:stick", "", ""},
|
{"group:stick", "", ""},
|
||||||
{"group:stick", "group:stick", "group:stick"},
|
{"group:stick", "group:stick", "group:stick"},
|
||||||
{"group:stick", "", "group:stick"} } })
|
{"group:stick", "", "group:stick"} } })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:chandelier", recipe = {
|
||||||
|
{"default:gold_ingot", "default:gold_ingot", "default:gold_ingot"},
|
||||||
|
{"default:torch", "default:torch", "default:torch"} } })
|
||||||
|
|
||||||
minetest.register_craft({ output = "xdecor:coalstone_tile 8", recipe = {
|
minetest.register_craft({ output = "xdecor:coalstone_tile 8", recipe = {
|
||||||
{"default:coalblock", "default:stone"},
|
{"default:coalblock", "default:stone"},
|
||||||
@ -46,6 +61,24 @@ minetest.register_craft({ output = "xdecor:frame", recipe = {
|
|||||||
{"group:stick", "group:stick", "group:stick"},
|
{"group:stick", "group:stick", "group:stick"},
|
||||||
{"group:stick", "default:paper", "group:stick"},
|
{"group:stick", "default:paper", "group:stick"},
|
||||||
{"group:stick", "group:stick", "group:stick"} } })
|
{"group:stick", "group:stick", "group:stick"} } })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:hammer", recipe = {
|
||||||
|
{"default:steel_ingot"},
|
||||||
|
{"group:stick"} } })
|
||||||
|
|
||||||
|
minetest.register_craftitem("xdecor:hammer", {
|
||||||
|
description = "Hammer",
|
||||||
|
inventory_image = "xdecor_hammer.png"})
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:lantern", recipe = {
|
||||||
|
{"default:iron_lump"},
|
||||||
|
{"default:torch"},
|
||||||
|
{"default:iron_lump"}} })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:metal_cabinet", recipe = {
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
|
||||||
|
{"", "", ""},
|
||||||
|
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} } })
|
||||||
|
|
||||||
minetest.register_craft({ output = "xdecor:multishelf", recipe = {
|
minetest.register_craft({ output = "xdecor:multishelf", recipe = {
|
||||||
{"group:wood", "group:wood", "group:wood"},
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
@ -62,6 +95,11 @@ minetest.register_craft({ output = "xdecor:rope 2", recipe = {
|
|||||||
{"farming:string"},
|
{"farming:string"},
|
||||||
{"farming:string"} } })
|
{"farming:string"} } })
|
||||||
|
|
||||||
|
minetest.register_craft({ output = "xdecor:stereo", recipe = {
|
||||||
|
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"},
|
||||||
|
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"},
|
||||||
|
{"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"} } })
|
||||||
|
|
||||||
minetest.register_craft({ output = "xdecor:stone_tile 2", recipe = {
|
minetest.register_craft({ output = "xdecor:stone_tile 2", recipe = {
|
||||||
{"default:cobble", "default:cobble"},
|
{"default:cobble", "default:cobble"},
|
||||||
{"default:cobble", "default:cobble"} } })
|
{"default:cobble", "default:cobble"} } })
|
||||||
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
moreblocks?
|
||||||
|
@ -5,7 +5,7 @@ local default_can_dig = function(pos,player)
|
|||||||
return meta:get_inventory():is_empty("main")
|
return meta:get_inventory():is_empty("main")
|
||||||
end
|
end
|
||||||
|
|
||||||
local fancy_gui = default.gui_bg..default.gui_bg_img..default.gui_slots
|
fancy_gui = default.gui_bg..default.gui_bg_img..default.gui_slots
|
||||||
local default_inventory_size = 32
|
local default_inventory_size = 32
|
||||||
local default_inventory_formspecs = {
|
local default_inventory_formspecs = {
|
||||||
["8"]="size[8,6]"..fancy_gui..
|
["8"]="size[8,6]"..fancy_gui..
|
||||||
|
1
init.lua
@ -6,3 +6,4 @@ dofile(modpath.."/handlers/registration.lua")
|
|||||||
dofile(modpath.."/crafts.lua")
|
dofile(modpath.."/crafts.lua")
|
||||||
dofile(modpath.."/itemframes.lua")
|
dofile(modpath.."/itemframes.lua")
|
||||||
dofile(modpath.."/nodes.lua")
|
dofile(modpath.."/nodes.lua")
|
||||||
|
dofile(modpath.."/workbench.lua")
|
||||||
|
@ -78,7 +78,9 @@ end
|
|||||||
xdecor.register("frame", {
|
xdecor.register("frame", {
|
||||||
description = "Item frame", groups = {snappy=3}, on_rotate = screwdriver.disallow,
|
description = "Item frame", groups = {snappy=3}, on_rotate = screwdriver.disallow,
|
||||||
node_box = { type = "fixed", fixed = {-0.5, -0.5, 7/16, 0.5, 0.5, 0.5} },
|
node_box = { type = "fixed", fixed = {-0.5, -0.5, 7/16, 0.5, 0.5, 0.5} },
|
||||||
tiles = {"xdecor_frame.png"}, inventory_image = "xdecor_frame.png",
|
tiles = {"xdecor_wood_tile.png", "xdecor_wood_tile.png", "xdecor_wood_tile.png",
|
||||||
|
"xdecor_wood_tile.png", "xdecor_wood_tile.png", "xdecor_frame.png"},
|
||||||
|
inventory_image = "xdecor_frame.png",
|
||||||
after_place_node = function(pos, placer, itemstack)
|
after_place_node = function(pos, placer, itemstack)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("owner", placer:get_player_name())
|
meta:set_string("owner", placer:get_player_name())
|
||||||
|
163
nodes.lua
@ -5,87 +5,104 @@ xdecor.register("barrel", {
|
|||||||
|
|
||||||
xdecor.register("cabinet", {
|
xdecor.register("cabinet", {
|
||||||
description = "Cabinet", inventory = {size=24}, infotext = "Cabinet",
|
description = "Cabinet", inventory = {size=24}, infotext = "Cabinet",
|
||||||
tiles = {"default_wood.png", "xdecor_cabinet_front.png"},
|
tiles = {"default_wood.png", "default_wood.png",
|
||||||
|
"default_wood.png", "default_wood.png",
|
||||||
|
"default_wood.png","xdecor_cabinet_front.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_wood_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_wood_defaults() })
|
||||||
|
|
||||||
xdecor.register("cabinet_half", {
|
xdecor.register("cabinet_half", {
|
||||||
description = "Half Cabinet", inventory = {size=8}, infotext = "Half Cabinet",
|
description = "Half Cabinet", inventory = {size=8}, infotext = "Half Cabinet",
|
||||||
tiles = {"default_wood.png", "xdecor_cabinet_half_front.png"},
|
tiles = {"default_wood.png", "default_wood.png",
|
||||||
|
"default_wood.png", "default_wood.png",
|
||||||
|
"default_wood.png", "xdecor_cabinet_half_front.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_wood_defaults(),
|
groups = {snappy=3}, sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = {type="fixed", fixed={{-0.5, 0, -0.5, 0.5, 0.5, 0.5}}} })
|
node_box = {type="fixed", fixed={{-0.5, 0, -0.5, 0.5, 0.5, 0.5}}} })
|
||||||
|
|
||||||
xdecor.register("candle", {
|
xdecor.register("candle", {
|
||||||
description = "Candle", light_source = 12,
|
description = "Candle", light_source = 12, drawtype = "torchlike",
|
||||||
inventory_image = "xdecor_candle_inv.png", drawtype = "torchlike",
|
inventory_image = "xdecor_candle_inv.png",
|
||||||
|
wield_image = "xdecor_candle_inv.png",
|
||||||
paramtype2 = "wallmounted", legacy_wallmounted = true,
|
paramtype2 = "wallmounted", legacy_wallmounted = true,
|
||||||
walkable = false, groups = {dig_immediate=3, attached_node=1},
|
walkable = false, groups = {dig_immediate=3, attached_node=1},
|
||||||
tiles = { {name="xdecor_candle_floor.png", animation={type="vertical_frames", length=1.5}},
|
tiles = { {name="xdecor_candle_floor.png",
|
||||||
{name="xdecor_candle_wall.png", animation={type="vertical_frames", length=1.5}} },
|
animation={type="vertical_frames", length=1.5}},
|
||||||
|
{name="xdecor_candle_wall.png",
|
||||||
|
animation={type="vertical_frames", length=1.5}} },
|
||||||
selection_box = {type="wallmounted",
|
selection_box = {type="wallmounted",
|
||||||
wall_bottom={-0.25, -0.5, -0.25, 0.25, 0.1, 0.25},
|
wall_bottom={-0.25, -0.5, -0.25, 0.25, 0.1, 0.25},
|
||||||
wall_side={-0.5, -0.35, -0.15, -0.15, 0.4, 0.15}} })
|
wall_side={-0.5, -0.35, -0.15, -0.15, 0.4, 0.15}} })
|
||||||
|
|
||||||
xdecor.register("cardboard_box", {
|
xdecor.register("cardboard_box", {
|
||||||
description = "Cardboard Box", groups = {snappy=3}, inventory = {size=8}, infotext = "Cardboard Box",
|
description = "Cardboard Box", groups = {snappy=3},
|
||||||
tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png", "xdecor_cardbox_sides.png"},
|
inventory = {size=8}, infotext = "Cardboard Box",
|
||||||
node_box = {type="fixed", fixed={{-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125}}} })
|
tiles = {"xdecor_cardbox_top.png", "xdecor_cardbox_top.png",
|
||||||
|
"xdecor_cardbox_sides.png"},
|
||||||
|
node_box = {type="fixed",
|
||||||
|
fixed={{-0.3125, -0.5, -0.3125, 0.3125, 0, 0.3125}}} })
|
||||||
|
|
||||||
xdecor.register("cauldron", {
|
xdecor.register("cauldron", {
|
||||||
description = "Cauldron", groups = {snappy=1},
|
description = "Cauldron", groups = {snappy=1},
|
||||||
tiles = {{name="xdecor_cauldron_top_anim.png",
|
tiles = {{name="xdecor_cauldron_top_anim.png",
|
||||||
animation={type="vertical_frames", length=3.0}}, "xdecor_cauldron_sides.png"} })
|
animation={type="vertical_frames", length=3.0}},
|
||||||
|
"xdecor_cauldron_sides.png"} })
|
||||||
|
|
||||||
xdecor.register("chair", {
|
xdecor.register("chair", {
|
||||||
description = "Chair", tiles = {"xdecor_wood.png"},
|
description = "Chair", tiles = {"xdecor_wood_tile.png"},
|
||||||
sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
|
sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
|
||||||
node_box = {type="fixed", fixed={
|
node_box = {type="fixed", fixed={
|
||||||
{-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125}, {0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
|
{-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125},
|
||||||
{-0.1875, 0.025, 0.22, 0.1875, 0.45, 0.28}, {-0.3125, -0.5, -0.3125, -0.1875, -0.125, -0.1875},
|
{0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
|
||||||
{0.1875, -0.5, -0.3125, 0.3125, -0.125, -0.1875}, {-0.3125, -0.125, -0.3125, 0.3125, 0, 0.1875}}} })
|
{-0.1875, 0.025, 0.22, 0.1875, 0.45, 0.28},
|
||||||
|
{-0.3125, -0.5, -0.3125, -0.1875, -0.125, -0.1875},
|
||||||
|
{0.1875, -0.5, -0.3125, 0.3125, -0.125, -0.1875},
|
||||||
|
{-0.3125, -0.125, -0.3125, 0.3125, 0, 0.1875}}} })
|
||||||
|
|
||||||
|
xdecor.register("chandelier", {
|
||||||
|
description = "Chandelier", drawtype = "plantlike", walkable = false,
|
||||||
|
inventory_image = "xdecor_chandelier.png", tiles = {"xdecor_chandelier.png"},
|
||||||
|
groups = {dig_immediate=3}, light_source = 15 })
|
||||||
|
|
||||||
xdecor.register("coalstone_tile", {
|
xdecor.register("coalstone_tile", {
|
||||||
description = "Coalstone Tile", tiles = {"xdecor_coalstone_tile.png"},
|
description = "Coalstone Tile", tiles = {"xdecor_coalstone_tile.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
||||||
|
|
||||||
local curtaincolors = { {"red", "#ad2323e0:175"} } -- add more curtains simply here
|
local curtaincolors = {"red"} -- add more curtains simply here
|
||||||
for c in ipairs(curtaincolors) do
|
for _, c in ipairs(curtaincolors) do
|
||||||
local color = curtaincolors[c][1]
|
xdecor.register("curtain_"..c, {
|
||||||
local hue = curtaincolors[c][2]
|
description = "Curtain ("..c..")", use_texture_alpha = true, walkable = false,
|
||||||
|
tiles = {"xdecor_curtain.png^[colorize:"..c..":130"},
|
||||||
xdecor.register("curtain_"..color, {
|
inventory_image = "xdecor_curtain_open.png^[colorize:"..c..":130",
|
||||||
description = "Curtain ("..color..")", tiles = {"xdecor_curtain.png^[colorize:"..hue},
|
wield_image = "xdecor_curtain.png^[colorize:"..c..":130",
|
||||||
inventory_image = "xdecor_curtain_open.png^[colorize:"..hue,
|
|
||||||
drawtype = "signlike", paramtype2 = "wallmounted",
|
drawtype = "signlike", paramtype2 = "wallmounted",
|
||||||
use_texture_alpha = true, walkable = false,
|
|
||||||
groups = {dig_immediate=3}, selection_box = {type="wallmounted"},
|
groups = {dig_immediate=3}, selection_box = {type="wallmounted"},
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
local fdir = node.param2
|
local fdir = node.param2
|
||||||
minetest.set_node(pos, {name = "xdecor:curtain_open_"..color, param2 = fdir})
|
minetest.set_node(pos, {name="xdecor:curtain_open_"..c, param2=fdir})
|
||||||
end })
|
end })
|
||||||
|
|
||||||
xdecor.register("curtain_open_"..color, {
|
xdecor.register("curtain_open_"..c, {
|
||||||
tiles = { "xdecor_curtain_open.png^[colorize:"..hue },
|
tiles = { "xdecor_curtain_open.png^[colorize:"..c..":130" },
|
||||||
drawtype = "signlike", paramtype2 = "wallmounted",
|
drawtype = "signlike", paramtype2 = "wallmounted",
|
||||||
use_texture_alpha = true, walkable = false,
|
use_texture_alpha = true, walkable = false,
|
||||||
groups = {dig_immediate=3, not_in_creative_inventory=1},
|
groups = {dig_immediate=3, not_in_creative_inventory=1},
|
||||||
selection_box = {type="wallmounted"}, drop = "xdecor:curtain_"..color,
|
selection_box = {type="wallmounted"}, drop = "xdecor:curtain_"..c,
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
local fdir = node.param2
|
local fdir = node.param2
|
||||||
minetest.set_node(pos, { name = "xdecor:curtain_"..color, param2 = fdir })
|
minetest.set_node(pos, { name="xdecor:curtain_"..c, param2=fdir })
|
||||||
end })
|
end })
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "xdecor:curtain_"..color.." 4",
|
output = "xdecor:curtain_"..c.." 4",
|
||||||
recipe = {{"", "wool:"..color, ""},
|
recipe = {{"", "wool:"..c, ""},
|
||||||
{"", "wool:"..color, ""},
|
{"", "wool:"..c, ""},
|
||||||
{"", "wool:"..color, ""}} })
|
{"", "wool:"..c, ""}} })
|
||||||
end
|
end
|
||||||
|
|
||||||
xdecor.register("cushion", {
|
xdecor.register("cushion", {
|
||||||
description = "Cushion", tiles = {"xdecor_cushion.png"},
|
description = "Cushion", tiles = {"xdecor_cushion.png"},
|
||||||
groups = {snappy=3}, on_place = minetest.rotate_node,
|
groups = {snappy=3}, on_place = minetest.rotate_node,
|
||||||
node_box = {type="fixed", fixed={{-0.5, -0.5, -0.5, 0.5, 0, 0.5}}} })
|
node_box = {type="fixed", fixed={{-0.5, -0.5, -0.5, 0.5, 0, 0.5}}} })
|
||||||
|
|
||||||
xdecor.register("empty_shelf", {
|
xdecor.register("empty_shelf", {
|
||||||
description = "Empty Shelf", inventory = {size=24}, infotext = "Empty Shelf",
|
description = "Empty Shelf", inventory = {size=24}, infotext = "Empty Shelf",
|
||||||
tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
|
tiles = {"default_wood.png", "xdecor_empty_shelf.png"},
|
||||||
@ -98,12 +115,14 @@ xdecor.register("fence_wrought_iron", {
|
|||||||
|
|
||||||
xdecor.register("fire", {
|
xdecor.register("fire", {
|
||||||
description = "Fake Fire", light_source = 14, walkable = false,
|
description = "Fake Fire", light_source = 14, walkable = false,
|
||||||
tiles = {{name="xdecor_fire_anim.png", animation={type="vertical_frames", length=1.5}}},
|
tiles = {{name="xdecor_fire_anim.png",
|
||||||
|
animation={type="vertical_frames", length=1.5}}},
|
||||||
drawtype = "plantlike", damage_per_second = 2, drop = "",
|
drawtype = "plantlike", damage_per_second = 2, drop = "",
|
||||||
groups = {dig_immediate=3, not_in_creative_inventory=1} })
|
groups = {dig_immediate=3, not_in_creative_inventory=1} })
|
||||||
|
|
||||||
minetest.register_tool("xdecor:flint_steel", {
|
minetest.register_tool("xdecor:flint_steel", {
|
||||||
description = "Flint & Steel", stack_max = 1, inventory_image = "xdecor_flint_steel.png",
|
description = "Flint & Steel", stack_max = 1,
|
||||||
|
inventory_image = "xdecor_flint_steel.png",
|
||||||
tool_capabilities = {groupcaps={flamable={uses=65, maxlevel=1}}},
|
tool_capabilities = {groupcaps={flamable={uses=65, maxlevel=1}}},
|
||||||
on_use = function(itemstack, user, pointed_thing)
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type == "node" and minetest.get_node(pointed_thing.above).name == "air" then
|
if pointed_thing.type == "node" and minetest.get_node(pointed_thing.above).name == "air" then
|
||||||
@ -116,10 +135,23 @@ minetest.register_tool("xdecor:flint_steel", {
|
|||||||
return itemstack
|
return itemstack
|
||||||
end })
|
end })
|
||||||
|
|
||||||
|
xdecor.register("lantern", {
|
||||||
|
description = "Lantern", light_source = 12, drawtype = "torchlike",
|
||||||
|
inventory_image = "xdecor_lantern_floor.png",
|
||||||
|
wield_image = "xdecor_lantern_floor.png",
|
||||||
|
paramtype2 = "wallmounted", legacy_wallmounted = true,
|
||||||
|
walkable = false, groups = {dig_immediate=3, attached_node=1},
|
||||||
|
tiles = {"xdecor_lantern_floor.png", "xdecor_lantern_ceiling.png", "xdecor_lantern.png"},
|
||||||
|
selection_box = {type="wallmounted",
|
||||||
|
wall_top = {-0.25, -0.4, -0.25, 0.25, 0.5, 0.25},
|
||||||
|
wall_bottom = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25},
|
||||||
|
wall_side = {-0.5, -0.5, -0.15, 0.5, 0.5, 0.15}} })
|
||||||
|
|
||||||
flowerstype = {"dandelion_white", "dandelion_yellow", "geranium", "rose", "tulip", "viola"}
|
flowerstype = {"dandelion_white", "dandelion_yellow", "geranium", "rose", "tulip", "viola"}
|
||||||
for _, f in ipairs(flowerstype) do
|
for _, f in ipairs(flowerstype) do
|
||||||
xdecor.register("potted_"..f, {
|
xdecor.register("potted_"..f, {
|
||||||
description = "Potted Flowers ("..f..")", walkable = false, groups = {dig_immediate=3},
|
description = "Potted Flowers ("..f..")", walkable = false,
|
||||||
|
groups = {dig_immediate=3},
|
||||||
tiles = {"xdecor_"..f.."_pot.png"}, inventory_image = "xdecor_"..f.."_pot.png",
|
tiles = {"xdecor_"..f.."_pot.png"}, inventory_image = "xdecor_"..f.."_pot.png",
|
||||||
drawtype = "plantlike", sounds = default.node_sound_leaves_defaults() })
|
drawtype = "plantlike", sounds = default.node_sound_leaves_defaults() })
|
||||||
|
|
||||||
@ -129,57 +161,72 @@ minetest.register_craft({
|
|||||||
end
|
end
|
||||||
|
|
||||||
xdecor.register("painting", {
|
xdecor.register("painting", {
|
||||||
description = "Painting", drawtype = "signlike", tiles = {"xdecor_painting.png"},
|
description = "Painting", drawtype = "signlike",
|
||||||
|
tiles = {"xdecor_painting.png"}, inventory_image = "xdecor_painting.png",
|
||||||
paramtype2 = "wallmounted", legacy_wallmounted = true, walkable = false,
|
paramtype2 = "wallmounted", legacy_wallmounted = true, walkable = false,
|
||||||
inventory_image = "xdecor_painting.png", selection_box = {type = "wallmounted"},
|
wield_image = "xdecor_painting.png", selection_box = {type = "wallmounted"},
|
||||||
groups = {dig_immediate=3, attached_node=1}, sounds = default.node_sound_wood_defaults() })
|
groups = {dig_immediate=3, attached_node=1},
|
||||||
|
sounds = default.node_sound_wood_defaults() })
|
||||||
|
|
||||||
xdecor.register("plant_pot", {
|
xdecor.register("plant_pot", {
|
||||||
description = "Plant Pot", groups = {snappy=3},
|
description = "Plant Pot", groups = {snappy=3},
|
||||||
tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_sides.png"} })
|
tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_sides.png"} })
|
||||||
|
|
||||||
|
xdecor.register("metal_cabinet", {
|
||||||
|
description = "Metal Cabinet", inventory = {size=24},
|
||||||
|
tiles = {"xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
|
||||||
|
"xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_sides.png",
|
||||||
|
"xdecor_metal_cabinet_sides.png", "xdecor_metal_cabinet_front.png"},
|
||||||
|
groups = {snappy=2}, infotext = "Metal Cabinet" })
|
||||||
|
|
||||||
xdecor.register("moonbrick", {
|
xdecor.register("moonbrick", {
|
||||||
description = "Moonbrick", tiles = {"xdecor_moonbrick.png"},
|
description = "Moonbrick", tiles = {"xdecor_moonbrick.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
||||||
|
|
||||||
xdecor.register("multishelf", {
|
xdecor.register("multishelf", {
|
||||||
description = "Multishelf", inventory = {size=24}, infotext = "Multishelf",
|
description = "Multi Shelf", inventory = {size=24}, infotext = "Multi Shelf",
|
||||||
tiles = {"default_wood.png", "xdecor_multishelf.png"},
|
tiles = {"default_wood.png", "xdecor_multishelf.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_wood_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_wood_defaults() })
|
||||||
|
|
||||||
local rope_sbox = {type="fixed", fixed={-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}}
|
local rope_sbox = {type="fixed", fixed={-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}}
|
||||||
xdecor.register("rope", {
|
xdecor.register("rope", {
|
||||||
description = "Rope", walkable = false, climbable = true,
|
description = "Rope", walkable = false, climbable = true,
|
||||||
tiles = {"xdecor_rope.png"}, inventory_image = "xdecor_rope_inv.png",
|
groups = {dig_immediate=3}, selection_box = rope_sbox,
|
||||||
drawtype = "plantlike", groups = {dig_immediate=3}, selection_box = rope_sbox })
|
tiles = {"xdecor_rope.png"}, inventory_image = "xdecor_rope_inv.png",
|
||||||
|
wield_image = "xdecor_rope_inv.png", drawtype = "plantlike" })
|
||||||
|
|
||||||
|
xdecor.register("stereo", {
|
||||||
|
description = "Stereo", groups = {snappy=3},
|
||||||
|
tiles = {"xdecor_stereo_top.png", "xdecor_stereo_bottom.png",
|
||||||
|
"xdecor_stereo_left.png^[transformFX", "xdecor_stereo_left.png",
|
||||||
|
"xdecor_stereo_back.png", "xdecor_stereo_front.png"} })
|
||||||
|
|
||||||
xdecor.register("stone_rune", {
|
xdecor.register("stone_rune", {
|
||||||
description = "Stone Rune", tiles = {"xdecor_stone_rune.png"},
|
description = "Stone Rune", tiles = {"xdecor_stone_rune.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
||||||
|
|
||||||
xdecor.register("stone_tile", {
|
xdecor.register("stone_tile", {
|
||||||
description = "Stone Tile", tiles = {"xdecor_stone_tile.png"},
|
description = "Stone Tile", tiles = {"xdecor_stone_tile.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
groups = {snappy=3}, sounds = default.node_sound_stone_defaults() })
|
||||||
|
|
||||||
xdecor.register("table", {
|
xdecor.register("table", {
|
||||||
description = "Table", tiles = {"xdecor_wood.png"},
|
description = "Table", tiles = {"xdecor_wood_tile.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_wood_defaults(),
|
groups = {snappy=3}, sounds = default.node_sound_wood_defaults(),
|
||||||
node_box = {type="fixed", fixed={
|
node_box = {type="fixed", fixed={
|
||||||
{-0.5, 0.4, -0.5, 0.5, 0.5, 0.5}, {-0.15, -0.5, -0.15, 0.15, 0.4, 0.15}}} })
|
{-0.5, 0.4, -0.5, 0.5, 0.5, 0.5},
|
||||||
|
{-0.15, -0.5, -0.15, 0.15, 0.4, 0.15}}} })
|
||||||
|
|
||||||
xdecor.register("tv", {
|
xdecor.register("tv", {
|
||||||
description = "Television", light_source = 11, groups = {snappy=3},
|
description = "Television", light_source = 11, groups = {snappy=3},
|
||||||
tiles = {"xdecor_television_left.png^[transformR270", "xdecor_television_left.png^[transformR90",
|
tiles = {
|
||||||
"xdecor_television_left.png^[transformFX", "xdecor_television_left.png",
|
"xdecor_television_left.png^[transformR270",
|
||||||
"xdecor_television_back.png", {name="xdecor_television_front_animated.png",
|
"xdecor_television_left.png^[transformR90",
|
||||||
|
"xdecor_television_left.png^[transformFX",
|
||||||
|
"xdecor_television_left.png",
|
||||||
|
"xdecor_television_back.png",
|
||||||
|
{name="xdecor_television_front_animated.png",
|
||||||
animation = {type="vertical_frames", length=80.0}}} })
|
animation = {type="vertical_frames", length=80.0}}} })
|
||||||
|
|
||||||
xdecor.register("wood_tile", {
|
xdecor.register("wood_tile", {
|
||||||
description = "Wood Tile", tiles = {"xdecor_wood_tile.png"},
|
description = "Wood Tile", tiles = {"xdecor_wood_tile.png"},
|
||||||
groups = {snappy=3}, sounds = default.node_sound_wood_defaults() })
|
groups = {snappy=3, wood=1}, sounds = default.node_sound_wood_defaults() })
|
||||||
|
|
||||||
xdecor.register("workbench", {
|
|
||||||
description = "Work Bench", inventory = {size=24}, infotext = "Work Bench",
|
|
||||||
sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
|
|
||||||
tiles = {"xdecor_workbench_top.png", "xdecor_workbench_top.png", "xdecor_workbench_sides.png", "xdecor_workbench_sides.png",
|
|
||||||
"xdecor_workbench_front.png", "xdecor_workbench_front.png"} })
|
|
||||||
|
BIN
textures/xdecor_chandelier.png
Normal file
After Width: | Height: | Size: 332 B |
BIN
textures/xdecor_hammer.png
Normal file
After Width: | Height: | Size: 198 B |
BIN
textures/xdecor_lantern.png
Normal file
After Width: | Height: | Size: 297 B |
BIN
textures/xdecor_lantern_ceiling.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
textures/xdecor_lantern_floor.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
textures/xdecor_metal_cabinet_front.png
Normal file
After Width: | Height: | Size: 216 B |
BIN
textures/xdecor_metal_cabinet_sides.png
Normal file
After Width: | Height: | Size: 128 B |
BIN
textures/xdecor_saw.png
Normal file
After Width: | Height: | Size: 192 B |
BIN
textures/xdecor_stereo_back.png
Normal file
After Width: | Height: | Size: 146 B |
BIN
textures/xdecor_stereo_bottom.png
Normal file
After Width: | Height: | Size: 154 B |
BIN
textures/xdecor_stereo_front.png
Normal file
After Width: | Height: | Size: 167 B |
BIN
textures/xdecor_stereo_left.png
Normal file
After Width: | Height: | Size: 107 B |
BIN
textures/xdecor_stereo_top.png
Normal file
After Width: | Height: | Size: 99 B |
Before Width: | Height: | Size: 220 B |
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 220 B |
115
workbench.lua
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
-- Repair Tool's code by Krock, modified by kilbith
|
||||||
|
|
||||||
|
xdecor.register("workbench", {
|
||||||
|
description = "Work Bench", infotext = "Work Bench",
|
||||||
|
sounds = default.node_sound_wood_defaults(), groups = {snappy=3},
|
||||||
|
tiles = {"xdecor_workbench_top.png", "xdecor_workbench_top.png",
|
||||||
|
"xdecor_workbench_sides.png", "xdecor_workbench_sides.png",
|
||||||
|
"xdecor_workbench_front.png", "xdecor_workbench_front.png"},
|
||||||
|
on_construct = function(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
meta:set_string("formspec", "size[8,7;]"..fancy_gui..
|
||||||
|
"label[0,0;Cut your wood into...]"..
|
||||||
|
"label[0,1.5;Input]"..
|
||||||
|
"list[current_name;input;0,2;1,1;]"..
|
||||||
|
"image[1,2;1,1;xdecor_saw.png]"..
|
||||||
|
"label[2,1.5;Output]"..
|
||||||
|
"list[current_name;output;2,2;1,1;]"..
|
||||||
|
"label[5.5,0;Damaged tool]"..
|
||||||
|
"list[current_name;src;6,0.5;1,1;]"..
|
||||||
|
"image[4.35,1.1;1.5,1.5;xdecor_hammer.png]"..
|
||||||
|
"label[5.8,1.5;Hammer]]"..
|
||||||
|
"list[current_name;fuel;6,2;1,1;]"..
|
||||||
|
"item_image_button[0,0.5;1,1;xdecor:microslab_wood;microslab; ]"..
|
||||||
|
"item_image_button[1,0.5;1,1;xdecor:microslab_half_wood;microslabhalf; ]"..
|
||||||
|
"item_image_button[2,0.5;1,1;xdecor:microcube_wood;microcube; ]"..
|
||||||
|
"item_image_button[3,0.5;1,1;xdecor:panel_wood;panel; ]"..
|
||||||
|
"list[current_player;main;0,3.25;8,4;]")
|
||||||
|
meta:set_string("infotext", "Work Bench")
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
inv:set_size("output", 1)
|
||||||
|
inv:set_size("input", 1)
|
||||||
|
inv:set_size("src", 1)
|
||||||
|
inv:set_size("fuel", 1)
|
||||||
|
end,
|
||||||
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local shape = {}
|
||||||
|
local anz = 0
|
||||||
|
|
||||||
|
if fields["microslab"] then
|
||||||
|
anz = "8"
|
||||||
|
shape = "xdecor:microslab_wood"
|
||||||
|
elseif fields["microslabhalf"] then
|
||||||
|
anz = "16"
|
||||||
|
shape = "xdecor:microslab_half_wood"
|
||||||
|
elseif fields["microcube"] then
|
||||||
|
anz = "8"
|
||||||
|
shape = "xdecor:microcube_wood"
|
||||||
|
elseif fields["panel"] then
|
||||||
|
anz = "4"
|
||||||
|
shape = "xdecor:panel_wood"
|
||||||
|
else return end
|
||||||
|
|
||||||
|
local inputstack = inv:get_stack("input", 1)
|
||||||
|
if minetest.get_item_group(inputstack:get_name(), "wood") ~= 0 then
|
||||||
|
local give = {}
|
||||||
|
for i = 0, anz-1 do
|
||||||
|
give[i+1] = inv:add_item("output", shape)
|
||||||
|
end
|
||||||
|
inputstack:take_item()
|
||||||
|
inv:set_stack("input", 1, inputstack)
|
||||||
|
else return end
|
||||||
|
end,
|
||||||
|
can_dig = function(pos, player)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
return inv:is_empty("src") and inv:is_empty("fuel")
|
||||||
|
and inv:is_empty("input") and inv:is_empty("output")
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
local function register_wood_cut(name, desc, box, f_groups)
|
||||||
|
f_groups = {}
|
||||||
|
f_groups.snappy = 3
|
||||||
|
f_groups.not_in_creative_inventory = 1
|
||||||
|
xdecor.register(name.."_wood", {
|
||||||
|
description = "Wood "..desc,
|
||||||
|
tiles = {"xdecor_wood_tile.png"}, groups = f_groups,
|
||||||
|
sounds = default.node_sound_wood_defaults(),
|
||||||
|
node_box = { type = "fixed", fixed = box } }) end
|
||||||
|
|
||||||
|
wood = {}
|
||||||
|
wood.datas = {
|
||||||
|
{"microslab", "Microslab", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0.5 }},
|
||||||
|
{"microslab_half", "Half Microslab", { -0.5, -0.5, -0.5, 0.5, -0.4375, 0 }},
|
||||||
|
{"microcube", "Microcube", { -0.5, -0.5, -0.5, 0, 0, 0 }},
|
||||||
|
{"panel", "Panel", { -0.5, -0.5, -0.5, 0.5, 0, 0 }},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, item in pairs(wood.datas) do
|
||||||
|
register_wood_cut(unpack(item))
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"xdecor:workbench"},
|
||||||
|
interval = 5, chance = 1,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local src = inv:get_stack("src", 1)
|
||||||
|
local wear = src:get_wear()
|
||||||
|
local repair = -1400
|
||||||
|
|
||||||
|
if (src:is_empty() or wear == 0 or wear == 65535) then return end
|
||||||
|
local fuel = inv:get_stack("fuel", 1)
|
||||||
|
if (fuel:is_empty() or fuel:get_name() ~= "xdecor:hammer") then return end
|
||||||
|
|
||||||
|
if (wear + repair < 0) then src:add_wear(repair + wear)
|
||||||
|
else src:add_wear(repair) end
|
||||||
|
|
||||||
|
inv:set_stack("src", 1, src)
|
||||||
|
inv:remove_item("fuel", "xdecor:hammer 1")
|
||||||
|
end
|
||||||
|
})
|