commit 5559031a0f9add251f82d8cfbe91a5e8d9813f51 Author: kilbith Date: Tue Jun 9 14:04:57 2015 +0200 Init diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..da5f1a7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,4 @@ +This work is licensed under the Creative Commons Attribution-ShareAlike +4.0 International License. To view a copy of this license, visit +http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to +Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..a501198 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +## X-Decor ## + +#### Minimal decoration mod for Minetest that aims to be simple and light. #### +#### It provides just the essential made of cute pixels and cubes. #### + +### Credits ### + +#### Textures : Gambit, VanessaE, kilbith. #### +#### Code : VanessaE, t4im, kilbith. #### + +![Preview](http://i.imgur.com/teTQM6V.png) diff --git a/building.lua b/building.lua new file mode 100644 index 0000000..c99b698 --- /dev/null +++ b/building.lua @@ -0,0 +1,37 @@ +xdecor.register("moonbrick", { + description = "Moonbrick", + tiles = {"xdecor_moonbrick.png"}, + groups = {snappy=3}, + sounds = default.node_sound_stone_defaults() +}) + +xdecor.register("wood_tile", { + description = "Wood tile", + tiles = {"xdecor_wood_tile.png"}, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults() +}) + +xdecor.register("coalstone_tile", { + description = "Coalstone tile", + tiles = {"xdecor_coalstone_tile.png"}, + groups = {snappy=3}, + sounds = default.node_sound_stone_defaults() +}) + +fence_material = {"brass", "wrought_iron"} + +for _, m in ipairs(fence_material) do +xdecor.register("fence_"..m, { + description = "Fence ("..m..")", + drawtype = "fencelike", + tiles = {"xdecor_"..m..".png"}, + inventory_image = "default_fence_overlay.png^xdecor_"..m..".png^default_fence_overlay.png^[makealpha:255,126,126", + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), +}) +end diff --git a/crafts.lua b/crafts.lua new file mode 100644 index 0000000..5ffa217 --- /dev/null +++ b/crafts.lua @@ -0,0 +1,191 @@ +minetest.register_craft({ + output = "xdecor:barrel", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"default:iron_lump", "", "default:iron_lump"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +minetest.register_craftitem("xdecor:brass_ingot", { + description = "Brass ingot", + inventory_image = "xdecor_brass_ingot.png", +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:brass_ingot", + recipe = {"default:copper_ingot", "moreores:tin_ingot"} +}) + +minetest.register_craft({ + output = "xdecor:cabinet", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"doors:trapdoor", "", "doors:trapdoor"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +minetest.register_craft({ + output = "xdecor:cabinet_half 2", + recipe = { {"xdecor:cabinet"} } +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:candle 2", + recipe = {"default:torch", "farming:string"} +}) + +minetest.register_craft({ + output = "xdecor:cardboard_box", + recipe = { + {"default:paper", "default:paper", "default:paper"}, + {"default:paper", "default:paper", "default:paper"} + } +}) + +minetest.register_craft({ + output = "xdecor:cauldron", + recipe = { + {"default:iron_lump", "", "default:iron_lump"}, + {"default:iron_lump", "default:water_source", "default:iron_lump"}, + {"default:iron_lump", "default:iron_lump", "default:iron_lump"} + } +}) + +minetest.register_craft({ + output = "xdecor:chair 2", + recipe = { + {"group:wood", "", ""}, + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "", "group:wood"} + } +}) + +minetest.register_craft({ + output = "xdecor:coalstone_tile 8", + recipe = { + {"default:coalblock", "default:stone"}, + {"default:stone", "default:coalblock"} + } +}) + +minetest.register_craft({ + output = "xdecor:cushion 2", + recipe = { + {"wool:red", "wool:red", "wool:red"} + } +}) + +minetest.register_craft({ + output = "xdecor:fence_brass 4", + recipe = { + {"xdecor:brass_ingot", "xdecor:brass_ingot", "xdecor:brass_ingot"}, + {"xdecor:brass_ingot", "xdecor:brass_ingot", "xdecor:brass_ingot"} + } +}) + +minetest.register_craft({ + output = "xdecor:fence_wrought_iron 4", + recipe = { + {"default:iron_lump", "default:iron_lump", "default:iron_lump"}, + {"default:iron_lump", "default:iron_lump", "default:iron_lump"} + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:flint_steel", + recipe = {"default:obsidian_shard", "default:steel_ingot"} +}) + +minetest.register_craft({ + output = "xdecor:frame", + recipe = { + {"group:stick", "group:stick", "group:stick"}, + {"group:stick", "default:paper", "group:stick"}, + {"group:stick", "group:stick", "group:stick"}, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:moonbrick", + recipe = {"default:brick", "default:stone"} +}) + +minetest.register_craft({ + output = "xdecor:multishelf", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"xdecor:skull", "group:book", "group:vessel"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:painting", + recipe = {"default:sign_wall", "dye:blue"} +}) + +minetest.register_craft({ + output = "xdecor:plant_pot 2", + recipe = { + {"default:clay_lump", "", "default:clay_lump"}, + {"default:clay_lump", "default:dirt", "default:clay_lump"}, + {"default:clay_lump", "default:clay_lump", "default:clay_lump"} + } +}) + +minetest.register_craft({ + output = "xdecor:rope 2", + recipe = { + {"farming:string"}, + {"farming:string"}, + {"farming:string"} + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:skull", + recipe = {"bones:bones"} +}) + +minetest.register_craft({ + output = "xdecor:table 2", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"", "group:wood", ""}, + {"", "group:wood", ""} + } +}) + +minetest.register_craft({ + output = "xdecor:tv", + recipe = { + {"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:glass", "default:steel_ingot"}, + {"default:steel_ingot", "default:copper_ingot", "default:steel_ingot"} + } +}) + +minetest.register_craft({ + output = "xdecor:workbench", + recipe = { + {"group:wood", "group:wood", "group:wood"}, + {"screwdriver:screwdriver", "screwdriver:screwdriver", "screwdriver:screwdriver"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +minetest.register_craft({ + output = "xdecor:wood_tile 2", + recipe = { + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..d0592c1 --- /dev/null +++ b/depends.txt @@ -0,0 +1,3 @@ +default +moreblocks? +moreores? diff --git a/furniture.lua b/furniture.lua new file mode 100644 index 0000000..5dc3e2b --- /dev/null +++ b/furniture.lua @@ -0,0 +1,94 @@ +xdecor.register("chair", { + description = "Chair", + tiles = {"xdecor_wood.png"}, + sounds = default.node_sound_wood_defaults(), + groups = {snappy=3}, + 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.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("cushion", { + description = "Cushion", + tiles = {"xdecor_cushion.png"}, + groups = {snappy=3}, + on_place = minetest.rotate_node, + node_box = { + type = "fixed", + fixed = { {-0.5, -0.5, -0.5, 0.5, 0, 0.5} } + } +}) + +local curtaincolors = { + { "red", "#ad2323e0:175" }, + { "white", "#ffffffe0:175" } +} + +for c in ipairs(curtaincolors) do + local color = curtaincolors[c][1] + local hue = curtaincolors[c][2] + local color_d = curtaincolors[c][1] + + xdecor.register("curtain_"..color, { + description = "Curtain ("..color_d..")", + tiles = {"xdecor_curtain.png^[colorize:"..hue }, + inventory_image = "xdecor_curtain_open.png^[colorize:"..hue, + drawtype = "signlike", + use_texture_alpha = true, + walkable = false, + groups = {dig_immediate=3}, + paramtype2 = "wallmounted", + selection_box = {type = "wallmounted"}, + on_rightclick = function(pos, node, clicker, itemstack) + local fdir = node.param2 + minetest.set_node(pos, { name = "xdecor:curtain_open_"..color, param2 = fdir }) + end + }) + + xdecor.register("curtain_open_"..color, { + tiles = { "xdecor_curtain_open.png^[colorize:"..hue }, + drawtype = "signlike", + use_texture_alpha = true, + walkable = false, + groups = {dig_immediate=3, not_in_creative_inventory=1}, + paramtype2 = "wallmounted", + selection_box = {type = "wallmounted"}, + drop = "xdecor:curtain_"..color, + on_rightclick = function(pos, node, clicker, itemstack) + local fdir = node.param2 + minetest.set_node(pos, { name = "xdecor:curtain_"..color, param2 = fdir }) + end + }) + + minetest.register_craft({ + output = "xdecor:curtain_"..color.." 4", + recipe = { + {"", "wool:"..color, ""}, + {"", "wool:"..color, ""}, + {"", "wool:"..color, ""} + } + }) + +end + +xdecor.register("table", { + description = "Table", + tiles = {"xdecor_wood.png"}, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + 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} + } + } +}) diff --git a/handlers/nodeboxes.lua b/handlers/nodeboxes.lua new file mode 100644 index 0000000..79d1be8 --- /dev/null +++ b/handlers/nodeboxes.lua @@ -0,0 +1,28 @@ +xdecor.box = { + slab_y = function(height, shift) return { -0.5, -0.5+(shift or 0), -0.5, 0.5, -0.5+height+(shift or 0), 0.5 } end, + slab_z = function(depth) return { -0.5, -0.5, -0.5+depth, 0.5, 0.5, 0.5 } end, + bar_y = function(radius) return {-radius, -0.5, -radius, radius, 0.5, radius} end, + cuboid = function(radius_x, radius_y, radius_z) return {-radius_x, -radius_y, -radius_z, radius_x, radius_y, radius_z} end +} + +xdecor.nodebox = { + regular = { type="regular" }, + null = { type = "fixed", fixed = { 0, 0, 0, 0, 0, 0 } } +} + +local mt = {} +mt.__index = function(table, key) + local ref = xdecor.box[key] + local ref_type = type(ref) + if ref_type == "function" then + return function(...) + return { type = "fixed", fixed = ref(...) } + end + elseif ref_type == "table" then + return { type = "fixed", fixed = ref } + elseif ref_type == "nil" then + error(key .. "could not be found among nodebox presets and functions") + end + error("unexpected datatype " .. tostring(type(ref)) .. " while looking for " .. key) +end +setmetatable(xdecor.nodebox, mt) diff --git a/handlers/registration.lua b/handlers/registration.lua new file mode 100644 index 0000000..1bcb404 --- /dev/null +++ b/handlers/registration.lua @@ -0,0 +1,76 @@ +xdecor = xdecor or {} + +local default_can_dig = function(pos,player) + local meta = minetest.get_meta(pos) + return meta:get_inventory():is_empty("main") +end + +local fancy_gui = default.gui_bg..default.gui_bg_img..default.gui_slots +local default_inventory_size = 32 +local default_inventory_formspecs = { + ["8"]="size[8,6]"..fancy_gui.. + "list[context;main;0,0;8,1;]".. + "list[current_player;main;0,2;8,4;]", + + ["16"]="size[8,7]"..fancy_gui.. + "list[context;main;0,0;8,2;]".. + "list[current_player;main;0,3;8,4;]", + + ["24"]="size[8,8]" ..fancy_gui.. + "list[context;main;0,0;8,3;]".. + "list[current_player;main;0,4;8,4;]", + + ["32"]="size[8,9]" ..fancy_gui.. + "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]".. + default.get_hotbar_bg(0,4.85), +} + +local function get_formspec_by_size(size) + local formspec = default_inventory_formspecs[tostring(size)] + return formspec or default_inventory_formspecs +end + +function xdecor.register(name, def) + def.drawtype = def.drawtype or (def.node_box and "nodebox") + def.paramtype = def.paramtype or "light" + def.paramtype2 = def.paramtype2 or "facedir" + + local infotext = def.infotext + local inventory = def.inventory + def.inventory = nil + + if inventory then + def.on_construct = def.on_construct or function(pos) + local meta = minetest.get_meta(pos) + if infotext then + meta:set_string("infotext", infotext) + end + local size = inventory.size or default_inventory_size + meta:get_inventory():set_size("main", size) + meta:set_string("formspec", inventory.formspec or get_formspec_by_size(size)) + end + + def.can_dig = def.can_dig or default_can_dig + def.on_metadata_inventory_move = def.on_metadata_inventory_move or function(pos, from_list, from_index, to_list, to_index, count, player) + minetest.log("action", "%s moves stuff in %s at %s"):format( + player:get_player_name(), name, minetest.pos_to_string(pos)) + end + def.on_metadata_inventory_put = def.on_metadata_inventory_put or function(pos, listname, index, stack, player) + minetest.log("action", "%s moves stuff to %s at %s"):format( + player:get_player_name(), name, minetest.pos_to_string(pos)) + end + def.on_metadata_inventory_take = def.on_metadata_inventory_take or function(pos, listname, index, stack, player) + minetest.log("action", "%s takes stuff from %s at %s"):format( + player:get_player_name(), name, minetest.pos_to_string(pos)) + end + elseif infotext and not def.on_construct then + def.on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", infotext) + end + end + + minetest.register_node("xdecor:" .. name, def) +end diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..38b587d --- /dev/null +++ b/init.lua @@ -0,0 +1,14 @@ +xdecor = {} + +modpath = minetest.get_modpath("xdecor") + +dofile(modpath.."/handlers/nodeboxes.lua") +dofile(modpath.."/handlers/registration.lua") + +dofile(modpath.."/building.lua") +dofile(modpath.."/crafts.lua") +dofile(modpath.."/itemframes.lua") +dofile(modpath.."/furniture.lua") +dofile(modpath.."/lighting.lua") +dofile(modpath.."/misc.lua") +dofile(modpath.."/storage.lua") diff --git a/itemframes.lua b/itemframes.lua new file mode 100644 index 0000000..adcbc97 --- /dev/null +++ b/itemframes.lua @@ -0,0 +1,125 @@ +local tmp = {} +screwdriver = screwdriver or {} + +minetest.register_entity("xdecor:f_item",{ + hp_max = 1, visual="wielditem", visual_size={x=.33,y=.33}, + collisionbox = {0, 0, 0, 0, 0, 0}, physical=false, textures={"air"}, + on_activate = function(self, staticdata) + if tmp.nodename ~= nil and tmp.texture ~= nil then + self.nodename = tmp.nodename + tmp.nodename = nil + self.texture = tmp.texture + tmp.texture = nil + else + if staticdata ~= nil and staticdata ~= "" then + local data = staticdata:split(';') + if data and data[1] and data[2] then + self.nodename = data[1] + self.texture = data[2] + end + end + end + if self.texture ~= nil then + self.object:set_properties({textures={self.texture}}) + end + end, + get_staticdata = function(self) + if self.nodename ~= nil and self.texture ~= nil then + return self.nodename .. ';' .. self.texture + end + return "" + end, +}) + +local remove_item = function(pos, node) + local objs = nil + objs = minetest.get_objects_inside_radius(pos, .5) + + if objs then + for _, obj in ipairs(objs) do + if obj and obj:get_luaentity() and obj:get_luaentity().name == "xdecor:f_item" then + obj:remove() + end + end + end +end + +local facedir = {} +facedir[0] = {x=0, y=0, z=1} +facedir[1] = {x=1, y=0, z=0} +facedir[2] = {x=0, y=0, z=-1} +facedir[3] = {x=-1, y=0, z=0} + +local update_item = function(pos, node) + remove_item(pos, node) + local meta = minetest.get_meta(pos) + + if meta:get_string("item") ~= "" then + local posad = facedir[node.param2] + if not posad then return end + pos.x = pos.x + posad.x*6.5/16 + pos.y = pos.y + posad.y*6.5/16 + pos.z = pos.z + posad.z*6.5/16 + tmp.nodename = node.name + tmp.texture = ItemStack(meta:get_string("item")):get_name() + + local e = minetest.add_entity(pos, "xdecor:f_item") + local yaw = math.pi*2 - node.param2 * math.pi/2 + e:setyaw(yaw) + end +end + +local drop_item = function(pos, node) + local meta = minetest.get_meta(pos) + if meta:get_string("item") ~= "" then + minetest.add_item(pos, meta:get_string("item")) + meta:set_string("item", "") + end + remove_item(pos, node) +end + +xdecor.register("frame", { + description = "Item frame", + 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", + groups = {snappy=3}, + on_rotate = screwdriver.disallow, + after_place_node = function(pos, placer, itemstack) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name()) + meta:set_string("infotext", "Item frame (owned by "..placer:get_player_name()..")") + end, + on_rightclick = function(pos, node, clicker, itemstack) + if not itemstack then return end + local meta = minetest.get_meta(pos) + if clicker:get_player_name() == meta:get_string("owner") then + drop_item(pos, node) + local s = itemstack:take_item() + meta:set_string("item", s:to_string()) + update_item(pos, node) + end + return itemstack + end, + on_punch = function(pos, node, puncher) + local meta = minetest.get_meta(pos) + if puncher:get_player_name() == meta:get_string("owner") then + drop_item(pos, node) + end + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos) + return player:get_player_name() == meta:get_string("owner") + end, + after_destruct = remove_item, +}) + +minetest.register_abm({ + nodenames = {"xdecor:frame"}, + interval = 15, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if #minetest.get_objects_inside_radius(pos, 0.5) > 0 then return end + update_item(pos, node) + end +}) diff --git a/lighting.lua b/lighting.lua new file mode 100644 index 0000000..787845c --- /dev/null +++ b/lighting.lua @@ -0,0 +1,44 @@ +xdecor.register("candle", { + description = "Candle", + walkable = false, + tiles = { + { name = "xdecor_candle_floor.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.5 + } + }, + { name = "xdecor_candle_wall.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.5 + } + } + }, + selection_box = { + type = "wallmounted", + 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} + }, + inventory_image = "xdecor_candle_inv.png", + drawtype = "torchlike", + paramtype2 = "wallmounted", + legacy_wallmounted = true, + light_source = 12, + groups = {dig_immediate=3, attached_node=1} +}) + +xdecor.register("fire", { + description = "Fake fire", + walkable = false, + tiles = { {name="xdecor_fire_anim.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.5}} }, + drawtype = "plantlike", + light_source = 14, + damage_per_second = 2, + drop = "", + groups = {dig_immediate=3, not_in_creative_inventory=1} +}) diff --git a/misc.lua b/misc.lua new file mode 100644 index 0000000..96b1d74 --- /dev/null +++ b/misc.lua @@ -0,0 +1,125 @@ +xdecor.register("cauldron", { + description = "Cauldron", + groups = {snappy=1}, + tiles = { + { + name="xdecor_cauldron_top_anim.png", + animation={type="vertical_frames", + aspect_w=16, aspect_h=16, length=3.0} + }, + "xdecor_cauldron_sides.png" + } +}) + +minetest.register_tool("xdecor:flint_steel", { + description = "Flint and steel", + inventory_image = "xdecor_flint_steel.png", + stack_max = 1, + tool_capabilities = { + full_punch_interval = 1.0, max_drop_level = 0, + groupcaps = {flamable = {uses=65, maxlevel=1}} + }, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type == "node" and minetest.get_node(pointed_thing.above).name == "air" then + if not minetest.is_protected(pointed_thing.above, user:get_player_name()) then + minetest.set_node(pointed_thing.above, {name="xdecor:fire"}) + else + minetest.chat_send_player(user:get_player_name(), "This area is protected!") + end + else return end + + itemstack:add_wear(65535/65) + return itemstack + end +}) + +flowers_type = {"dandelion_white", "dandelion_yellow", "geranium", "rose", "tulip", "viola"} + +for _, f in ipairs(flowers_type) do +xdecor.register("potted_"..f, { + description = "Potted flowers ("..f..")", + walkable = false, + tiles = {"xdecor_"..f.."_pot.png"}, + inventory_image = "xdecor_"..f.."_pot.png", + drawtype = "plantlike", + groups = {dig_immediate=3}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_craft({ + type = "shapeless", + output = "xdecor:potted_"..f.." 2", + recipe = {"flowers:"..f, "xdecor:plant_pot"} +}) +end + +xdecor.register("painting", { + description = "Painting", + drawtype = "signlike", + paramtype2 = "wallmounted", + legacy_wallmounted = true, + selection_box = {type = "wallmounted"}, + tiles = {"xdecor_painting.png"}, + inventory_image = "xdecor_painting.png", + groups = {dig_immediate=3, attached_node=1}, + sounds = default.node_sound_wood_defaults() +}) + +xdecor.register("plant_pot", { + description = "Plant pot", + tiles = {"xdecor_plant_pot_top.png", "xdecor_plant_pot_sides.png"}, + 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 } +} + +xdecor.register("rope", { + description = "Hanging rope", + walkable = false, + climbable = true, + tiles = {"xdecor_rope.png"}, + inventory_image = "xdecor_rope_inv.png", + drawtype = "plantlike", + groups = {dig_immediate=3}, + selection_box = rope_sbox +}) + +local skull_sbox = { + type = "fixed", + fixed = { -0.3, -0.5, -0.3, 0.3, 0.25, 0.3 } +} + +xdecor.register("skull", { + description = "Skull head", + walkable = false, + tiles = {"xdecor_skull.png"}, + inventory_image = "xdecor_skull.png", + drawtype = "torchlike", + groups = {dig_immediate=3, attached_node=1}, + selection_box = skull_sbox +}) + +xdecor.register("tv", { + description = "Television", + tiles = { + "xdecor_television_top.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", + aspect_w=16, + aspect_h=16, + length=80.0 } + } + }, + light_source = 11, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), +}) diff --git a/storage.lua b/storage.lua new file mode 100644 index 0000000..16cfd45 --- /dev/null +++ b/storage.lua @@ -0,0 +1,66 @@ +xdecor.register("barrel", { + description = "Barrel", + tiles = {"xdecor_barrel_top.png", "xdecor_barrel_sides.png"}, + groups = {snappy=3}, + inventory = {size=24}, + infotext = "Barrel", + sounds = default.node_sound_wood_defaults() +}) + +xdecor.register("cardboard_box", { + description = "Cardboard box", + 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} } + }, + groups = {snappy=3}, + inventory = {size=8} +}) + +xdecor.register("cabinet", { + description = "Cabinet", + tiles = {"default_wood.png", "xdecor_cabinet_front.png"}, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + infotext = "Cabinet", + inventory = {size=24} +}) + +xdecor.register("cabinet_half", { + description = "Cabinet half", + tiles = {"default_wood.png", "xdecor_cabinet_half_front.png"}, + node_box = { + type = "fixed", + fixed = { {-0.5, 0, -0.5, 0.5, 0.5, 0.5} } + }, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + infotext = "Cabinet (half)", + inventory = {size=8} +}) + +xdecor.register("multishelf", { + description = "Multishelf", + tiles = {"default_wood.png", "xdecor_multishelf.png"}, + groups = {snappy=3}, + sounds = default.node_sound_wood_defaults(), + infotext = "Multishelf", + inventory = {size=24} +}) + +xdecor.register("workbench", { + description = "Work table", + 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", + }, + groups = {snappy=3}, + inventory = {size=24}, + infotext = "Work bench", + sounds = default.node_sound_wood_defaults() +}) diff --git a/textures/xdecor_barrel_sides.png b/textures/xdecor_barrel_sides.png new file mode 100644 index 0000000..d79ab01 Binary files /dev/null and b/textures/xdecor_barrel_sides.png differ diff --git a/textures/xdecor_barrel_top.png b/textures/xdecor_barrel_top.png new file mode 100644 index 0000000..4f3f4f4 Binary files /dev/null and b/textures/xdecor_barrel_top.png differ diff --git a/textures/xdecor_brass.png b/textures/xdecor_brass.png new file mode 100644 index 0000000..822d49e Binary files /dev/null and b/textures/xdecor_brass.png differ diff --git a/textures/xdecor_brass_ingot.png b/textures/xdecor_brass_ingot.png new file mode 100644 index 0000000..d6761c9 Binary files /dev/null and b/textures/xdecor_brass_ingot.png differ diff --git a/textures/xdecor_cabinet_front.png b/textures/xdecor_cabinet_front.png new file mode 100644 index 0000000..4040ece Binary files /dev/null and b/textures/xdecor_cabinet_front.png differ diff --git a/textures/xdecor_cabinet_half_front.png b/textures/xdecor_cabinet_half_front.png new file mode 100644 index 0000000..9b8f57c Binary files /dev/null and b/textures/xdecor_cabinet_half_front.png differ diff --git a/textures/xdecor_candle_floor.png b/textures/xdecor_candle_floor.png new file mode 100644 index 0000000..aea8cee Binary files /dev/null and b/textures/xdecor_candle_floor.png differ diff --git a/textures/xdecor_candle_inv.png b/textures/xdecor_candle_inv.png new file mode 100644 index 0000000..22e998f Binary files /dev/null and b/textures/xdecor_candle_inv.png differ diff --git a/textures/xdecor_candle_wall.png b/textures/xdecor_candle_wall.png new file mode 100644 index 0000000..8ed8d95 Binary files /dev/null and b/textures/xdecor_candle_wall.png differ diff --git a/textures/xdecor_cardbox_sides.png b/textures/xdecor_cardbox_sides.png new file mode 100644 index 0000000..514ff13 Binary files /dev/null and b/textures/xdecor_cardbox_sides.png differ diff --git a/textures/xdecor_cardbox_top.png b/textures/xdecor_cardbox_top.png new file mode 100644 index 0000000..9737146 Binary files /dev/null and b/textures/xdecor_cardbox_top.png differ diff --git a/textures/xdecor_cauldron_sides.png b/textures/xdecor_cauldron_sides.png new file mode 100644 index 0000000..dd29887 Binary files /dev/null and b/textures/xdecor_cauldron_sides.png differ diff --git a/textures/xdecor_cauldron_top_anim.png b/textures/xdecor_cauldron_top_anim.png new file mode 100644 index 0000000..3d9c0fd Binary files /dev/null and b/textures/xdecor_cauldron_top_anim.png differ diff --git a/textures/xdecor_coalstone_tile.png b/textures/xdecor_coalstone_tile.png new file mode 100644 index 0000000..31262a9 Binary files /dev/null and b/textures/xdecor_coalstone_tile.png differ diff --git a/textures/xdecor_curtain.png b/textures/xdecor_curtain.png new file mode 100644 index 0000000..6d577de Binary files /dev/null and b/textures/xdecor_curtain.png differ diff --git a/textures/xdecor_curtain_open.png b/textures/xdecor_curtain_open.png new file mode 100644 index 0000000..c72b665 Binary files /dev/null and b/textures/xdecor_curtain_open.png differ diff --git a/textures/xdecor_cushion.png b/textures/xdecor_cushion.png new file mode 100644 index 0000000..dc52923 Binary files /dev/null and b/textures/xdecor_cushion.png differ diff --git a/textures/xdecor_dandelion_white_pot.png b/textures/xdecor_dandelion_white_pot.png new file mode 100644 index 0000000..9142155 Binary files /dev/null and b/textures/xdecor_dandelion_white_pot.png differ diff --git a/textures/xdecor_dandelion_yellow_pot.png b/textures/xdecor_dandelion_yellow_pot.png new file mode 100644 index 0000000..e478d2f Binary files /dev/null and b/textures/xdecor_dandelion_yellow_pot.png differ diff --git a/textures/xdecor_fire_anim.png b/textures/xdecor_fire_anim.png new file mode 100644 index 0000000..3e233df Binary files /dev/null and b/textures/xdecor_fire_anim.png differ diff --git a/textures/xdecor_flint_steel.png b/textures/xdecor_flint_steel.png new file mode 100644 index 0000000..ce7fabc Binary files /dev/null and b/textures/xdecor_flint_steel.png differ diff --git a/textures/xdecor_frame.png b/textures/xdecor_frame.png new file mode 100644 index 0000000..60e1365 Binary files /dev/null and b/textures/xdecor_frame.png differ diff --git a/textures/xdecor_geranium_pot.png b/textures/xdecor_geranium_pot.png new file mode 100644 index 0000000..8744679 Binary files /dev/null and b/textures/xdecor_geranium_pot.png differ diff --git a/textures/xdecor_moonbrick.png b/textures/xdecor_moonbrick.png new file mode 100644 index 0000000..f49ffa2 Binary files /dev/null and b/textures/xdecor_moonbrick.png differ diff --git a/textures/xdecor_multishelf.png b/textures/xdecor_multishelf.png new file mode 100644 index 0000000..6c1d4c3 Binary files /dev/null and b/textures/xdecor_multishelf.png differ diff --git a/textures/xdecor_painting.png b/textures/xdecor_painting.png new file mode 100644 index 0000000..116034a Binary files /dev/null and b/textures/xdecor_painting.png differ diff --git a/textures/xdecor_plant_pot_sides.png b/textures/xdecor_plant_pot_sides.png new file mode 100644 index 0000000..1848b97 Binary files /dev/null and b/textures/xdecor_plant_pot_sides.png differ diff --git a/textures/xdecor_plant_pot_top.png b/textures/xdecor_plant_pot_top.png new file mode 100644 index 0000000..c965f95 Binary files /dev/null and b/textures/xdecor_plant_pot_top.png differ diff --git a/textures/xdecor_rope.png b/textures/xdecor_rope.png new file mode 100644 index 0000000..03405ac Binary files /dev/null and b/textures/xdecor_rope.png differ diff --git a/textures/xdecor_rope_inv.png b/textures/xdecor_rope_inv.png new file mode 100644 index 0000000..53d8aef Binary files /dev/null and b/textures/xdecor_rope_inv.png differ diff --git a/textures/xdecor_rose_pot.png b/textures/xdecor_rose_pot.png new file mode 100644 index 0000000..172e848 Binary files /dev/null and b/textures/xdecor_rose_pot.png differ diff --git a/textures/xdecor_skull.png b/textures/xdecor_skull.png new file mode 100644 index 0000000..b30a0d9 Binary files /dev/null and b/textures/xdecor_skull.png differ diff --git a/textures/xdecor_television_back.png b/textures/xdecor_television_back.png new file mode 100644 index 0000000..3599ad0 Binary files /dev/null and b/textures/xdecor_television_back.png differ diff --git a/textures/xdecor_television_front_animated.png b/textures/xdecor_television_front_animated.png new file mode 100644 index 0000000..488bfa9 Binary files /dev/null and b/textures/xdecor_television_front_animated.png differ diff --git a/textures/xdecor_television_left.png b/textures/xdecor_television_left.png new file mode 100644 index 0000000..177d8c0 Binary files /dev/null and b/textures/xdecor_television_left.png differ diff --git a/textures/xdecor_television_top.png b/textures/xdecor_television_top.png new file mode 100644 index 0000000..28d9fda Binary files /dev/null and b/textures/xdecor_television_top.png differ diff --git a/textures/xdecor_tulip_pot.png b/textures/xdecor_tulip_pot.png new file mode 100644 index 0000000..78690f1 Binary files /dev/null and b/textures/xdecor_tulip_pot.png differ diff --git a/textures/xdecor_viola_pot.png b/textures/xdecor_viola_pot.png new file mode 100644 index 0000000..438543d Binary files /dev/null and b/textures/xdecor_viola_pot.png differ diff --git a/textures/xdecor_wood.png b/textures/xdecor_wood.png new file mode 100644 index 0000000..87eac16 Binary files /dev/null and b/textures/xdecor_wood.png differ diff --git a/textures/xdecor_wood_tile.png b/textures/xdecor_wood_tile.png new file mode 100644 index 0000000..b65f9d9 Binary files /dev/null and b/textures/xdecor_wood_tile.png differ diff --git a/textures/xdecor_workbench_front.png b/textures/xdecor_workbench_front.png new file mode 100644 index 0000000..b6a3f3c Binary files /dev/null and b/textures/xdecor_workbench_front.png differ diff --git a/textures/xdecor_workbench_sides.png b/textures/xdecor_workbench_sides.png new file mode 100644 index 0000000..8fb2b2e Binary files /dev/null and b/textures/xdecor_workbench_sides.png differ diff --git a/textures/xdecor_workbench_top.png b/textures/xdecor_workbench_top.png new file mode 100644 index 0000000..c3d60af Binary files /dev/null and b/textures/xdecor_workbench_top.png differ diff --git a/textures/xdecor_wrought_iron.png b/textures/xdecor_wrought_iron.png new file mode 100644 index 0000000..8a58948 Binary files /dev/null and b/textures/xdecor_wrought_iron.png differ