2016-05-26 22:35:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
--[[
|
|
|
|
What it is: Simple mod for extra glass, including plain and patterned stained glass, and one way glass.
|
|
|
|
Who did it: Shara RedCat.
|
|
|
|
]]
|
|
|
|
|
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
local is_darklands = true
|
|
|
|
|
2016-05-26 22:35:24 +02:00
|
|
|
--boring glass because why not?
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:clear_glass", {
|
|
|
|
description = "Clear Glass",
|
|
|
|
tiles = {"abriglass_clearglass.png"},
|
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "glasslike",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
local plain_colors = {
|
|
|
|
"green", "blue", "red", "yellow",
|
|
|
|
}
|
2016-05-26 22:35:24 +02:00
|
|
|
--glass lights
|
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
local i
|
|
|
|
for i in ipairs(plain_colors) do
|
|
|
|
local name = plain_colors[i]
|
|
|
|
local description = name:sub(1,1):upper()..name:sub(2).." Glass Light"
|
2016-05-26 22:35:24 +02:00
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
local nodesuffix = 'glass_light_'..name
|
2016-05-26 22:35:24 +02:00
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
minetest.debug("i="..i..", name="..name..", desc="..description);
|
2016-05-26 22:35:24 +02:00
|
|
|
|
2016-11-20 14:25:06 +01:00
|
|
|
minetest.register_node("abriglass:"..nodesuffix, {
|
|
|
|
description = "Green Glass Light",
|
|
|
|
tiles = { "abriglass_light"..name..".png"},
|
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
light_source = (is_darklands and 14 or 4),
|
|
|
|
drawtype = "glasslike",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
end
|
2016-05-26 22:35:24 +02:00
|
|
|
|
|
|
|
--crystal, for later use in crafting recipes
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:ghost_crystal", {
|
|
|
|
description = "Ghost Crystal",
|
|
|
|
tiles = {"abriglass_ghost_crystal.png"},
|
2016-06-05 21:39:31 +02:00
|
|
|
wield_image = "abriglass_ghost_crystal_wield.png",
|
2016-05-26 22:35:24 +02:00
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
2016-11-20 14:25:06 +01:00
|
|
|
light_source = (is_darklands and 14 or 4),
|
2016-05-26 22:35:24 +02:00
|
|
|
drawtype = "glasslike",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
--patterned glass
|
|
|
|
|
|
|
|
local pattern_list = { --{name, description, image}
|
|
|
|
{"stainedglass_tiles_dark", "Stained Glass", "stainedglass_tiles1",},
|
|
|
|
{"stainedglass_tiles_pale", "Stained Glass", "stainedglass_tiles2",},
|
|
|
|
{"stainedglass_pattern01", "Stained Glass", "stainedglass_pattern01",},
|
|
|
|
{"stainedglass_pattern02", "Cage Glass", "stainedglass_pattern02",},
|
|
|
|
{"stainedglass_pattern03", "Stained Glass", "stainedglass_pattern03",},
|
|
|
|
{"stainedglass_pattern04", "Stained Glass Cross", "stainedglass_pattern04",},
|
|
|
|
{"stainedglass_pattern05", "Stained Glass", "stainedglass_pattern05",},
|
|
|
|
}
|
|
|
|
|
|
|
|
for i in ipairs(pattern_list) do
|
|
|
|
local name = pattern_list[i][1]
|
|
|
|
local description = pattern_list[i][2]
|
|
|
|
local image = pattern_list[i][3]
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:"..name, {
|
|
|
|
description = description,
|
|
|
|
tiles = {"abriglass_"..image..".png"},
|
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
2016-11-20 14:25:06 +01:00
|
|
|
light_source = (is_darklands and 5 or 4),
|
2016-05-26 22:35:24 +02:00
|
|
|
drawtype = "glasslike",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
--one-way glass
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:oneway_glass_dark", {
|
|
|
|
description = "Dark One-Way Glass",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2016-05-26 23:51:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2016-05-26 22:35:24 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
2016-05-26 23:51:27 +02:00
|
|
|
groups = {cracky = 3},
|
2016-05-26 22:35:24 +02:00
|
|
|
tiles = {"abriglass_oneway_plain_glass.png", -- up
|
|
|
|
"abriglass_oneway_plain_glass.png", -- down
|
|
|
|
"abriglass_oneway_plain_glass.png", -- right
|
|
|
|
"abriglass_oneway_plain_glass.png", -- left
|
|
|
|
"abriglass_oneway_face.png", -- back
|
|
|
|
"abriglass_oneway_wall.png"}, -- front
|
|
|
|
is_ground_content = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
inventory_image = minetest.inventorycube("abriglass_oneway_face.png")
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:oneway_glass_pale", {
|
|
|
|
description = "White One-Way Glass",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
paramtype = "light",
|
2016-05-26 23:51:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2016-05-26 22:35:24 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
|
|
|
},
|
|
|
|
},
|
2016-05-26 23:51:27 +02:00
|
|
|
groups = {cracky = 3},
|
2016-05-26 22:35:24 +02:00
|
|
|
tiles = {"abriglass_oneway_plain_glass.png", -- up
|
|
|
|
"abriglass_oneway_plain_glass.png", -- down
|
|
|
|
"abriglass_oneway_plain_glass.png", -- right
|
|
|
|
"abriglass_oneway_plain_glass.png", -- left
|
|
|
|
"abriglass_oneway_face.png^[colorize:#F8F8FF:200", -- back
|
|
|
|
"abriglass_oneway_wall.png^[colorize:#E6E6FA:200"}, -- front
|
|
|
|
is_ground_content = false,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
inventory_image = minetest.inventorycube("abriglass_oneway_face.png^[colorize:#F8F8FF:200")
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
--normal blocks to match one-way glass
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:oneway_wall_dark", {
|
|
|
|
description = "Dark Block",
|
|
|
|
tiles = {"abriglass_oneway_wall.png"},
|
|
|
|
groups = {cracky = 3},
|
2016-05-26 23:51:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2016-05-26 22:35:24 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:oneway_wall_pale", {
|
|
|
|
description = "Pale Block",
|
|
|
|
tiles = {"abriglass_oneway_wall.png^[colorize:#E6E6FA:200"},
|
|
|
|
groups = {cracky = 3},
|
2016-05-26 23:51:27 +02:00
|
|
|
paramtype2 = "facedir",
|
2016-05-26 22:35:24 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
--light node
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:hidden_light", {
|
|
|
|
description = "Hidden Light",
|
|
|
|
tiles = {"abriglass_oneway_plain_glass.png"},
|
|
|
|
groups = {cracky = 3, not_in_creative_inventory=1},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
2016-11-20 14:25:06 +01:00
|
|
|
light_source = (is_darklands and 7 or 4), -- not sure about this one
|
2016-05-26 22:35:24 +02:00
|
|
|
drawtype = "glasslike",
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
--undecorated coloured glass, all using plain glass texture
|
|
|
|
|
|
|
|
local glass_list = { --{name, description, colour}
|
|
|
|
{"black", "Darkened", "292421", }, {"blue", "Blue", "0000FF", },
|
|
|
|
{"cyan", "Cyan", "00FFFF", }, {"green", "Green", "00FF00", },
|
|
|
|
{"magenta", "Magenta", "FF00FF", }, {"orange", "Orange", "FF6103", },
|
|
|
|
{"purple", "Purple", "800080", }, {"red", "Red", "FF0000", },
|
|
|
|
{"yellow", "Yellow", "FFFF00", },
|
|
|
|
}
|
|
|
|
|
|
|
|
for i in ipairs(glass_list) do
|
|
|
|
local name = glass_list[i][1]
|
|
|
|
local description = glass_list[i][2]
|
|
|
|
local colour = glass_list[i][3]
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:stained_glass_"..name, {
|
|
|
|
description = description.." Glass",
|
|
|
|
tiles = {"abriglass_plainglass.png^[colorize:#"..colour..":122"},
|
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
light_source = 4,
|
|
|
|
drawtype = "glasslike",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
minetest.register_node("abriglass:stained_glass_frosted", {
|
|
|
|
description = "Frosted Glass",
|
|
|
|
tiles = {"abriglass_plainglass.png"}, --base texture
|
|
|
|
groups = {cracky = 3},
|
|
|
|
use_texture_alpha = true,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
light_source = 4,
|
|
|
|
drawtype = "glasslike",
|
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
2016-11-20 15:01:55 +01:00
|
|
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
|
|
|
dofile(modpath.."/crafting.lua")
|
2016-05-26 22:35:24 +02:00
|
|
|
|