Tidied one way glass

master
ezhh 2016-12-02 15:06:51 +00:00
parent 46f796bc00
commit a91a2f38d1
1 changed files with 36 additions and 46 deletions

View File

@ -107,51 +107,42 @@ end
-- one-way glass -- one-way glass
minetest.register_node("abriglass:oneway_glass_dark", { local oneway_list = { --{name, description, image}
description = "Dark One-Way Glass", {"dark", "Dark", "oneway_plain_glass", "oneway_face.png", "oneway_wall.png",},
drawtype = "nodebox", {"pale", "White", "oneway_plain_glass", "oneway_face.png^[colorize:#F8F8FF:200", "oneway_wall.png^[colorize:#E6E6FA:200",},
paramtype = "light", }
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
},
groups = {cracky = 3},
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", { for i in ipairs(oneway_list) do
description = "White One-Way Glass", local name = oneway_list[i][1]
drawtype = "nodebox", local description = oneway_list[i][2]
paramtype = "light", local image1 = oneway_list[i][3]
paramtype2 = "facedir", local image2 = oneway_list[i][4]
node_box = { local image3 = oneway_list[i][5]
type = "fixed",
fixed = { minetest.register_node("abriglass:oneway_glass_"..name, {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, description = description.." One-Way Glass",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
}, },
}, groups = {cracky = 3},
groups = {cracky = 3}, tiles = {"abriglass_"..image1..".png", -- up
tiles = {"abriglass_oneway_plain_glass.png", -- up "abriglass_"..image1..".png", -- down
"abriglass_oneway_plain_glass.png", -- down "abriglass_"..image1..".png", -- right
"abriglass_oneway_plain_glass.png", -- right "abriglass_"..image1..".png", -- left
"abriglass_oneway_plain_glass.png", -- left "abriglass_"..image2, -- back
"abriglass_oneway_face.png^[colorize:#F8F8FF:200", -- back "abriglass_"..image3 -- front
"abriglass_oneway_wall.png^[colorize:#E6E6FA:200"}, -- front },
is_ground_content = false, is_ground_content = false,
sunlight_propagates = true, sunlight_propagates = true,
inventory_image = minetest.inventorycube("abriglass_oneway_face.png^[colorize:#F8F8FF:200") inventory_image = minetest.inventorycube("abriglass_"..image2)
}) })
end
-- normal nodes to match one-way glass -- normal nodes to match one-way glass
@ -169,6 +160,7 @@ minetest.register_node("abriglass:oneway_wall_pale", {
paramtype2 = "facedir", paramtype2 = "facedir",
}) })
-- crystal, for later use in crafting recipes -- crystal, for later use in crafting recipes
minetest.register_node("abriglass:ghost_crystal", { minetest.register_node("abriglass:ghost_crystal", {
description = "Ghost Crystal", description = "Ghost Crystal",
@ -182,6 +174,7 @@ minetest.register_node("abriglass:ghost_crystal", {
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
-- hidden light node -- hidden light node
minetest.register_node("abriglass:hidden_light", { minetest.register_node("abriglass:hidden_light", {
description = "Hidden Light", description = "Hidden Light",
@ -193,6 +186,3 @@ minetest.register_node("abriglass:hidden_light", {
light_source = 7, light_source = 7,
drawtype = "glasslike", drawtype = "glasslike",
}) })