local reg_alias = ocutil.safe_register_alias local reg_node = ocutil.safe_register_node local neednode -- =================================================================== neednode = "projlights:light_node" -- reg_node (neednode, { description = "light node", drawtype = "airlike", walkable = false, pointable = false, sunlight_propagates = true, paramtype = 'light', light_source = 14, buildable_to = true, is_ground_content = false, groups = {unbreakable=1, not_in_creative_inventory = 1}, }) reg_alias ("projection_light:light_node" , neednode) reg_alias ("projection_lights:light_node" , neednode) -- =================================================================== neednode = "projlights:light" -- reg_node (neednode, { description = "Projection Lighting", drawtype = "nodebox", node_box = { type = "fixed", fixed = { {-0.5 , 0.3125, -0.5, 0.5, 0.5, 0.5}, }, }, tiles = { 'cg72_light.png' }, sunlight_propagates = false, paramtype = 'light', walkable = true, light_source = 14, drop = 'projlights:light', groups = { snappy = 3 }, selection_box = { type = "fixed", fixed = { {-0.5 , 0.3125, -0.5, 0.5, 0.5, 0.5}, }, }, on_place = function(itemstack, placer, pointed_thing) local pos = pointed_thing.above local pos1 = {x=pos.x, y=pos.y-1, z=pos.z} for i = 1,60 do local pos2 = {x=pos.x, y=pos.y-i, z=pos.z} local pos3 = {x=pos2.x, y=pos2.y-1, z=pos2.z} if minetest.get_node(pos1).name == "air" then minetest.add_node(pos1, {name = "projlights:light_node"} ) end if minetest.get_node(pos3).name == "air" and minetest.get_node(pos2).name == "projlights:light_node" then minetest.add_node(pos3, {name = "projlights:light_node"} ) end end return minetest.item_place(itemstack, placer, pointed_thing) end, after_dig_node = function(pos, oldnode, oldmetadata, digger) for i = 1,60 do local pos2 = {x=pos.x, y=pos.y-i, z=pos.z} if minetest.get_node(pos).name == "projlights:light" then minetest.add_node(pos, {name = "air"} ) end if minetest.get_node(pos2).name == "projlights:light_node" then minetest.add_node(pos2, {name = "air"} ) elseif minetest.get_node(pos2).name == "projlights:light" then return end end end , }) reg_alias ("projection_light:light" , neednode) reg_alias ("projection_lights:light" , neednode) -- =================================================================== minetest.register_craft ({ output = "projlights:light" , recipe = { { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", }, { "group:glass", "default:torch", "group:glass", }, { "group:glass", "default:torch", "group:glass", }, } }) minetest.register_craft ({ output = "projlights:light" , recipe = { { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", }, { "default:glass", "default:torch", "default:glass", }, { "default:glass", "default:torch", "default:glass", }, } }) neednode = "moreblocks:super_glo_glass" -- if ocutil.thing_exists (neednode) then minetest.register_craft ({ output = "projlights:light" , recipe = { { neednode, "", "", } , { neednode, "", "", } , { neednode, "", "", } , } }) end neednode = "coderblocks:glowlight_quarter_white" -- if ocutil.thing_exists (neednode) then minetest.register_craft ({ output = "projlights:light" , recipe = { { neednode, "", "", }, { neednode, "", "", }, { neednode, "", "", }, } }) end