Add mirror collisionbox

master
Wuzzy 2022-01-09 21:02:32 +01:00
parent baee96f2de
commit fe2cd30111
1 changed files with 15 additions and 0 deletions

View File

@ -193,6 +193,12 @@ local register_element = function(subname, def, options)
end
end
-- Mirror nodebox
local wedge_box = {}
for i=-8, 7 do
table.insert(wedge_box, { i/16, -0.5, i/16, (i+1)/16, 0.5, 0.5 })
end
register_element("mirror", {
description = S("Mirror"),
paramtype = "light",
@ -231,6 +237,11 @@ register_element("mirror", {
},
light_source_on = 3,
collision_box = {
type = "fixed",
fixed = wedge_box,
},
groups = { rotatable = 1, laser_block = 1 },
sounds = lzr_sounds.node_sound_glass_defaults({
_rotate = {name = "lzr_laser_mirror_rotate", gain = 1.0},
@ -274,6 +285,10 @@ register_element("transmissive_mirror", {
"lzr_laser_transmissive_mirror_on_hole.png^lzr_laser_fixed.png",
},
light_source_on = 3,
collision_box = {
type = "fixed",
fixed = wedge_box,
},
groups = { rotatable = 1, laser_block = 1 },
sounds = lzr_sounds.node_sound_glass_defaults({
_rotate = {name = "lzr_laser_mirror_rotate", gain = 1.0},