1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-07-01 14:20:23 +02:00

Rewrite lighting to use engine's 6d facedir prediction code

changed the names of a couple of internal functions to compensate.

this makes lib_6d.lua obsolete.
This commit is contained in:
Vanessa Ezekowitz
2013-11-07 21:22:16 -05:00
parent dfd45b2c10
commit c8be033292
4 changed files with 21 additions and 99 deletions

View File

@ -87,14 +87,7 @@ minetest.register_node('homedecor:glowlight_half_yellow', {
groups = { snappy = 3 },
light_source = LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})
minetest.register_node('homedecor:glowlight_quarter_yellow', {
@ -124,17 +117,9 @@ minetest.register_node('homedecor:glowlight_quarter_yellow', {
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})
-- White
minetest.register_node('homedecor:glowlight_half_white', {
@ -164,13 +149,7 @@ minetest.register_node('homedecor:glowlight_half_white', {
groups = { snappy = 3 },
light_source = LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})
minetest.register_node('homedecor:glowlight_quarter_white', {
@ -200,13 +179,7 @@ minetest.register_node('homedecor:glowlight_quarter_white', {
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})
-- Glowlight "cubes"
@ -239,13 +212,7 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow', {
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})
minetest.register_node('homedecor:glowlight_small_cube_white', {
@ -275,12 +242,6 @@ minetest.register_node('homedecor:glowlight_small_cube_white', {
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = function(itemstack, placer, pointed_thing)
if not homedecor:node_is_owned(pointed_thing.under, placer)
and not homedecor:node_is_owned(pointed_thing.above, placer) then
lib_6d:rotate_and_place(itemstack, placer, pointed_thing, homedecor.expect_infinite_stacks)
end
return itemstack
end
on_place = homedecor.protect_and_rotate
})