From c82a54d756d1c0299f174153e460c46c293564eb Mon Sep 17 00:00:00 2001 From: ezhh Date: Fri, 2 Dec 2016 13:47:39 +0000 Subject: [PATCH 1/4] Fixed license --- license.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/license.txt b/license.txt index a833e24..d98d3a2 100644 --- a/license.txt +++ b/license.txt @@ -1,4 +1,8 @@ -CC BY-SA 4.0 -https://creativecommons.org/licenses/by-sa/4.0/ -Attribution: Shara RedCat \ No newline at end of file +Textures: +CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/) +Attribution: Shara RedCat + +Code: +License: MIT (https://opensource.org/licenses/MIT) +By Shara RedCat \ No newline at end of file From 46f796bc0019763a5bd2338001cd7f982b588b84 Mon Sep 17 00:00:00 2001 From: ezhh Date: Fri, 2 Dec 2016 14:19:22 +0000 Subject: [PATCH 2/4] General tidying --- init.lua | 185 +++++++++++++++++++++++-------------------------------- 1 file changed, 76 insertions(+), 109 deletions(-) diff --git a/init.lua b/init.lua index 2b94b69..95c4eee 100644 --- a/init.lua +++ b/init.lua @@ -1,13 +1,43 @@ +-- undecorated coloured glass, all using plain glass texture +local glass_list = { + {"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(), +}) + ---[[ -What it is: Simple mod for extra glass, including plain and patterned stained glass, and one way glass. -Who did it: Shara RedCat. -]] - - ---boring glass because why not? - +-- boring glass because why not? minetest.register_node("abriglass:clear_glass", { description = "Clear Glass", tiles = {"abriglass_clearglass.png"}, @@ -20,68 +50,33 @@ minetest.register_node("abriglass:clear_glass", { }) ---glass lights +-- glass lights +local light_list = { + {"glass_light_green", "Green", "lightgreen",}, + {"glass_light_blue", "Blue", "lightblue",}, + {"glass_light_red", "Red", "lightred",}, + {"glass_light_yellow", "Yellow", "lightyellow",}, +} -minetest.register_node("abriglass:glass_light_green", { - description = "Green Glass Light", - tiles = {"abriglass_lightgreen.png"}, - groups = {cracky = 3}, - use_texture_alpha = true, - sunlight_propagates = true, - light_source = 14, - drawtype = "glasslike", - sounds = default.node_sound_glass_defaults(), -}) +for i in ipairs(light_list) do + local name = light_list[i][1] + local description = light_list[i][2] + local image = light_list[i][3] -minetest.register_node("abriglass:glass_light_blue", { - description = "Blue Glass Light", - tiles = {"abriglass_lightblue.png"}, - groups = {cracky = 3}, - use_texture_alpha = true, - sunlight_propagates = true, - light_source = 14, - drawtype = "glasslike", - sounds = default.node_sound_glass_defaults(), -}) + minetest.register_node("abriglass:" ..name, { + description = description.. "Glass Light", + tiles = {"abriglass_" ..image.. ".png"}, + groups = {cracky = 3}, + use_texture_alpha = true, + sunlight_propagates = true, + light_source = 14, + drawtype = "glasslike", + sounds = default.node_sound_glass_defaults(), + }) +end -minetest.register_node("abriglass:glass_light_red", { - description = "Red Glass Light", - tiles = {"abriglass_lightred.png"}, - groups = {cracky = 3}, - use_texture_alpha = true, - sunlight_propagates = true, - light_source = 14, - drawtype = "glasslike", - sounds = default.node_sound_glass_defaults(), -}) - -minetest.register_node("abriglass:glass_light_yellow", { - description = "Yellow Glass Light", - tiles = {"abriglass_lightyellow.png"}, - groups = {cracky = 3}, - use_texture_alpha = true, - sunlight_propagates = true, - light_source = 14, - drawtype = "glasslike", - sounds = default.node_sound_glass_defaults(), -}) - ---crystal, for later use in crafting recipes - -minetest.register_node("abriglass:ghost_crystal", { - description = "Ghost Crystal", - tiles = {"abriglass_ghost_crystal.png"}, - wield_image = "abriglass_ghost_crystal_wield.png", - groups = {cracky = 3}, - use_texture_alpha = true, - sunlight_propagates = true, - light_source = 14, - drawtype = "glasslike", - sounds = default.node_sound_glass_defaults(), -}) - ---patterned glass +-- patterned glass local pattern_list = { --{name, description, image} {"stainedglass_tiles_dark", "Stained Glass", "stainedglass_tiles1",}, {"stainedglass_tiles_pale", "Stained Glass", "stainedglass_tiles2",}, @@ -110,8 +105,8 @@ for i in ipairs(pattern_list) do }) end ---one-way glass +-- one-way glass minetest.register_node("abriglass:oneway_glass_dark", { description = "Dark One-Way Glass", drawtype = "nodebox", @@ -159,8 +154,7 @@ minetest.register_node("abriglass:oneway_glass_pale", { }) ---normal blocks to match one-way glass - +-- normal nodes to match one-way glass minetest.register_node("abriglass:oneway_wall_dark", { description = "Dark Block", tiles = {"abriglass_oneway_wall.png"}, @@ -175,9 +169,20 @@ minetest.register_node("abriglass:oneway_wall_pale", { paramtype2 = "facedir", }) +-- crystal, for later use in crafting recipes +minetest.register_node("abriglass:ghost_crystal", { + description = "Ghost Crystal", + tiles = {"abriglass_ghost_crystal.png"}, + wield_image = "abriglass_ghost_crystal_wield.png", + groups = {cracky = 3}, + use_texture_alpha = true, + sunlight_propagates = true, + light_source = 14, + drawtype = "glasslike", + sounds = default.node_sound_glass_defaults(), +}) ---light node - +-- hidden light node minetest.register_node("abriglass:hidden_light", { description = "Hidden Light", tiles = {"abriglass_oneway_plain_glass.png"}, @@ -190,42 +195,4 @@ minetest.register_node("abriglass:hidden_light", { }) ---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(), -}) - From a91a2f38d14e0328cf97339b7ea2706d5a66f1ea Mon Sep 17 00:00:00 2001 From: ezhh Date: Fri, 2 Dec 2016 15:06:51 +0000 Subject: [PATCH 3/4] Tidied one way glass --- init.lua | 82 +++++++++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/init.lua b/init.lua index 95c4eee..c9aa6a8 100644 --- a/init.lua +++ b/init.lua @@ -107,51 +107,42 @@ end -- one-way glass -minetest.register_node("abriglass:oneway_glass_dark", { - description = "Dark 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}, - 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") -}) +local oneway_list = { --{name, description, image} + {"dark", "Dark", "oneway_plain_glass", "oneway_face.png", "oneway_wall.png",}, + {"pale", "White", "oneway_plain_glass", "oneway_face.png^[colorize:#F8F8FF:200", "oneway_wall.png^[colorize:#E6E6FA:200",}, +} -minetest.register_node("abriglass:oneway_glass_pale", { - description = "White 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}, +for i in ipairs(oneway_list) do + local name = oneway_list[i][1] + local description = oneway_list[i][2] + local image1 = oneway_list[i][3] + local image2 = oneway_list[i][4] + local image3 = oneway_list[i][5] + + minetest.register_node("abriglass:oneway_glass_"..name, { + 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}, - 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") -}) + groups = {cracky = 3}, + tiles = {"abriglass_"..image1..".png", -- up + "abriglass_"..image1..".png", -- down + "abriglass_"..image1..".png", -- right + "abriglass_"..image1..".png", -- left + "abriglass_"..image2, -- back + "abriglass_"..image3 -- front + }, + is_ground_content = false, + sunlight_propagates = true, + inventory_image = minetest.inventorycube("abriglass_"..image2) + }) +end -- normal nodes to match one-way glass @@ -169,6 +160,7 @@ minetest.register_node("abriglass:oneway_wall_pale", { paramtype2 = "facedir", }) + -- crystal, for later use in crafting recipes minetest.register_node("abriglass:ghost_crystal", { description = "Ghost Crystal", @@ -182,6 +174,7 @@ minetest.register_node("abriglass:ghost_crystal", { sounds = default.node_sound_glass_defaults(), }) + -- hidden light node minetest.register_node("abriglass:hidden_light", { description = "Hidden Light", @@ -193,6 +186,3 @@ minetest.register_node("abriglass:hidden_light", { light_source = 7, drawtype = "glasslike", }) - - - From 6bd28c469cb7c7253f3e892f36b854b9d70a4c84 Mon Sep 17 00:00:00 2001 From: ezhh Date: Fri, 2 Dec 2016 15:46:43 +0000 Subject: [PATCH 4/4] Added new one way glass types --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index c9aa6a8..f2df44b 100644 --- a/init.lua +++ b/init.lua @@ -107,9 +107,11 @@ end -- one-way glass -local oneway_list = { --{name, description, image} - {"dark", "Dark", "oneway_plain_glass", "oneway_face.png", "oneway_wall.png",}, - {"pale", "White", "oneway_plain_glass", "oneway_face.png^[colorize:#F8F8FF:200", "oneway_wall.png^[colorize:#E6E6FA:200",}, +local oneway_list = { + {"dark", "Dark", "oneway_plain_glass", "oneway_face.png", "abriglass_oneway_wall.png",}, + {"pale", "White", "oneway_plain_glass", "oneway_face.png^[colorize:#F8F8FF:200", "abriglass_oneway_wall.png^[colorize:#E6E6FA:200",}, + {"desert_brick", "Desert Brick", "oneway_plain_glass", "oneway_face.png^[colorize:#814F3C:200", "default_desert_stone_brick.png",}, + {"stone_brick", "Stone Brick", "oneway_plain_glass", "oneway_face.png^[colorize:#615E5D:200", "default_stone_brick.png",}, } for i in ipairs(oneway_list) do @@ -136,7 +138,7 @@ for i in ipairs(oneway_list) do "abriglass_"..image1..".png", -- right "abriglass_"..image1..".png", -- left "abriglass_"..image2, -- back - "abriglass_"..image3 -- front + image3, -- front }, is_ground_content = false, sunlight_propagates = true,