diff options
author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2019-05-03 02:22:32 -0400 |
---|---|---|
committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2019-05-03 02:22:32 -0400 |
commit | 5f793789ad38179aff7aaddcc262eec64cc9f087 (patch) | |
tree | d36720f72c348715ff88b861de621b040de9a9df | |
parent | cee90ea59a3c6e8a3175d850f1d057a328f345b8 (diff) | |
download | dreambuilder_modpack-5f793789ad38179aff7aaddcc262eec64cc9f087.tar dreambuilder_modpack-5f793789ad38179aff7aaddcc262eec64cc9f087.tar.gz dreambuilder_modpack-5f793789ad38179aff7aaddcc262eec64cc9f087.tar.bz2 dreambuilder_modpack-5f793789ad38179aff7aaddcc262eec64cc9f087.tar.xz dreambuilder_modpack-5f793789ad38179aff7aaddcc262eec64cc9f087.zip |
update homedecor and simple_streetlights
28 files changed, 102 insertions, 68 deletions
diff --git a/homedecor_misc/sounds/homedecor_shower.ogg b/homedecor_bathroom/sounds/homedecor_shower.ogg Binary files differindex 4675b79..4675b79 100644 --- a/homedecor_misc/sounds/homedecor_shower.ogg +++ b/homedecor_bathroom/sounds/homedecor_shower.ogg diff --git a/homedecor_misc/sounds/homedecor_toilet_flush.ogg b/homedecor_bathroom/sounds/homedecor_toilet_flush.ogg Binary files differindex e15a583..e15a583 100644 --- a/homedecor_misc/sounds/homedecor_toilet_flush.ogg +++ b/homedecor_bathroom/sounds/homedecor_toilet_flush.ogg diff --git a/homedecor_misc/sounds/homedecor_faucet.ogg b/homedecor_common/sounds/homedecor_faucet.ogg Binary files differindex 8c79074..8c79074 100644 --- a/homedecor_misc/sounds/homedecor_faucet.ogg +++ b/homedecor_common/sounds/homedecor_faucet.ogg diff --git a/homedecor_misc/sounds/homedecor_book_close.ogg b/homedecor_doors_and_gates/sounds/homedecor_book_close.ogg Binary files differindex 22116a3..22116a3 100644 --- a/homedecor_misc/sounds/homedecor_book_close.ogg +++ b/homedecor_doors_and_gates/sounds/homedecor_book_close.ogg diff --git a/homedecor_misc/sounds/homedecor_door_close.ogg b/homedecor_doors_and_gates/sounds/homedecor_door_close.ogg Binary files differindex c85b915..c85b915 100644 --- a/homedecor_misc/sounds/homedecor_door_close.ogg +++ b/homedecor_doors_and_gates/sounds/homedecor_door_close.ogg diff --git a/homedecor_misc/sounds/homedecor_door_open.ogg b/homedecor_doors_and_gates/sounds/homedecor_door_open.ogg Binary files differindex 16198d9..16198d9 100644 --- a/homedecor_misc/sounds/homedecor_door_open.ogg +++ b/homedecor_doors_and_gates/sounds/homedecor_door_open.ogg diff --git a/homedecor_misc/sounds/homedecor_gate_open_close.ogg b/homedecor_doors_and_gates/sounds/homedecor_gate_open_close.ogg Binary files differindex d5f1d96..d5f1d96 100644 --- a/homedecor_misc/sounds/homedecor_gate_open_close.ogg +++ b/homedecor_doors_and_gates/sounds/homedecor_gate_open_close.ogg diff --git a/homedecor_misc/sounds/insert_coin.ogg b/homedecor_gastronomy/sounds/insert_coin.ogg Binary files differindex 2ee99d5..2ee99d5 100644 --- a/homedecor_misc/sounds/insert_coin.ogg +++ b/homedecor_gastronomy/sounds/insert_coin.ogg diff --git a/homedecor_misc/sounds/toaster.ogg b/homedecor_gastronomy/sounds/toaster.ogg Binary files differindex c3d5a80..c3d5a80 100644 --- a/homedecor_misc/sounds/toaster.ogg +++ b/homedecor_gastronomy/sounds/toaster.ogg diff --git a/homedecor_lighting/init.lua b/homedecor_lighting/init.lua index e5e0df7..53cd52c 100644 --- a/homedecor_lighting/init.lua +++ b/homedecor_lighting/init.lua @@ -126,7 +126,7 @@ minetest.register_node(":homedecor:glowlight_small_cube", { }) homedecor.register("plasma_lamp", { - description = S("Plasma Lamp"), + description = S("Plasma Lamp/Light"), drawtype = "mesh", mesh = "plasma_lamp.obj", tiles = { @@ -273,7 +273,7 @@ local ol_cbox = { } homedecor.register("oil_lamp", { - description = S("Oil lamp (hurricane)"), + description = S("Oil lamp/Light (hurricane)"), mesh = "homedecor_oil_lamp.obj", tiles = { "homedecor_generic_metal_brass.png", @@ -293,7 +293,7 @@ homedecor.register("oil_lamp", { }) homedecor.register("oil_lamp_tabletop", { - description = S("Oil Lamp (tabletop)"), + description = S("Oil Lamp/Light (tabletop)"), mesh = "homedecor_oil_lamp_tabletop.obj", tiles = {"homedecor_oil_lamp_tabletop.png"}, inventory_image = "homedecor_oil_lamp_tabletop_inv.png", @@ -312,7 +312,7 @@ local gl_cbox = { minetest.register_alias("homedecor:wall_lantern", "homedecor:ground_lantern") homedecor.register("ground_lantern", { - description = S("Ground Lantern"), + description = S("Ground Lantern/Light"), mesh = "homedecor_ground_lantern.obj", tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" }, use_texture_alpha = true, @@ -330,7 +330,7 @@ local hl_cbox = { } homedecor.register("hanging_lantern", { - description = S("Hanging Lantern"), + description = S("Hanging Lantern/Light"), mesh = "homedecor_hanging_lantern.obj", tiles = { "homedecor_generic_metal_wrought_iron.png", "homedecor_light.png" }, use_texture_alpha = true, @@ -353,7 +353,7 @@ homedecor.register("ceiling_lantern", { tiles = { "homedecor_light.png", "homedecor_generic_metal_wrought_iron.png" }, use_texture_alpha = true, inventory_image = "homedecor_ceiling_lantern_inv.png", - description = S("Ceiling Lantern"), + description = S("Ceiling Lantern/Light"), groups = {snappy=3}, light_source = 11, selection_box = cl_cbox, @@ -367,7 +367,7 @@ if minetest.get_modpath("darkage") then sm_light = default.LIGHT_MAX-5 else homedecor.register("lattice_lantern_large", { - description = S("Lattice lantern (large)"), + description = S("Lattice lantern/Light (large)"), tiles = { 'homedecor_lattice_lantern_large.png' }, groups = { snappy = 3 }, light_source = default.LIGHT_MAX, @@ -438,7 +438,7 @@ local function reg_lamp(suffix, nxt, light, brightness) local wool_brighten = (light or 0) * 15 homedecor.register("table_lamp_"..suffix, { - description = S("Table Lamp"), + description = S("Table Lamp/Light"), mesh = "homedecor_table_lamp.obj", tiles = { "wool_grey.png^[colorize:#ffffff:"..wool_brighten, @@ -471,7 +471,7 @@ local function reg_lamp(suffix, nxt, light, brightness) }) homedecor.register("standing_lamp_"..suffix, { - description = S("Standing Lamp"), + description = S("Standing Lamp/Light"), mesh = "homedecor_standing_lamp.obj", tiles = { "wool_grey.png^[colorize:#ffffff:"..wool_brighten, @@ -522,7 +522,7 @@ local dlamp_cbox = { } homedecor.register("desk_lamp", { - description = S("Desk Lamp"), + description = S("Desk Lamp/Light"), mesh = "homedecor_desk_lamp.obj", tiles = { "homedecor_generic_metal.png", @@ -547,7 +547,7 @@ homedecor.register("desk_lamp", { -- "kitchen"/"dining room" ceiling lamp homedecor.register("ceiling_lamp", { - description = S("Ceiling Lamp"), + description = S("Ceiling Lamp/Light"), mesh = "homedecor_ceiling_lamp.obj", tiles = { "homedecor_generic_metal_brass.png", @@ -565,7 +565,7 @@ homedecor.register("ceiling_lamp", { }) homedecor.register("ceiling_lamp_off", { - description = S("Ceiling Lamp (off)"), + description = S("Ceiling Lamp/Light (off)"), mesh = "homedecor_ceiling_lamp.obj", tiles = { "homedecor_generic_metal_brass.png", diff --git a/homedecor_misc/sounds/homedecor_trash_all.ogg b/homedecor_trash_cans/sounds/homedecor_trash_all.ogg Binary files differindex 85c3f66..85c3f66 100644 --- a/homedecor_misc/sounds/homedecor_trash_all.ogg +++ b/homedecor_trash_cans/sounds/homedecor_trash_all.ogg diff --git a/simple_streetlights/depends.txt b/simple_streetlights/depends.txt index 191f064..26a770c 100644 --- a/simple_streetlights/depends.txt +++ b/simple_streetlights/depends.txt @@ -1,6 +1,8 @@ default +basic_materials? creative? ilights? gloopblocks? -homedecor? +homedecor_fences? +homedecor_lighting? streetspoles? diff --git a/simple_streetlights/init.lua b/simple_streetlights/init.lua index 50310b6..e18ba8a 100644 --- a/simple_streetlights/init.lua +++ b/simple_streetlights/init.lua @@ -2,7 +2,11 @@ local modpath = minetest.get_modpath("simple_streetlights") +streetlights = {} +streetlights.basic_materials = minetest.get_modpath("basic_materials") +streetlights.concrete = "basic_materials:concrete_block" + dofile(modpath.."/simple.lua") -if minetest.get_modpath("homedecor") and minetest.get_modpath("streetspoles") then +if minetest.get_modpath("homedecor_lighting") and minetest.get_modpath("streetspoles") then dofile(modpath.."/minedot.lua") end diff --git a/simple_streetlights/minedot.lua b/simple_streetlights/minedot.lua index 7521deb..e8f8141 100644 --- a/simple_streetlights/minedot.lua +++ b/simple_streetlights/minedot.lua @@ -31,7 +31,7 @@ local offsets = { }, } -local function takeMaterials(player,materials) +local function takeMaterials(player, sneak, materials) local name = player:get_player_name() if creative and creative.is_enabled_for(name) then return true end local inv = minetest.get_inventory({type = "player",name = name}) @@ -39,8 +39,14 @@ local function takeMaterials(player,materials) for _,i in ipairs(materials) do if not inv:contains_item("main",i) then hasMaterials = false end end + if sneak and streetlights.basic_materials and not inv:contains_item("main", streetlights.concrete) then + hasMaterials = false + end if hasMaterials then for _,i in ipairs(materials) do inv:remove_item("main",i) end + if sneak then + inv:remove_item("main", streetlights.concrete) + end return true else minetest.chat_send_player(name,"You don't have the necessary materials to do that!") @@ -50,6 +56,7 @@ end local function place(itemstack,player,pointed) if not player then return end + local sneak = player:get_player_control().sneak local name = player:get_player_name() if not minetest.check_player_privs(name,{streetlight = true}) then minetest.chat_send_player(name,"*** You don't have permission to use a streetlight spawner.") @@ -58,9 +65,10 @@ local function place(itemstack,player,pointed) local pos = pointed.above if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass = true}) then minetest.record_protection_violation(pos,name) + return end local isDouble = string.sub(itemstack:get_name(),-6,-1) == "double" - if not takeMaterials(player,isDouble and doubleMaterials or singleMaterials) then return end + if not takeMaterials(player, sneak, isDouble and doubleMaterials or singleMaterials) then return end local facedir = minetest.facedir_to_dir(minetest.dir_to_facedir(player:get_look_dir())) local schemDir = 0 if facedir.x == 1 then schemDir = 180 @@ -69,6 +77,9 @@ local function place(itemstack,player,pointed) local offset = offsets[isDouble and "double" or "single"][schemDir] local pos = vector.add(pos,offset) minetest.place_schematic(pos,isDouble and schems.double or schems.single,schemDir,nil,false) + if sneak and streetlights.basic_materials then + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, {name = streetlights.concrete}) + end end minetest.register_tool(":minedot_streetlights:spawner_single",{ diff --git a/simple_streetlights/simple.lua b/simple_streetlights/simple.lua index 5d2518e..aaf5575 100644 --- a/simple_streetlights/simple.lua +++ b/simple_streetlights/simple.lua @@ -11,7 +11,8 @@ minetest.register_privilege("streetlight", { give_to_singleplayer = true }) -local function check_and_place(itemstack, placer, pointed_thing, pole, light) +local function check_and_place(itemstack, placer, pointed_thing, pole, light, param2) + local sneak = placer:get_player_control().sneak if not placer then return end if not minetest.check_player_privs(placer, "streetlight") then minetest.chat_send_player(placer:get_player_name(), "*** You don't have permission to use a streetlight spawner.") @@ -57,9 +58,17 @@ local function check_and_place(itemstack, placer, pointed_thing, pole, light) def4 = minetest.registered_items[node4.name] if minetest.is_protected(pos4, player_name) or not (def3 and def4.buildable_to) then return end + if sneak and minetest.is_protected(pos1, player_name) then return end + if not creative or not creative.is_enabled_for(player_name) then local inv = placer:get_inventory() if not inv:contains_item("main", pole.." 5") or not inv:contains_item("main", light) then return end + if sneak and inv:contains_item("main", streetlights.concrete) then + inv:remove_item("main", streetlights.concrete) + else + return + end + inv:remove_item("main", pole.." 5") inv:remove_item("main", light) end @@ -69,61 +78,69 @@ local function check_and_place(itemstack, placer, pointed_thing, pole, light) minetest.set_node(pos2, {name = pole }) end minetest.set_node(pos3, { name = pole }) - minetest.set_node(pos4, { name = light, param2 = 0 }) + minetest.set_node(pos4, { name = light, param2 = param2 }) + if sneak then + minetest.set_node(pos1, { name = streetlights.concrete }) + end end -minetest.register_tool("simple_streetlights:spawner_wood_meselamp", { - description = "Streetlight spawner (wooden pole, Mese lamp cube)", - inventory_image = "simple_streetlights_spawner_wood_meselamp.png", - use_texture_alpha = true, - tool_capabilities = { full_punch_interval=0.1 }, - on_place = function(itemstack, placer, pointed_thing) - check_and_place(itemstack, placer, pointed_thing, "default:fence_wood", "default:meselamp") - end -}) +local poles_tab = { +-- material name, mod name, node name + { "wood", "default", "default:fence_wood" }, + { "junglewood", "default", "default:fence_junglewood" }, + { "brass", "homedecor_fences", "homedecor:fence_brass" }, + { "wrought_iron", "homedecor_fences", "homedecor:fence_wrought_iron" }, + { "steel", "gloopblocks", "gloopblocks:fence_steel" } +} -if minetest.get_modpath("ilights") then - minetest.register_tool("simple_streetlights:spawner_wood_white", { - description = "Streetlight spawner (wooden pole, white light)", - inventory_image = "simple_streetlights_spawner_wood_white.png", - use_texture_alpha = true, - tool_capabilities = { full_punch_interval=0.1 }, - on_place = function(itemstack, placer, pointed_thing) - check_and_place(itemstack, placer, pointed_thing, "default:fence_wood", "ilights:light") - end - }) - - if minetest.get_modpath("gloopblocks") then - minetest.register_tool("simple_streetlights:spawner_steel_white", { - description = "Streetlight spawner (steel pole, white light)", - inventory_image = "simple_streetlights_spawner_steel_white.png", - use_texture_alpha = true, - tool_capabilities = { full_punch_interval=0.1 }, - on_place = function(itemstack, placer, pointed_thing) - check_and_place(itemstack, placer, pointed_thing, "gloopblocks:fence_steel", "ilights:light") - end - }) - end +local lights_tab = { +-- light name, mod name, node name, optional param2 + { "meselamp", "default", "default:meselamp" }, + { "ilight", "ilights", "ilights:light" }, + { "glowlight_cube", "homedecor_lighting", "homedecor:glowlight_small_cube" } +} + +for _, pole in ipairs(poles_tab) do + local matname = pole[1] + local matmod = pole[2] + local matnode = pole[3] + + if minetest.get_modpath(matmod) then + + for _, light in ipairs(lights_tab) do + local lightname = light[1] + local lightmod = light[2] + local lightnode = light[3] + local lightparam2 = light[4] or 0 + + if minetest.get_modpath(lightmod) then + + minetest.register_tool("simple_streetlights:spawner_"..matname.."_"..lightname, { + description = "Streetlight spawner ("..matname.." pole, "..lightname..")", + inventory_image = "simple_streetlights_inv_pole_"..matname..".png".. + "^simple_streetlights_inv_light_source_"..lightname..".png", + use_texture_alpha = true, + tool_capabilities = { full_punch_interval=0.1 }, + on_place = function(itemstack, placer, pointed_thing) + check_and_place(itemstack, placer, pointed_thing, matnode, lightnode, lightparam2) + end + }) + + minetest.register_craft({ + output = "simple_streetlights:spawner_"..matname.."_"..lightname, + type = "shapeless", + recipe = { + matnode, + matnode, + matnode, + matnode, + matnode, + matnode, + lightnode + } + }) - if minetest.get_modpath("homedecor") then - minetest.register_tool("simple_streetlights:spawner_wrought_iron_white", { - description = "Streetlight spawner (wrought iron pole, white light)", - inventory_image = "simple_streetlights_spawner_wrought_iron_white.png", - use_texture_alpha = true, - tool_capabilities = { full_punch_interval=0.1 }, - on_place = function(itemstack, placer, pointed_thing) - check_and_place(itemstack, placer, pointed_thing, "homedecor:fence_wrought_iron", "ilights:light") - end - }) - - minetest.register_tool("simple_streetlights:spawner_brass_white", { - description = "Streetlight spawner (brass pole, white light)", - inventory_image = "simple_streetlights_spawner_brass_white.png", - use_texture_alpha = true, - tool_capabilities = { full_punch_interval=0.1 }, - on_place = function(itemstack, placer, pointed_thing) - check_and_place(itemstack, placer, pointed_thing, "homedecor:fence_brass", "ilights:light") end - }) + end end end diff --git a/simple_streetlights/textures/simple_streetlights_inv_light_source_glowlight_cube.png b/simple_streetlights/textures/simple_streetlights_inv_light_source_glowlight_cube.png Binary files differnew file mode 100644 index 0000000..386b6d2 --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_light_source_glowlight_cube.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_light_source_ilight.png b/simple_streetlights/textures/simple_streetlights_inv_light_source_ilight.png Binary files differnew file mode 100644 index 0000000..cb7cfdb --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_light_source_ilight.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_light_source_meselamp.png b/simple_streetlights/textures/simple_streetlights_inv_light_source_meselamp.png Binary files differnew file mode 100644 index 0000000..d30515f --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_light_source_meselamp.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_brass.png b/simple_streetlights/textures/simple_streetlights_inv_pole_brass.png Binary files differnew file mode 100644 index 0000000..e97853e --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_pole_brass.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_junglewood.png b/simple_streetlights/textures/simple_streetlights_inv_pole_junglewood.png Binary files differnew file mode 100644 index 0000000..ccced10 --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_pole_junglewood.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_steel.png b/simple_streetlights/textures/simple_streetlights_inv_pole_steel.png Binary files differnew file mode 100644 index 0000000..c3d1261 --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_pole_steel.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_wood.png b/simple_streetlights/textures/simple_streetlights_inv_pole_wood.png Binary files differnew file mode 100644 index 0000000..227e0f5 --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_pole_wood.png diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_wrought_iron.png b/simple_streetlights/textures/simple_streetlights_inv_pole_wrought_iron.png Binary files differnew file mode 100644 index 0000000..a0fa09f --- /dev/null +++ b/simple_streetlights/textures/simple_streetlights_inv_pole_wrought_iron.png diff --git a/simple_streetlights/textures/simple_streetlights_spawner_brass_white.png b/simple_streetlights/textures/simple_streetlights_spawner_brass_white.png Binary files differdeleted file mode 100644 index 10bbf38..0000000 --- a/simple_streetlights/textures/simple_streetlights_spawner_brass_white.png +++ /dev/null diff --git a/simple_streetlights/textures/simple_streetlights_spawner_steel_white.png b/simple_streetlights/textures/simple_streetlights_spawner_steel_white.png Binary files differdeleted file mode 100644 index df9c34f..0000000 --- a/simple_streetlights/textures/simple_streetlights_spawner_steel_white.png +++ /dev/null diff --git a/simple_streetlights/textures/simple_streetlights_spawner_wood_meselamp.png b/simple_streetlights/textures/simple_streetlights_spawner_wood_meselamp.png Binary files differdeleted file mode 100644 index 1bf5910..0000000 --- a/simple_streetlights/textures/simple_streetlights_spawner_wood_meselamp.png +++ /dev/null diff --git a/simple_streetlights/textures/simple_streetlights_spawner_wood_white.png b/simple_streetlights/textures/simple_streetlights_spawner_wood_white.png Binary files differdeleted file mode 100644 index 4ba28f1..0000000 --- a/simple_streetlights/textures/simple_streetlights_spawner_wood_white.png +++ /dev/null diff --git a/simple_streetlights/textures/simple_streetlights_spawner_wrought_iron_white.png b/simple_streetlights/textures/simple_streetlights_spawner_wrought_iron_white.png Binary files differdeleted file mode 100644 index 2025424..0000000 --- a/simple_streetlights/textures/simple_streetlights_spawner_wrought_iron_white.png +++ /dev/null |