mirror of
https://github.com/mt-mods/homedecor_modpack.git
synced 2024-12-22 16:10:18 +01:00
Fix most luacheck issues.
There are 3 false positives remaining after this patch, so the bulk of the issues are fixed now.
This commit is contained in:
parent
138e078f1b
commit
923198a2dd
@ -12,5 +12,12 @@ read_globals = {
|
|||||||
"default",
|
"default",
|
||||||
"stairsplus",
|
"stairsplus",
|
||||||
"signs_lib",
|
"signs_lib",
|
||||||
|
"beds",
|
||||||
|
"technic",
|
||||||
|
"mesecon",
|
||||||
|
}
|
||||||
|
|
||||||
|
globals = {
|
||||||
|
"armor",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,19 +2,18 @@ computer = {}
|
|||||||
screwdriver = screwdriver or {}
|
screwdriver = screwdriver or {}
|
||||||
|
|
||||||
computer.register = function (name, def)
|
computer.register = function (name, def)
|
||||||
local nodename = name
|
|
||||||
if (name:sub(1, 1) == ":") then name = name:sub(2) end
|
if (name:sub(1, 1) == ":") then name = name:sub(2) end
|
||||||
local modname, basename = name:match("^([^:]+):(.*)")
|
local modname, basename = name:match("^([^:]+):(.*)")
|
||||||
local TEXPFX = modname.."_"..basename.."_"
|
local TEXPFX = modname.."_"..basename.."_"
|
||||||
local ONSTATE = modname..":"..basename
|
local ONSTATE = modname..":"..basename
|
||||||
local OFFSTATE = modname..":"..basename.."_off"
|
local OFFSTATE = modname..":"..basename.."_off"
|
||||||
local def = def
|
local cdef = table.copy(def)
|
||||||
minetest.register_node(ONSTATE, {
|
minetest.register_node(ONSTATE, {
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
description = def.description,
|
description = cdef.description,
|
||||||
inventory_image = def.inventory_image,
|
inventory_image = cdef.inventory_image,
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2},
|
||||||
tiles = {
|
tiles = {
|
||||||
TEXPFX.."tp.png",
|
TEXPFX.."tp.png",
|
||||||
@ -24,10 +23,10 @@ computer.register = function (name, def)
|
|||||||
TEXPFX.."bk.png",
|
TEXPFX.."bk.png",
|
||||||
TEXPFX.."ft.png"
|
TEXPFX.."ft.png"
|
||||||
},
|
},
|
||||||
node_box = def.node_box,
|
node_box = cdef.node_box,
|
||||||
selection_box = def.node_box,
|
selection_box = cdef.node_box,
|
||||||
on_rightclick = function (pos, node, clicker, itemstack)
|
on_rightclick = function (pos, node, clicker, itemstack)
|
||||||
if def.on_turn_off and def.on_turn_off(pos, node, clicker, itemstack) then
|
if cdef.on_turn_off and cdef.on_turn_off(pos, node, clicker, itemstack) then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
node.name = OFFSTATE
|
node.name = OFFSTATE
|
||||||
@ -41,17 +40,17 @@ computer.register = function (name, def)
|
|||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
|
groups = {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1},
|
||||||
tiles = {
|
tiles = {
|
||||||
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
|
(TEXPFX.."tp"..(cdef.tiles_off.top and "_off" or "")..".png"),
|
||||||
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
|
(TEXPFX.."bt"..(cdef.tiles_off.bottom and "_off" or "")..".png"),
|
||||||
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
|
(TEXPFX.."rt"..(cdef.tiles_off.right and "_off" or "")..".png"),
|
||||||
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
|
(TEXPFX.."lt"..(cdef.tiles_off.left and "_off" or "")..".png"),
|
||||||
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
|
(TEXPFX.."bk"..(cdef.tiles_off.back and "_off" or "")..".png"),
|
||||||
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png")
|
(TEXPFX.."ft"..(cdef.tiles_off.front and "_off" or "")..".png")
|
||||||
},
|
},
|
||||||
node_box = def.node_box_off or def.node_box,
|
node_box = cdef.node_box_off or cdef.node_box,
|
||||||
selection_box = def.node_box_off or def.node_box,
|
selection_box = cdef.node_box_off or cdef.node_box,
|
||||||
on_rightclick = function (pos, node, clicker, itemstack)
|
on_rightclick = function (pos, node, clicker, itemstack)
|
||||||
if def.on_turn_on and def.on_turn_on(pos, node, clicker, itemstack) then
|
if cdef.on_turn_on and cdef.on_turn_on(pos, node, clicker, itemstack) then
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
node.name = ONSTATE
|
node.name = ONSTATE
|
||||||
@ -63,13 +62,10 @@ computer.register = function (name, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
computer.register_handheld = function (name, def)
|
computer.register_handheld = function (name, def)
|
||||||
local nodename = name
|
|
||||||
if (name:sub(1, 1) == ":") then name = name:sub(2) end
|
if (name:sub(1, 1) == ":") then name = name:sub(2) end
|
||||||
local modname, basename = name:match("^([^:]+):(.*)")
|
local modname, basename = name:match("^([^:]+):(.*)")
|
||||||
local TEXPFX = modname.."_"..basename.."_inv"
|
local TEXPFX = modname.."_"..basename.."_inv"
|
||||||
local ONSTATE = modname..":"..basename
|
local ONSTATE = modname..":"..basename
|
||||||
local OFFSTATE = modname..":"..basename.."_off"
|
|
||||||
local on_use = def.on_use
|
|
||||||
minetest.register_craftitem(ONSTATE, {
|
minetest.register_craftitem(ONSTATE, {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
inventory_image = TEXPFX..".png",
|
inventory_image = TEXPFX..".png",
|
||||||
@ -79,8 +75,7 @@ end
|
|||||||
|
|
||||||
computer.pixelnodebox = function (size, boxes)
|
computer.pixelnodebox = function (size, boxes)
|
||||||
local fixed = { }
|
local fixed = { }
|
||||||
local i, box
|
for _, box in ipairs(boxes) do
|
||||||
for i, box in ipairs(boxes) do
|
|
||||||
local x, y, z, w, h, l = unpack(box)
|
local x, y, z, w, h, l = unpack(box)
|
||||||
fixed[#fixed + 1] = {
|
fixed[#fixed + 1] = {
|
||||||
(x / size) - 0.5,
|
(x / size) - 0.5,
|
||||||
|
@ -71,7 +71,7 @@ local function step(pos, fields)
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local t = minetest.deserialize(meta:get_string("tetris"))
|
local t = minetest.deserialize(meta:get_string("tetris"))
|
||||||
|
|
||||||
local function new_game(pos)
|
local function new_game(p)
|
||||||
local nex = math.random(7)
|
local nex = math.random(7)
|
||||||
|
|
||||||
t = {
|
t = {
|
||||||
@ -84,7 +84,7 @@ local function step(pos, fields)
|
|||||||
x=4, y=0, rot=1
|
x=4, y=0, rot=1
|
||||||
}
|
}
|
||||||
|
|
||||||
local timer = minetest.get_node_timer(pos)
|
local timer = minetest.get_node_timer(p)
|
||||||
timer:set(0.3, 0)
|
timer:set(0.3, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ local function start_smoke(pos, node, clicker, chimney)
|
|||||||
|
|
||||||
if id ~= 0 then
|
if id ~= 0 then
|
||||||
if s_handle then
|
if s_handle then
|
||||||
minetest.after(0, function(s_handle)
|
minetest.after(0, function(handle)
|
||||||
minetest.sound_stop(s_handle)
|
minetest.sound_stop(handle)
|
||||||
end, s_handle)
|
end, s_handle)
|
||||||
end
|
end
|
||||||
minetest.delete_particlespawner(id)
|
minetest.delete_particlespawner(id)
|
||||||
@ -30,19 +30,18 @@ local function start_smoke(pos, node, clicker, chimney)
|
|||||||
texture = "smoke_particle.png",
|
texture = "smoke_particle.png",
|
||||||
})
|
})
|
||||||
if chimney == 1 then
|
if chimney == 1 then
|
||||||
s_handle = nil
|
|
||||||
this_spawner_meta:set_int("smoky", id)
|
this_spawner_meta:set_int("smoky", id)
|
||||||
this_spawner_meta:set_int("sound", nil)
|
this_spawner_meta:set_int("sound", nil)
|
||||||
else
|
else
|
||||||
s_handle = minetest.sound_play("fire_small", {
|
s_handle = minetest.sound_play("fire_small", {
|
||||||
pos = pos,
|
pos = pos,
|
||||||
max_hear_distance = 5,
|
max_hear_distance = 5,
|
||||||
loop = true
|
loop = true
|
||||||
})
|
})
|
||||||
this_spawner_meta:set_int("smoky", id)
|
this_spawner_meta:set_int("smoky", id)
|
||||||
this_spawner_meta:set_int("sound", s_handle)
|
this_spawner_meta:set_int("sound", s_handle)
|
||||||
end
|
end
|
||||||
return end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function stop_smoke(pos)
|
local function stop_smoke(pos)
|
||||||
@ -55,8 +54,8 @@ local function stop_smoke(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if s_handle then
|
if s_handle then
|
||||||
minetest.after(0, function(s_handle)
|
minetest.after(0, function(handle)
|
||||||
minetest.sound_stop(s_handle)
|
minetest.sound_stop(handle)
|
||||||
end, s_handle)
|
end, s_handle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ homedecor.register("desk_fan", {
|
|||||||
entity_remove[1]:setyaw(0)
|
entity_remove[1]:setyaw(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local entity_anim = minetest.get_objects_inside_radius(pos, 0.1)
|
|
||||||
if minetest.get_meta(pos):get_string("active") == "no" then
|
if minetest.get_meta(pos):get_string("active") == "no" then
|
||||||
entity_anim[1]:set_animation({x=0,y=0}, 1, 0)
|
entity_anim[1]:set_animation({x=0,y=0}, 1, 0)
|
||||||
elseif minetest.get_meta(pos):get_string("active") == "yes" then
|
elseif minetest.get_meta(pos):get_string("active") == "yes" then
|
||||||
|
@ -4,8 +4,8 @@ local S = homedecor.gettext
|
|||||||
|
|
||||||
-- doors
|
-- doors
|
||||||
|
|
||||||
local function isSolid(pos,adj)
|
local function isSolid(pos, adjust)
|
||||||
local adj = {x=adj[1],y=adj[2],z=adj[3]}
|
local adj = {x = adjust[1], y = adjust[2], z = adjust[3]}
|
||||||
local node = minetest.get_node(vector.add(pos,adj))
|
local node = minetest.get_node(vector.add(pos,adj))
|
||||||
if node then
|
if node then
|
||||||
local idef = minetest.registered_nodes[minetest.get_node(vector.add(pos,adj)).name]
|
local idef = minetest.registered_nodes[minetest.get_node(vector.add(pos,adj)).name]
|
||||||
@ -42,14 +42,12 @@ local function calculateClosed(pos)
|
|||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
-- the door is considered closed if it is closing off something.
|
-- the door is considered closed if it is closing off something.
|
||||||
|
|
||||||
local solids = 0
|
|
||||||
local direction = node.param2 % 6
|
local direction = node.param2 % 6
|
||||||
local isTrap = direction == 0 or direction == 5
|
local isTrap = direction == 0 or direction == 5
|
||||||
if isTrap then
|
if isTrap then
|
||||||
-- the trap door is considered closed when all nodes on its sides are solid
|
-- the trap door is considered closed when all nodes on its sides are solid
|
||||||
-- or all nodes in the 3x3 above/below it are solid except the center
|
-- or all nodes in the 3x3 above/below it are solid except the center
|
||||||
for level = 0, 1 do
|
for level = 0, 1 do
|
||||||
local fail = false
|
|
||||||
local solids = countSolids(pos,node,level)
|
local solids = countSolids(pos,node,level)
|
||||||
if solids == 8 then
|
if solids == 8 then
|
||||||
return true
|
return true
|
||||||
@ -99,7 +97,6 @@ local function calculateClosed(pos)
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
error("What direction is this???",direction)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -448,8 +445,8 @@ function homedecor.flip_door(pos, node, player, name, side, isClosed)
|
|||||||
-- and if not isClosed, a closed door
|
-- and if not isClosed, a closed door
|
||||||
isClosed = not isClosed
|
isClosed = not isClosed
|
||||||
|
|
||||||
local rside = nil
|
local rside
|
||||||
local nfdir = nil
|
local nfdir
|
||||||
local ofdir = node.param2 or 0
|
local ofdir = node.param2 or 0
|
||||||
if side == "left" then
|
if side == "left" then
|
||||||
rside = "right"
|
rside = "right"
|
||||||
@ -485,7 +482,7 @@ function homedecor.flip_gate(pos, node, player, gate, oc)
|
|||||||
-- since right facing gates use "open" nodes for closed, we need an
|
-- since right facing gates use "open" nodes for closed, we need an
|
||||||
-- isClosed flag to tell if it's "really" closed.
|
-- isClosed flag to tell if it's "really" closed.
|
||||||
|
|
||||||
local gateresult = nil
|
local gateresult
|
||||||
if oc == "closed" then
|
if oc == "closed" then
|
||||||
gateresult = "homedecor:gate_"..gate.."_open"
|
gateresult = "homedecor:gate_"..gate.."_open"
|
||||||
else
|
else
|
||||||
|
@ -268,8 +268,6 @@ homedecor.register("swing", {
|
|||||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
for j = 0, height do -- then fill that space with ropes...
|
for j = 0, height do -- then fill that space with ropes...
|
||||||
local testpos = { x=pos.x, y=pos.y-j, z=pos.z }
|
local testpos = { x=pos.x, y=pos.y-j, z=pos.z }
|
||||||
local testnode = minetest.get_node(testpos)
|
|
||||||
local testreg = core.registered_nodes[testnode.name]
|
|
||||||
minetest.set_node(testpos, { name = "homedecor:swing_rope", param2 = fdir })
|
minetest.set_node(testpos, { name = "homedecor:swing_rope", param2 = fdir })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
local S = homedecor.gettext
|
|
||||||
|
|
||||||
homedecor.register("coatrack_wallmount", {
|
homedecor.register("coatrack_wallmount", {
|
||||||
tiles = { homedecor.plain_wood },
|
tiles = { homedecor.plain_wood },
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
local S = homedecor.gettext
|
|
||||||
|
|
||||||
local cutlery_cbox = {
|
local cutlery_cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
local S = homedecor.gettext
|
|
||||||
|
|
||||||
-- vectors to place one node next to or behind another
|
-- vectors to place one node next to or behind another
|
||||||
|
|
||||||
@ -67,8 +66,8 @@ end
|
|||||||
local function stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
|
local function stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
|
||||||
local placer_name = placer:get_player_name() or ""
|
local placer_name = placer:get_player_name() or ""
|
||||||
if is_buildable_to(placer_name, pos, pos2) then
|
if is_buildable_to(placer_name, pos, pos2) then
|
||||||
local fdir = fdir or minetest.dir_to_facedir(placer:get_look_dir())
|
local lfdir = fdir or minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
minetest.set_node(pos, { name = node1, param2 = fdir })
|
minetest.set_node(pos, { name = node1, param2 = lfdir })
|
||||||
node2 = node2 or "air" -- this can be used to clear buildable_to nodes even though we are using a multinode mesh
|
node2 = node2 or "air" -- this can be used to clear buildable_to nodes even though we are using a multinode mesh
|
||||||
-- do not assume by default, as we still might want to allow overlapping in some cases
|
-- do not assume by default, as we still might want to allow overlapping in some cases
|
||||||
local has_facedir = node2 ~= "air"
|
local has_facedir = node2 ~= "air"
|
||||||
@ -76,7 +75,7 @@ local function stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
|
|||||||
has_facedir = false
|
has_facedir = false
|
||||||
node2 = placeholder_node
|
node2 = placeholder_node
|
||||||
end
|
end
|
||||||
minetest.set_node(pos2, { name = node2, param2 = (has_facedir and fdir) or nil })
|
minetest.set_node(pos2, { name = node2, param2 = (has_facedir and lfdir) or nil })
|
||||||
|
|
||||||
-- call after_place_node of the placed node if available
|
-- call after_place_node of the placed node if available
|
||||||
local ctrl_node_def = minetest.registered_nodes[node1]
|
local ctrl_node_def = minetest.registered_nodes[node1]
|
||||||
@ -228,7 +227,7 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
|||||||
local rightclick_result = rightclick_pointed_thing(pointed_thing.under, placer, itemstack)
|
local rightclick_result = rightclick_pointed_thing(pointed_thing.under, placer, itemstack)
|
||||||
if rightclick_result then return rightclick_result end
|
if rightclick_result then return rightclick_result end
|
||||||
|
|
||||||
local pos, def = select_node(pointed_thing)
|
local pos, _ = select_node(pointed_thing)
|
||||||
if not pos then return itemstack end
|
if not pos then return itemstack end
|
||||||
|
|
||||||
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
||||||
@ -270,20 +269,19 @@ function homedecor.place_banister(itemstack, placer, pointed_thing)
|
|||||||
local left_fwd_below_pos = { x=pos.x+lxd+fxd, y=pos.y-1, z=pos.z+lzd+fzd }
|
local left_fwd_below_pos = { x=pos.x+lxd+fxd, y=pos.y-1, z=pos.z+lzd+fzd }
|
||||||
|
|
||||||
local below_node = minetest.get_node(below_pos)
|
local below_node = minetest.get_node(below_pos)
|
||||||
local fwd_node = minetest.get_node(fwd_pos)
|
--local fwd_node = minetest.get_node(fwd_pos)
|
||||||
local left_node = minetest.get_node(left_pos)
|
local left_node = minetest.get_node(left_pos)
|
||||||
local right_node = minetest.get_node(right_pos)
|
local right_node = minetest.get_node(right_pos)
|
||||||
local left_fwd_node = minetest.get_node(left_fwd_pos)
|
local left_fwd_node = minetest.get_node(left_fwd_pos)
|
||||||
local right_fwd_node = minetest.get_node(right_fwd_pos)
|
local right_fwd_node = minetest.get_node(right_fwd_pos)
|
||||||
local left_below_node = minetest.get_node({x=left_pos.x, y=left_pos.y-1, z=left_pos.z})
|
local left_below_node = minetest.get_node({x=left_pos.x, y=left_pos.y-1, z=left_pos.z})
|
||||||
local right_below_node = minetest.get_node({x=right_pos.x, y=right_pos.y-1, z=right_pos.z})
|
local right_below_node = minetest.get_node({x=right_pos.x, y=right_pos.y-1, z=right_pos.z})
|
||||||
local right_fwd_above_node = minetest.get_node(right_fwd_above_pos)
|
--local right_fwd_above_node = minetest.get_node(right_fwd_above_pos)
|
||||||
local left_fwd_above_node = minetest.get_node(left_fwd_above_pos)
|
--local left_fwd_above_node = minetest.get_node(left_fwd_above_pos)
|
||||||
local right_fwd_below_node = minetest.get_node(right_fwd_below_pos)
|
local right_fwd_below_node = minetest.get_node(right_fwd_below_pos)
|
||||||
local left_fwd_below_node = minetest.get_node(left_fwd_below_pos)
|
local left_fwd_below_node = minetest.get_node(left_fwd_below_pos)
|
||||||
|
|
||||||
local new_place_name = itemstack:get_name()
|
local new_place_name = itemstack:get_name()
|
||||||
local n = 0
|
|
||||||
|
|
||||||
-- try to place a diagonal one on the side of blocks stacked like stairs
|
-- try to place a diagonal one on the side of blocks stacked like stairs
|
||||||
-- or follow an existing diagonal with another.
|
-- or follow an existing diagonal with another.
|
||||||
|
@ -171,28 +171,28 @@ function homedecor.register_furnace(name, furnacedef)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local name_active = name.."_active"
|
local n_active = name.."_active"
|
||||||
|
|
||||||
homedecor.register(name, def)
|
homedecor.register(name, def)
|
||||||
homedecor.register(name_active, def_active)
|
homedecor.register(n_active, def_active)
|
||||||
|
|
||||||
local name, name_active = "homedecor:"..name, "homedecor:"..name_active
|
local nname, name_active = "homedecor:"..name, "homedecor:"..n_active
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {name, name_active, name.."_locked", name_active.."_locked"},
|
nodenames = {nname, name_active, nname.."_locked", name_active.."_locked"},
|
||||||
label = "furnaces",
|
label = "furnaces",
|
||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
for i, name in ipairs({
|
for i, pname in ipairs({
|
||||||
"fuel_totaltime",
|
"fuel_totaltime",
|
||||||
"fuel_time",
|
"fuel_time",
|
||||||
"src_totaltime",
|
"src_totaltime",
|
||||||
"src_time"
|
"src_time"
|
||||||
}) do
|
}) do
|
||||||
if meta:get_string(name) == "" then
|
if meta:get_string(pname) == "" then
|
||||||
meta:set_float(name, 0.0)
|
meta:set_float(pname, 0.0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -239,9 +239,9 @@ function homedecor.register_furnace(name, furnacedef)
|
|||||||
|
|
||||||
local fuel = nil
|
local fuel = nil
|
||||||
local afterfuel
|
local afterfuel
|
||||||
local cooked = nil
|
cooked = nil
|
||||||
local fuellist = inv:get_list("fuel")
|
local fuellist = inv:get_list("fuel")
|
||||||
local srclist = inv:get_list("src")
|
srclist = inv:get_list("src")
|
||||||
|
|
||||||
if srclist then
|
if srclist then
|
||||||
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||||
@ -252,7 +252,7 @@ function homedecor.register_furnace(name, furnacedef)
|
|||||||
|
|
||||||
if (not fuel) or (fuel.time <= 0) then
|
if (not fuel) or (fuel.time <= 0) then
|
||||||
meta:set_string("infotext",desc..S(": Out of fuel"))
|
meta:set_string("infotext",desc..S(": Out of fuel"))
|
||||||
swap_node(pos, name..locked)
|
swap_node(pos, nname..locked)
|
||||||
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -260,7 +260,7 @@ function homedecor.register_furnace(name, furnacedef)
|
|||||||
if cooked.item:is_empty() then
|
if cooked.item:is_empty() then
|
||||||
if was_active then
|
if was_active then
|
||||||
meta:set_string("infotext",S("%s is empty"):format(desc))
|
meta:set_string("infotext",S("%s is empty"):format(desc))
|
||||||
swap_node(pos, name..locked)
|
swap_node(pos, nname..locked)
|
||||||
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
@ -268,7 +268,7 @@ function homedecor.register_furnace(name, furnacedef)
|
|||||||
|
|
||||||
if not inv:room_for_item("dst", cooked.item) then
|
if not inv:room_for_item("dst", cooked.item) then
|
||||||
meta:set_string("infotext", desc..S(": output bins are full"))
|
meta:set_string("infotext", desc..S(": output bins are full"))
|
||||||
swap_node(pos, name..locked)
|
swap_node(pos, nname..locked)
|
||||||
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
meta:set_string("formspec", make_formspec(furnacedef, 0))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
homedecor = homedecor or {}
|
homedecor = homedecor or {}
|
||||||
local S = homedecor.gettext
|
|
||||||
local placeholder_node = "homedecor:expansion_placeholder"
|
local placeholder_node = "homedecor:expansion_placeholder"
|
||||||
|
|
||||||
--wrapper around minetest.register_node that sets sane defaults and interprets some specialized settings
|
--wrapper around minetest.register_node that sets sane defaults and interprets some specialized settings
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
function homedecor.sit(pos, node, clicker)
|
function homedecor.sit(pos, node, clicker)
|
||||||
do return end -- delete it when the engine is stabler for the player's physics
|
return -- delete it when the engine is stabler for the player's physics
|
||||||
|
--[[
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local param2 = node.param2
|
local param2 = node.param2
|
||||||
local name = clicker:get_player_name()
|
local name = clicker:get_player_name()
|
||||||
@ -29,4 +30,5 @@ function homedecor.sit(pos, node, clicker)
|
|||||||
clicker:set_look_yaw(4.75)
|
clicker:set_look_yaw(4.75)
|
||||||
else return end
|
else return end
|
||||||
end
|
end
|
||||||
|
--]]
|
||||||
end
|
end
|
||||||
|
@ -25,8 +25,8 @@ function homedecor.start_particle_spawner(pos, node, particledef, soundname)
|
|||||||
|
|
||||||
if id ~= 0 then
|
if id ~= 0 then
|
||||||
if s_handle then
|
if s_handle then
|
||||||
minetest.after(0, function(s_handle)
|
minetest.after(0, function(handle)
|
||||||
minetest.sound_stop(s_handle)
|
minetest.sound_stop(handle)
|
||||||
end, s_handle)
|
end, s_handle)
|
||||||
end
|
end
|
||||||
minetest.delete_particlespawner(id)
|
minetest.delete_particlespawner(id)
|
||||||
@ -104,8 +104,8 @@ function homedecor.stop_particle_spawner(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if s_handle then
|
if s_handle then
|
||||||
minetest.after(0, function(s_handle)
|
minetest.after(0, function(handle)
|
||||||
minetest.sound_stop(s_handle)
|
minetest.sound_stop(handle)
|
||||||
end, s_handle)
|
end, s_handle)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,9 +32,6 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
|
|||||||
itemstack, pointed_thing)
|
itemstack, pointed_thing)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local pitch = placer:get_look_pitch()
|
|
||||||
local fdir = core.dir_to_facedir(placer:get_look_dir())
|
|
||||||
local wield_name = itemstack:get_name()
|
|
||||||
|
|
||||||
local above = pointed_thing.above
|
local above = pointed_thing.above
|
||||||
local under = pointed_thing.under
|
local under = pointed_thing.under
|
||||||
@ -50,7 +47,6 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
|
|||||||
if undef and undef.buildable_to then
|
if undef and undef.buildable_to then
|
||||||
pos = pointed_thing.under
|
pos = pointed_thing.under
|
||||||
node = unode
|
node = unode
|
||||||
iswall = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if core.is_protected(pos, placer:get_player_name()) then
|
if core.is_protected(pos, placer:get_player_name()) then
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
-- This file supplies glowlights
|
-- This file supplies glowlights
|
||||||
|
|
||||||
local dirs1 = { 20, 23, 22, 21 }
|
|
||||||
local dirs2 = { 9, 18, 7, 12 }
|
local dirs2 = { 9, 18, 7, 12 }
|
||||||
|
|
||||||
local S = homedecor.gettext
|
local S = homedecor.gettext
|
||||||
@ -394,8 +393,6 @@ homedecor.register("lattice_lantern_small", {
|
|||||||
|
|
||||||
local repl = { off="low", low="med", med="hi", hi="max", max="off", }
|
local repl = { off="low", low="med", med="hi", hi="max", max="off", }
|
||||||
|
|
||||||
local brights_tab = { 0, 50, 100, 150, 200 }
|
|
||||||
|
|
||||||
local lamp_colors = {
|
local lamp_colors = {
|
||||||
{"white", "#ffffffe0:175"},
|
{"white", "#ffffffe0:175"},
|
||||||
{"blue", "#2626c6e0:200"},
|
{"blue", "#2626c6e0:200"},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Various kinds of tables
|
|
||||||
|
|
||||||
local S = homedecor.gettext
|
local S = homedecor.gettext
|
||||||
|
|
||||||
|
-- Various kinds of tables
|
||||||
|
|
||||||
local materials = {
|
local materials = {
|
||||||
{"glass","Glass"},
|
{"glass","Glass"},
|
||||||
{"wood","Wood"}
|
{"wood","Wood"}
|
||||||
@ -15,7 +15,7 @@ local tables_cbox = {
|
|||||||
for i in ipairs(materials) do
|
for i in ipairs(materials) do
|
||||||
local m = materials[i][1]
|
local m = materials[i][1]
|
||||||
local d = materials[i][2]
|
local d = materials[i][2]
|
||||||
local s = nil
|
local s
|
||||||
|
|
||||||
if m == "glass" then
|
if m == "glass" then
|
||||||
s = default.node_sound_glass_defaults()
|
s = default.node_sound_glass_defaults()
|
||||||
@ -154,7 +154,7 @@ homedecor.register("utility_table_top", {
|
|||||||
|
|
||||||
-- Various kinds of table legs
|
-- Various kinds of table legs
|
||||||
|
|
||||||
local materials = {"brass", "wrought_iron"}
|
materials = {"brass", "wrought_iron"}
|
||||||
|
|
||||||
for _, t in ipairs(materials) do
|
for _, t in ipairs(materials) do
|
||||||
homedecor.register("table_legs_"..t, {
|
homedecor.register("table_legs_"..t, {
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
local S = homedecor.gettext
|
|
||||||
|
|
||||||
local tg_cbox = {
|
local tg_cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
local S = homedecor.gettext
|
|
||||||
|
|
||||||
local wd_cbox = {
|
local wd_cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -43,7 +42,6 @@ homedecor.register("wardrobe", {
|
|||||||
"listring[]")
|
"listring[]")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
local skins = {"male1", "male2", "male3", "male4", "male5"}
|
local skins = {"male1", "male2", "male3", "male4", "male5"}
|
||||||
local playerName = sender:get_player_name()
|
local playerName = sender:get_player_name()
|
||||||
local armor_mod = minetest.get_modpath("3d_armor")
|
local armor_mod = minetest.get_modpath("3d_armor")
|
||||||
|
@ -45,7 +45,6 @@ minetest.register_node("inbox:empty", {
|
|||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local player = clicker:get_player_name()
|
local player = clicker:get_player_name()
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
if owner == player then
|
if owner == player then
|
||||||
minetest.show_formspec(
|
minetest.show_formspec(
|
||||||
clicker:get_player_name(),
|
clicker:get_player_name(),
|
||||||
|
Loading…
Reference in New Issue
Block a user