2019-12-07 22:45:34 -05:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
|
|
|
local minetest, nodecore
|
|
|
|
= minetest, nodecore
|
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
2019-12-08 16:13:44 -05:00
|
|
|
local txr_frame = modname .. "_glass_edges.png^(nc_tree_tree_side.png^[mask:"
|
|
|
|
.. modname .. "_tank_mask.png)"
|
|
|
|
local txr_pane = modname .. "_glass_glare.png"
|
|
|
|
|
2019-12-07 22:45:34 -05:00
|
|
|
minetest.register_node(modname .. ":shelf", {
|
|
|
|
description = "Glass Tank",
|
2019-12-08 16:41:59 -05:00
|
|
|
tiles = {
|
|
|
|
txr_pane .. "^" .. txr_frame,
|
|
|
|
txr_pane .. "^" .. txr_frame,
|
|
|
|
txr_frame
|
|
|
|
},
|
2019-12-07 22:45:34 -05:00
|
|
|
selection_box = nodecore.fixedbox(),
|
|
|
|
collision_box = nodecore.fixedbox(),
|
|
|
|
groups = {
|
|
|
|
silica = 1,
|
|
|
|
silica_clear = 1,
|
|
|
|
cracky = 3,
|
2019-12-08 16:55:38 -05:00
|
|
|
flammable = 20,
|
2019-12-08 22:31:12 -05:00
|
|
|
fire_fuel = 2,
|
2019-12-07 22:45:34 -05:00
|
|
|
visinv = 1,
|
2019-12-08 16:41:59 -05:00
|
|
|
storebox = 1,
|
2019-12-07 22:45:34 -05:00
|
|
|
totable = 1
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
sounds = nodecore.sounds("nc_optics_glassy"),
|
2019-12-08 16:55:38 -05:00
|
|
|
storebox_access = function(pt) return pt.above.y > pt.under.y end,
|
|
|
|
on_ignite = function(pos)
|
|
|
|
if minetest.get_node(pos).name == modname .. ":shelf" then
|
2019-12-09 21:10:39 -05:00
|
|
|
return {modname .. ":glass_crude", nodecore.stack_get(pos)}
|
2019-12-08 16:55:38 -05:00
|
|
|
end
|
2019-12-09 21:10:39 -05:00
|
|
|
return modname .. ":glass_crude"
|
2019-12-08 16:55:38 -05:00
|
|
|
end
|
2019-12-07 22:45:34 -05:00
|
|
|
})
|
2019-12-08 14:59:57 -05:00
|
|
|
|
|
|
|
nodecore.register_craft({
|
|
|
|
label = "assemble glass tank",
|
|
|
|
norotate = true,
|
|
|
|
nodes = {
|
|
|
|
{match = "nc_woodwork:frame", replace = "air"},
|
|
|
|
{x = -1, z = -1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = 1, z = -1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = -1, z = 1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = 1, z = 1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = 0, z = -1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = 0, z = 1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = -1, z = 0, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = 1, z = 0, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
nodecore.register_craft({
|
|
|
|
label = "assemble glass tank",
|
|
|
|
norotate = true,
|
|
|
|
nodes = {
|
|
|
|
{match = "nc_woodwork:frame", replace = "air"},
|
|
|
|
{x = 0, z = -1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = 0, z = 1, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = -1, z = 0, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = 1, z = 0, match = modname .. ":glass", replace = modname .. ":shelf"},
|
|
|
|
{x = -1, z = -1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = 1, z = 1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = -1, z = 1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
{x = 1, z = -1, match = "nc_woodwork:staff", replace = "air"},
|
|
|
|
}
|
|
|
|
})
|