Compare commits
18 Commits
2019-05-25
...
5c6a994698
Author | SHA1 | Date | |
---|---|---|---|
5c6a994698 | |||
1eec6e3615 | |||
7cdfc3b49c | |||
bf7e47342f | |||
b85278fbaa | |||
cacf04e2d1 | |||
07141bff47 | |||
542f688c09 | |||
fee09943e3 | |||
bed4d1e6f8 | |||
798ff29b0a | |||
7491fd4aa8 | |||
0753606eb0 | |||
778b5493c7 | |||
fb0ca9a15c | |||
1520d27a73 | |||
5d4c64d3b2 | |||
4eb9ffb088 |
@ -5,3 +5,6 @@ dofile(modpath.."/alias.lua")
|
||||
dofile(modpath.."/node_stairs.lua")
|
||||
dofile(modpath.."/others.lua")
|
||||
dofile(modpath.."/recipes.lua")
|
||||
|
||||
minetest.log("action", "[building_blocks] loaded.")
|
||||
|
||||
|
@ -97,3 +97,5 @@ dofile(MODPATH.."/computers.lua")
|
||||
dofile(MODPATH.."/miscitems.lua")
|
||||
dofile(MODPATH.."/recipes.lua")
|
||||
dofile(MODPATH.."/tetris.lua")
|
||||
|
||||
minetest.log("action", "[computer] loaded.")
|
||||
|
@ -214,3 +214,5 @@ minetest.register_alias("fake_fire:smokeless_ice_fire", "fake_fire:ice_fire")
|
||||
minetest.register_alias("fake_fire:smokeless_chimney_top_stone", "fake_fire:chimney_top_stone")
|
||||
minetest.register_alias("fake_fire:smokeless_chimney_top_sandstone", "fake_fire:chimney_top_sandstone")
|
||||
minetest.register_alias("fake_fire:flint", "fake_fire:flint_and_steel")
|
||||
|
||||
minetest.log("action", "[fake_fire] loaded.")
|
||||
|
@ -89,3 +89,5 @@ if minetest.get_modpath("moreblocks") then
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.log("action", "[homedecor_3d_extra] loaded.")
|
||||
|
@ -77,6 +77,6 @@ dofile(modpath.."/mt_game_beds_functions.lua")
|
||||
dofile(modpath.."/sit.lua")
|
||||
dofile(modpath.."/crafts.lua")
|
||||
|
||||
if minetest.settings:get_bool("log_mod") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "[HomeDecor API] " .. S("Loaded!"))
|
||||
end
|
||||
|
@ -1,3 +1,5 @@
|
||||
homedecor_common
|
||||
default
|
||||
basic_materials
|
||||
mesecons?
|
||||
mesecons_receiver?
|
||||
|
@ -1,6 +1,40 @@
|
||||
|
||||
local S = homedecor.gettext
|
||||
|
||||
function homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
|
||||
if minetest.is_protected(pos, clicker:get_player_name()) then
|
||||
minetest.record_protection_violation(pos,
|
||||
sender:get_player_name())
|
||||
return false
|
||||
end
|
||||
local sep = string.find(node.name, "_o", -5)
|
||||
local onoff = string.sub(node.name, sep + 1)
|
||||
local newname = string.sub(node.name, 1, sep - 1)..((onoff == "off") and "_on" or "_off")
|
||||
minetest.swap_node(pos, {name = newname, param2 = node.param2})
|
||||
return true
|
||||
end
|
||||
|
||||
local on_rc
|
||||
local switch_receptor
|
||||
|
||||
if minetest.get_modpath("mesecons") then
|
||||
on_rc = function(pos, node, clicker, itemstack, pointed_thing)
|
||||
local t = homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
|
||||
if not t then return end
|
||||
if string.find(node.name, "_on", -5) then
|
||||
mesecon.receptor_off(pos, mesecon.rules.buttonlike_get(node))
|
||||
else
|
||||
mesecon.receptor_on(pos, mesecon.rules.buttonlike_get(node))
|
||||
end
|
||||
end
|
||||
switch_receptor = {
|
||||
receptor = {
|
||||
state = mesecon.state[onoff],
|
||||
rules = mesecon.rules.buttonlike_get
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
homedecor.register("power_outlet", {
|
||||
description = S("Power Outlet"),
|
||||
tiles = {
|
||||
@ -28,35 +62,52 @@ homedecor.register("power_outlet", {
|
||||
walkable = false
|
||||
})
|
||||
|
||||
homedecor.register("light_switch", {
|
||||
description = S("Light switch"),
|
||||
tiles = {
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_back.png",
|
||||
"homedecor_light_switch_front.png"
|
||||
},
|
||||
inventory_image = "homedecor_light_switch_inv.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.125, -0.5, 0.4375, 0.125, -0.1875, 0.5 },
|
||||
{ -0.03125, -0.3125, 0.40625, 0.03125, -0.25, 0.5 },
|
||||
for _, onoff in ipairs ({"on", "off"}) do
|
||||
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.1875, -0.5625, 0.375, 0.1875, -0.1250, 0.5 },
|
||||
}
|
||||
},
|
||||
groups = {cracky=3,dig_immediate=2},
|
||||
walkable = false
|
||||
})
|
||||
local model = {
|
||||
{ -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 },
|
||||
{ -0.03125, 0, 0.40625, 0.03125, 0.0625, 0.5 },
|
||||
}
|
||||
|
||||
if onoff == "on" then
|
||||
model = {
|
||||
{ -0.125, -0.1875, 0.4375, 0.125, 0.125, 0.5 },
|
||||
{ -0.03125, -0.125, 0.40625, 0.03125, -0.0625, 0.5 },
|
||||
}
|
||||
end
|
||||
|
||||
homedecor.register("light_switch_"..onoff, {
|
||||
description = S("Light switch"),
|
||||
tiles = {
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_edges.png",
|
||||
"homedecor_light_switch_back.png",
|
||||
"homedecor_light_switch_front_"..onoff..".png"
|
||||
},
|
||||
inventory_image = "homedecor_light_switch_inv.png",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = model
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -0.1875, -0.25, 0.375, 0.1875, 0.1875, 0.5 },
|
||||
}
|
||||
},
|
||||
groups = {cracky=3, dig_immediate=2, mesecon_needs_receiver=1, not_in_creative_inventory = (onoff == "on") and 1 or nil},
|
||||
walkable = false,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {"homedecor:light_switch_off"}, inherit_color = true },
|
||||
}
|
||||
},
|
||||
mesecons = switch_receptor,
|
||||
on_rightclick = on_rc
|
||||
})
|
||||
end
|
||||
|
||||
homedecor.register("doorbell", {
|
||||
tiles = { "homedecor_doorbell.png" },
|
||||
@ -92,7 +143,7 @@ minetest.register_craft( {
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "homedecor:light_switch",
|
||||
output = "homedecor:light_switch_off",
|
||||
recipe = {
|
||||
{"", "basic_materials:plastic_sheet", "basic_materials:copper_strip"},
|
||||
{"basic_materials:plastic_sheet", "basic_materials:plastic_sheet", "basic_materials:copper_strip"},
|
||||
@ -106,3 +157,7 @@ minetest.register_craft( {
|
||||
{ "homedecor:light_switch", "basic_materials:energy_crystal_simple", "homedecor:speaker_driver" }
|
||||
},
|
||||
})
|
||||
|
||||
-- aliases
|
||||
|
||||
minetest.register_alias("homedecor:light_switch", "homedecor:light_switch_on")
|
||||
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 281 B |
After Width: | Height: | Size: 284 B |
@ -6,3 +6,4 @@ creative
|
||||
moreblocks?
|
||||
building_blocks?
|
||||
darkage?
|
||||
mesecons?
|
||||
|
BIN
homedecor_lighting/textures/homedecor_glowlight_base.png
Normal file
After Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 95 B |
Before Width: | Height: | Size: 93 B |
After Width: | Height: | Size: 106 B |
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 94 B |
After Width: | Height: | Size: 104 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
BIN
homedecor_lighting/textures/homedecor_glowlight_tb_edges.png
Normal file
After Width: | Height: | Size: 96 B |
Before Width: | Height: | Size: 95 B |
After Width: | Height: | Size: 100 B |
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 96 B |
After Width: | Height: | Size: 97 B |
After Width: | Height: | Size: 313 B |
Before Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 93 B |
BIN
homedecor_lighting/textures/homedecor_glowlight_top_glare.png
Normal file
After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 360 B |
After Width: | Height: | Size: 661 B |
After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 377 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 282 B |
Before Width: | Height: | Size: 379 B |
After Width: | Height: | Size: 493 B |
After Width: | Height: | Size: 287 B |
BIN
homedecor_lighting/textures/homedecor_plasma_lamp_off.png
Normal file
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 450 B |
Before Width: | Height: | Size: 594 B After Width: | Height: | Size: 594 B |
@ -126,3 +126,5 @@ function inbox.get_inbox_insert_formspec(pos)
|
||||
"listring[]"
|
||||
return formspec
|
||||
end
|
||||
|
||||
minetest.log("action", "[inbox] loaded.")
|
||||
|
@ -300,3 +300,5 @@ if minetest.get_modpath("mesecons_mvps") then
|
||||
mesecon.register_mvps_stopper("itemframes:frame")
|
||||
mesecon.register_mvps_stopper("itemframes:pedestal")
|
||||
end
|
||||
|
||||
minetest.log("action", "[itemframes] loaded.")
|
||||
|
@ -73,3 +73,5 @@ dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/endtable.lua")
|
||||
|
||||
minetest.log("action", "[lrfurn] loaded.")
|
||||
|
@ -186,3 +186,5 @@ minetest.register_craft({
|
||||
{'group:stick', 'default:coal_lump', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.log("action", "[plasmascreen] loaded.")
|
||||
|