170 lines
6.2 KiB
Lua
Raw Normal View History

2021-09-04 23:06:34 -04:00
--one glass block is 16 panes
--connected glass exists for legacy reasons but is not supported at this time
2021-04-07 20:46:25 -04:00
--glass nodes
2021-04-06 22:09:11 -04:00
minetest.register_node("fl_glass:connected_glass", {
2021-03-24 11:17:18 -04:00
description = "connected glass",
drawtype = "glasslike_framed",
tiles = {"farlands_glass.png", "farlands_glass_detail.png"},
paramtype = "light",
paramtype2 = "glasslikeliquidlevel",
sunlight_propagates = true,
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 1, glass = 1, not_in_creative_inventory = 1},
2021-03-24 11:17:18 -04:00
})
2021-04-06 22:09:11 -04:00
minetest.register_node("fl_glass:framed_glass", {
2021-03-24 11:17:18 -04:00
description = "framed glass",
drawtype = "glasslike",
tiles = {"farlands_glass.png", "farlands_glass_detail.png"},
paramtype = "light",
paramtype2 = "glasslikeliquidlevel",
sunlight_propagates = true,
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 1, glass = 1, glass_block = 1},
2021-03-24 11:17:18 -04:00
})
2021-04-06 22:09:11 -04:00
minetest.register_alias("fl_glass:glass_connected", "fl_glass:connected_glass")
minetest.register_alias("fl_glass:glass_framed", "fl_glass:framed_glass")
2021-04-07 20:46:25 -04:00
--tinted colorable glass nodes
2021-04-06 22:09:11 -04:00
minetest.register_node("fl_glass:tinted_connected_glass", {
description = "tinted connected glass",
drawtype = "glasslike_framed",
tiles = {"farlands_glass.png", "farlands_glass_sheet.png^farlands_glass_detail.png"},
paramtype = "light",
paramtype2 = "color",
sunlight_propagates = true,
use_texture_alpha = "blend",
palette = "farlands_palette.png",
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 1, glass = 1, glass_block = 1, not_in_creative_inventory = 1},
2021-04-06 22:09:11 -04:00
preserve_metadata = function(pos, oldnode, oldmeta, drops)
drops[1]:get_meta():set_string("description", fl_dyes.dyes[oldnode.param2 + 1][2] .. " tinted connected glass")
end,
})
minetest.register_node("fl_glass:tinted_framed_glass", {
description = "tinted framed glass",
drawtype = "glasslike",
tiles = {"farlands_glass_sheet.png^farlands_glass.png", "farlands_glass_detail.png"},
paramtype = "light",
paramtype2 = "color",
sunlight_propagates = true,
use_texture_alpha = "blend",
palette = "farlands_palette.png",
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 1, glass = 1, glass_block = 1},
2021-04-06 22:09:11 -04:00
preserve_metadata = function(pos, oldnode, oldmeta, drops)
drops[1]:get_meta():set_string("description", fl_dyes.dyes[oldnode.param2 + 1][2] .. " tinted framed glass")
end,
})
for counter, dye in pairs(fl_dyes.dyes) do
local out_item = ItemStack(minetest.itemstring_with_palette("fl_glass:tinted_connected_glass", counter - 1))
out_item:get_meta():set_string("description", fl_dyes.dyes[counter][2] .. " tinted connected glass")
minetest.register_craft({
output = out_item:to_string(),
type = "shapeless",
recipe = {
"fl_glass:connected_glass",
"fl_dyes:" .. dye[1] .. "_dye"
},
})
end
for counter, dye in pairs(fl_dyes.dyes) do
local out_item = ItemStack(minetest.itemstring_with_palette("fl_glass:tinted_framed_glass", counter - 1))
out_item:get_meta():set_string("description", fl_dyes.dyes[counter][2] .. " tinted framed glass")
minetest.register_craft({
output = out_item:to_string(),
type = "shapeless",
recipe = {
"fl_glass:framed_glass",
"fl_dyes:" .. dye[1] .. "_dye"
},
})
2021-04-07 20:46:25 -04:00
end
-- glass panes
minetest.register_node("fl_glass:framed_glass_panes", {
description = "framed glass pane",
inventory_image = "farlands_pane_glass.png",
wield_image = "farlands_pane_glass.png",
wield_scale = {x = 1, y = 1, z = 0.5},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
use_texture_alpha = "blend",
tiles = {
"farlands_demo.png",
"farlands_demo.png",
"farlands_pane_glass.png",
},
node_box = {
type = "connected",
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
connect_front = {{-1/32, -1/2, -1/2, 1/32, 1/2, -1/32}},
connect_left = {{-1/2, -1/2, -1/32, -1/32, 1/2, 1/32}},
connect_back = {{-1/32, -1/2, 1/32, 1/32, 1/2, 1/2}},
connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 2, pane = 1, glass = 1, glass_pane = 1},
2021-04-07 20:46:25 -04:00
connects_to = {"group:pane", "group:glass", "group:wood_related"},
})
minetest.register_node("fl_glass:tinted_framed_glass_panes", {
description = "tinted framed glass pane",
inventory_image = "farlands_glass_sheet.png^farlands_pane_glass.png",
wield_image = "farlands_glass_sheet.png^farlands_pane_glass.png",
wield_scale = {x = 1, y = 1, z = 0.5},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "color",
palette = "farlands_palette.png",
use_texture_alpha = "blend",
tiles = {
"farlands_demo.png",
"farlands_demo.png",
"farlands_glass_sheet.png^farlands_pane_glass.png",
},
node_box = {
type = "connected",
fixed = {{-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}},
connect_front = {{-1/32, -1/2, -1/2, 1/32, 1/2, -1/32}},
connect_left = {{-1/2, -1/2, -1/32, -1/32, 1/2, 1/32}},
connect_back = {{-1/32, -1/2, 1/32, 1/32, 1/2, 1/2}},
connect_right = {{1/32, -1/2, -1/32, 1/2, 1/2, 1/32}},
},
2021-09-04 23:06:34 -04:00
groups = {dig_glass = 2, pane = 1, glass = 1, glass_pane = 1},
connects_to = {"group:pane", "group:glass", "group:wood_related",},
2021-04-07 20:46:25 -04:00
preserve_metadata = function(pos, oldnode, oldmeta, drops)
2021-06-27 13:01:59 -04:00
drops[1]:get_meta():set_string(
"description",
fl_dyes.dyes[oldnode.param2 + 1][2] .. " tinted framed glass pane"
)
2021-04-07 20:46:25 -04:00
end,
})
for counter, dye in pairs(fl_dyes.dyes) do
local out_item = ItemStack(minetest.itemstring_with_palette("fl_glass:tinted_framed_glass_panes", counter - 1))
out_item:get_meta():set_string("description", fl_dyes.dyes[counter][2] .. " tinted framed glass pane")
minetest.register_craft({
output = out_item:to_string(),
type = "shapeless",
recipe = {
"fl_glass:framed_glass_panes",
"fl_dyes:" .. dye[1] .. "_dye"
},
})
2021-09-04 23:06:34 -04:00
end
minetest.register_craft({
type = "shapeless",
output = "fl_glass:framed_glass_panes 16",
recipe = {"fl_glass:framed_glass"}
})
minetest.register_craft({
type = "cooking",
output = "fl_glass:framed_glass",
recipe = "fl_stone:sand",
cooktime = 3,
})