32 Commits

Author SHA1 Message Date
e7988d5867 is ground content revision (#12) 2024-03-01 15:15:43 +01:00
aa9e57ebc3 Merge pull request #10 from sys4-fr/master
Fix deprecated use of use_texture_alpha
2021-03-22 09:26:20 -05:00
aee34845cb Fix deprecated use of use_texture_alpha 2021-03-20 16:23:39 +01:00
a68dfa502c Add connected glass textures 2020-08-26 10:29:50 +02:00
fc371df620 Use mod.conf for name/dependencies (#8)
Deletes deprecated 'depends.txt'.
2020-06-04 20:37:39 +02:00
d1b0278c68 Merge pull request #7 from VanessaE/master
use Unified Dyes on_dig where needed
2019-08-06 18:28:30 -05:00
d1cdbbd5bc use Unified Dyes on_dig where needed - requires Unified Dyes commit 9ff40a7f or later 2019-07-18 02:27:51 -04:00
3d7ab900a0 Merge pull request #6 from VanessaE/master
fix not being able to airbrush [trap] super glow glass
2018-10-30 17:38:02 -05:00
827eb3e484 fix not being able to airbrush [trap] super glow glass 2018-10-25 13:20:23 -04:00
3c2ca3a606 Merge pull request #5 from VanessaE/master
get rid of old 89->256 color conversion LBM
2018-09-13 12:43:59 -05:00
5abcd8433f get rid of old 89->256 color conversion LBM
(obsolete, can only crash now anyway)
2018-09-12 23:00:48 -04:00
8fb5fa188e Merge pull request #4 from VanessaE/master
switch to colored itemstacks
2018-08-26 00:01:26 -05:00
8cb21b1057 switch to colored itemstacks
with full crafting recipes
(requires Unified Dyes commit 2a816534 or later)
2018-08-22 20:52:20 -04:00
af425a67ea Merge pull request #3 from VanessaE/master
Many changes, please see commit log :P
2017-03-27 14:12:51 -05:00
2215a44037 don't force param2 = 240 on [trap] super glow glass
(breaks client-side connected glass setting)
2017-03-25 03:28:59 -04:00
f6b10f4cbe use unified dyes auto-colorization feature 2017-03-18 06:36:57 -04:00
9f2552a540 replace missing myglow definition 2017-03-18 06:34:51 -04:00
97c15ce2da use unified dyes on_construct handler
to set 256-color palette meta key on place
2017-03-14 02:16:37 -04:00
fef736edd6 delete obsolete textures 2017-02-25 02:14:18 -05:00
1fe7541f7d convert to use UD extended palette 2017-02-25 02:06:26 -05:00
d980d1ef79 convert to use extended UD palette 2017-02-25 01:34:38 -05:00
e78c0a8b15 don't run LBM at every load 2017-02-16 17:01:39 -05:00
6e1d104ffe fix wrong not-in-creative-inv redefinition on trap super glow glass 2017-02-06 05:30:13 -05:00
7a9868bd63 fix wrong "walkable" on stained and faint trap glass 2017-02-06 05:28:43 -05:00
44e9c4ea32 update unified dyes API for one more node 2017-02-04 21:03:06 -05:00
efd1200648 unified dyes uses on_use now, instead of on_rightclick 2017-02-04 19:42:03 -05:00
664681b2e2 better way to call after_dig_node 2017-01-28 09:46:25 -05:00
bae9f7bd34 set the full color spec in the metadata
during LBM conversion, not just the hue

Also, updated to use the revised UD API
2017-01-28 08:05:12 -05:00
99eee07f0a fix drops 2017-01-28 07:40:46 -05:00
94bbecfd3b Reworked to use engine param2 colorization
Uses the place-then-paint method to make colors. To get a regular color,
place some Moreblocks super glow glass, then right click on it with some
dye to color it.  To get the pastel colors, right-click the colored
glass with Moreblocks' "sweeper" to "brush off" some of the color.  Do
it again to change pastel to faint.

Right click a pastel or faint with some dye to re-color it.  You have to
dig and re-place if you want to go darker/more saturated again.
2017-01-25 16:15:27 -05:00
b6daeecd13 Merge pull request #2 from cmdskp/patch-1
Undeclared oldname to local
2015-12-14 07:29:23 -06:00
5644b08229 Undeclared oldname to local
Removes error reported by minetest regarding undefined global.
2015-12-13 20:01:33 +00:00
228 changed files with 479 additions and 267 deletions

0
LICENSE Executable file → Normal file
View File

0
LICENSE.txt Executable file → Normal file
View File

59
README.md Executable file → Normal file
View File

@ -1,11 +1,16 @@
Doyousketch2's Stained Glass mod
ver 1.2
ver 1.7
Image: http://oi47.tinypic.com/hst6s3.jpg
With alpha enabled: http://oi44.tinypic.com/5vraxf.jpg
==============================================================================
Originally developed by Eli Innes/Doyousketch2, and distributed
under GPL v2. Further changes by VanessaE (removing from creative inventory)
and Jeremy Anderson (fixing craft recipes, renaming blocks)
==============================================================================
Dependencies: VanessaE's Unified Dyes, Calinou's More Blocks
@ -23,8 +28,35 @@ to simply read "stained_glass"
then move it into your Minetest mods folder.
Even better, get stained_glass from one of the github pages:
https://github.com/doyousketch2/stained_glass
https://github.com/VanessaE/stained_glass
https://github.com/andersje/stained_glass
-- this will get you the latest version of the code, and you
can update at any time by doing a git pull
==============================================================================
To turn off types of glass, alter settings.txt in the stained_glass directory.
By default, all six (SIX!) types of stained_glass are enabled: regular (based on super_glow_glass), med_glow (based on glow_glass) and no-glow (Based on default:glass), trap regular (based on trap_super_glow_glass), trap med_glow (based on trap_glow_glass) and trap_noglow (based on trapglass)
stained_glass.full_light = true
stained_glass.med_light = true
stained_glass.no_light = true
stained_glass.trap_full_light = true
stained_glass.trap_med_light = true
stained_glass.trap_no_light = true
Setting any of these to false will prevent that type of stained_glass from being loaded. If you set them all to false, you won't get any stained_glass. Mix and match as you choose -- you can turn on only one, if you wish, and it will work just fine.
One of the high points of trap stained glass is that liquids flow through it -- making illuminated waterfalls a possibility.
==============================================================================
(use trap super glow glass or trap glow glass or trapglass -- now available in moreblocks -- to make the trap variant of this)
Recipe for standard colors:
@ -36,6 +68,7 @@ image: http://oi50.tinypic.com/1ibs7c.jpg
super glow glass
Recipe for pastel colors:
image: http://oi45.tinypic.com/2wbvkti.jpg
@ -46,7 +79,6 @@ image: http://oi45.tinypic.com/2wbvkti.jpg
super glow glass
super glow glass
Recipe for faint colors:
image: http://oi45.tinypic.com/2wbvkti.jpg
@ -60,8 +92,6 @@ image: http://oi45.tinypic.com/2wbvkti.jpg
All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
==============================================================================
@ -75,6 +105,8 @@ The Palette includes:
Full & half-saturation, medium and dark shades have been included
as well as light, pastel, and faint tints.
Look at settings.txt to see how you can enable/disable full-glow, half-glow and no-glow blocks -- tested in all combinations. enjoy.
==============================================================================
@ -82,6 +114,25 @@ as well as light, pastel, and faint tints.
Misc. Notes
-----------
Blocks are now available by name:
e.g. /giveme stained_glass:orange 3 # get 3 orange sg blocks
or /giveme stained_glass:light_yellow
or /giveme stained_glass:pastel_yellow
or /giveme stained_glass:faint_yellow
or /giveme stained_glass:yellow
or /giveme stained_glass:lowglow_yellow
or /giveme stained_glass:noglow_dark_green
or /giveme stained_glass:trap_noglow_dark_green
or /giveme stained_glass:trap_lowglow_yellow
or /giveme stained_glass:trap_medium_aqua
You get the idea.
NUMERIC CODES FOR BLOCKS (this is the old way of coding these blocks
developed by Doyousketch2)
Please don't try to use /give commands, the items are now in numerical format,
and it would be tough to try to explain it.

25
changelog.txt Executable file → Normal file
View File

@ -1,6 +1,31 @@
Changelog
---------
ver 1.7
Sat 1 Sep 2013
I like trapglass, so _all_ variants of stained_glass are now available as (identical) trapglass variants. also, ability to ditch trapglass blocks via settings.txt added. In fact, you can now pick and choose which variants of stained_glass you wish to enable.
ver 1.6
Fri 30 Aug 2013
added configfile settings.txt to allow disabling of full_light (super_glow_glass-based), med_light (glow_glass-based) and no_light (default:glass) blocks. just set the relevant fields to 'false' and they will not be loaded when you start the game.
ver 1.5.1
Mon 26 Aug 2013
prompted by VanessaE's initial cleanup, MUCH cleanup of the code. No need to have > 1 file anymore.
ver 1.5
Sun 25 Aug 2013
added low-glow (brightness 11) and noglow (brightness 0) stained glass blows, using glow_glass and regular glass accordingly.
ver 1.4
Thu 22 Aug 2013
*phew* made aliases for all numeric block names to map to new color-name based scheme
updated craft recipes to work with new dyes format
rejiggered whole system of block and craft registration
set to have all blocks at LIGHT_MAX -- since they were manually specifying '14' as a light level before (which is current max)
nothing returns buckets anymore, because you don't need buckets to make the dyes to make the blocks.
---------
ver 1.1

0
colors.txt Executable file → Normal file
View File

View File

@ -1,3 +0,0 @@
default
moreblocks
unifieddyes

16
geany_run_script.sh Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh
rm $0
lua "init.lua"
echo "
------------------
(program exited with code: $?)"
echo "Press return to continue"
#to be more compatible with shells like dash
dummy_var=""
read dummy_var

605
init.lua Executable file → Normal file
View File

@ -1,8 +1,8 @@
--[[
Stained Glass 1.2
Stained Glass
This mod provides luminescent stained glass blocks for Minetest 0.4.x.
This mod provides luminescent stained glass blocks for Minetest 0.4.7+
Depends:
[moreblocks] by Calinou
@ -17,279 +17,394 @@ Email: doyousketch2 @ yahoo.com
Unified Dyes was released under GNU-GPL 2.0, see LICENSE for info.
More Blocks was released under zlib/libpng for code and CC BY-SA 3.0 Unported for textures, see LICENSE.txt for info.
==============================================================================
Additional changes by VanessaEzekowitz in July 2013 to take all items
out of creative inventory.
Recipe for standard colors:
August 2013 -- Jeremy Anderson tries to get this working after the new color
changes, and to resurrect the craft recipes. Still GPL'd as far as I'm concerned.
dye
super glow glass
super glow glass
super glow glass
August 2013 -- rewritten a bit by VanessaEzekowitz to further condense the code.
January 2017 -- rewritten a bit more by Vanessa E. to use engine param2 colorization
and place-then-paint creation of colors. To get the pastel colors,
place super glow glass, right-click with dye to color it, then right-
click with Moreblocks' "sweeper" to "brush off" some of the color. Do
it again to change pastel to faint. Right click a pastel or faint with
some dye to re-color it (you have to dig and re-place if you want to
darken it). Crafting is no longer used to create the colors.
Recipe for pastel colors:
light dye
white paint
super glow glass
super glow glass
super glow glass
Recipe for faint colors:
light dye
white paint
white paint
super glow glass
super glow glass
super glow glass
All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
August 2018 -- altered to use proper colored itemstacks with crafting
==============================================================================
]]--
stainedglass = {}
stainedglass.old_static_nodes = {}
-- HUES includes all colors for the various shades
-- I'm trying to get it to sort by color in the game, tho it sorts alpha-numerically...
-- so with 12 colors, it's sorting 10, 11, 12, 1, 2, 3, 4...
local myglow = LIGHT_MAX-3
minetest.register_node("stained_glass:stained_glass", {
description = "Stained Glass",
drawtype = "glasslike_framed_optional",
tiles = { "stained_glass.png", "stained_glass_detail.png" },
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
sunlight_propagates = true,
use_texture_alpha = "blend",
light_source = myglow,
is_ground_content = false,
walkable = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
})
minetest.override_item("moreblocks:super_glow_glass", {
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "stained_glass:stained_glass",
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, ud_param2_colorable = 1},
})
-- trap glass
minetest.register_node("stained_glass:stained_trap_glass", {
description = "Stained Trap-glass",
drawtype = "glasslike_framed_optional",
tiles = { "stained_glass.png", "stained_glass_detail.png" },
paramtype = "light",
paramtype2 = "color",
palette = "unifieddyes_palette_extended.png",
sunlight_propagates = true,
use_texture_alpha = "blend",
light_source = myglow,
is_ground_content = false,
walkable = false,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
sounds = default.node_sound_glass_defaults(),
on_construct = unifieddyes.on_construct,
on_dig = unifieddyes.on_dig,
})
minetest.override_item("moreblocks:trap_super_glow_glass", {
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "stained_glass:stained_trap_glass",
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
})
-- crafting
unifieddyes.register_color_craft({
output = "stained_glass:stained_glass",
palette = "extended",
type = "shapeless",
neutral_node = "moreblocks:super_glow_glass",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
unifieddyes.register_color_craft({
output = "stained_glass:stained_trap_glass",
palette = "extended",
type = "shapeless",
neutral_node = "moreblocks:trap_super_glow_glass",
recipe = {
"NEUTRAL_NODE",
"MAIN_DYE"
}
})
-- old static stuff
function stainedglass.makenode(arg)
local name=arg.blockname
local myglow=arg.glow
local myprefix=arg.prefix
local imagename=arg.imagename
local safe=arg.walkflag
local function tchelper(first, rest)
return first:upper()..rest:lower()
end -- from lua-users.org/wiki/StringRecipes
table.insert(stainedglass.old_static_nodes, "stained_glass:"..name)
end
-- maybe someday, I can cleanly combine these two functions.
function stained_trapglass_define(arg)
local code=arg.colorcode
local name=arg.colorname
local rawdyename=arg.recipe
local mydye=arg.recipe
local myshadename=arg.shade
local imagename=name
local stained_glass_blocktype = { }
local stained_glass_lightlevel = { }
if stained_glass.trap_full_light then
stained_glass_lightlevel[""] = LIGHT_MAX
stained_glass_blocktype[""] = "moreblocks:trap_super_glow_glass"
end -- see settings.txt for these settings.
if stained_glass.trap_med_light then
stained_glass_lightlevel["lowglow_"] = LIGHT_MAX-3
stained_glass_blocktype["lowglow_"] = "moreblocks:trap_glow_glass"
end
if stained_glass.trap_no_light then
stained_glass_lightlevel["noglow_"] = 0
stained_glass_blocktype["noglow_"] = "moreblocks:trap_glass"
end
for myprefix,myglow in pairs(stained_glass_lightlevel) do
local glasstype = stained_glass_blocktype[myprefix]
local name="trap_" .. name
-- define myrecipe as a table, pass it in.
local myrecipe = { mydye, glasstype, glasstype, glasstype }
-- those four items will ALWAYS be there. For faint and pastel, we
-- need to add additional dyes. If you have defined a new shade, then
-- you should probably handle it here.
if myshadename == "pastel_" then
myrecipe[5] = "dye:white"
end
if myshadename == "faint_" then
myrecipe[5] = "dye:white"
myrecipe[6] = "dye:white"
end
stainedglass.makenode{blockname=name, glow=myglow, prefix=myprefix, imagename=imagename, walkflag=false}
end
end
function stained_glass_define(arg)
local code=arg.colorcode
local name=arg.colorname
local rawdyename=arg.recipe
local mydye=arg.recipe
local myshadename=arg.shade
local imagename=name
local stained_glass_blocktype = { }
local stained_glass_lightlevel = { }
if stained_glass.full_light then
stained_glass_lightlevel[""] = LIGHT_MAX
stained_glass_blocktype[""] = "moreblocks:super_glow_glass"
end -- see settings.txt for these settings.
if stained_glass.med_light then
stained_glass_lightlevel["lowglow_"] = LIGHT_MAX-3
stained_glass_blocktype["lowglow_"] = "moreblocks:glow_glass"
end
if stained_glass.no_light then
stained_glass_lightlevel["noglow_"] = 0
stained_glass_blocktype["noglow_"] = "default:glass"
end
for myprefix,myglow in pairs(stained_glass_lightlevel) do
local glasstype = stained_glass_blocktype[myprefix]
-- define myrecipe as a table, pass it in.
local myrecipe = { mydye, glasstype, glasstype, glasstype }
-- those four items will ALWAYS be there. For faint and pastel, we
-- need to add additional dyes. If you have defined a new shade, then
-- you should probably handle it here.
if myshadename == "pastel_" then
myrecipe[5] = "dye:white"
end
if myshadename == "faint_" then
myrecipe[5] = "dye:white"
myrecipe[6] = "dye:white"
end
stainedglass.makenode{blockname=name, glow=myglow, prefix=myprefix, imagename=name, walkflag=true}
if myprefix == "" then
local aliasname
minetest.register_alias( "stained_glass:" .. code, "stained_glass:" .. name)
if string.match(name,"redviolet") then
local oldname=name
aliasname=string.gsub(name, "redviolet","red_violet") -- need to support red_violet existence, too.
minetest.register_alias( "stained_glass:" .. aliasname, "stained_glass:" .. oldname)
end
end
-- and an alias from the numeric to the named block
-- we need to keep the numeric block for all the people that used
-- pre-v1.4 blocks in their worlds.
-- no aliases for noglow- and lowglow- blocks, because they didn't
-- exist until v1.5
end
end
-- true means this color's recipe must use a direct "dye:xxxxx" item name
-- (perhaps because the related groups overlap two or more distinct colors)
-- false means the recipe uses "group:dye,unicolor_xxxxx"
stained_glass= {}
local worldpath=minetest.get_worldpath()
local modpath=minetest.get_modpath("stained_glass")
dofile(modpath .. "/settings.txt")
-- the new settings.txt file has a variety of possible settings.
-- see the file for examples. We'll access those settings where its important, in
-- the stained glass module, where we'll build up the tables to contain
-- only what we need.
stained_glass_hues = {
{ "yellow", true },
{ "lime", false },
{ "green", true },
{ "aqua", false },
{ "cyan", false },
{ "skyblue", true },
{ "blue", false },
{ "violet", false },
{ "magenta", true },
{ "redviolet", true },
{ "red", true },
{ "orange", false },
-- please note that these only apply when our shadelevel is ""
HUES = {
"yellow",
"lime",
"green",
"aqua",
"cyan",
"skyblue",
"blue",
"violet",
"magenta",
"redviolet",
"red",
"orange"
}
stained_glass_shades = {
{"dark_", 3 },
{"medium_", 4 },
{"", 5 }, -- full brightness
{"light_", 8 },
{"pastel_", 9 },
{"faint_", 91 }
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"),
-- 100% ("full"), 150% ("light"), 200% ("pastel").
-- 1x and 2x are simply placeholders to fill in so numbers start at 3.
BRIGHT = {
"1x",
"2x",
"dark_",
"medium_",
"", --(full)
-- note that dark_ medium_ and plain also have a half-saturation
-- equivalent automatically defined in the code
}
for i in ipairs(stained_glass_hues) do
-- Saturation - "s50" in a file/item name means "saturation: 50%".
-- 1x - 5x are simply placeholders so numbers start at 6.
local huename = stained_glass_hues[i][1]
local huenumber = i
for j in ipairs(stained_glass_shades) do
SAT = {
"1x",
"2x",
"3x",
"4x",
"5x",
"_s50",
"" --(full)
}
local shadename = stained_glass_shades[j][1]
local shadenumber = stained_glass_shades[j][2]
local recipevalue = nil
--main loop for all 12 hues
recipevalue = "group:dye,unicolor_"..shadename..huename
if (shadename == "" and stained_glass_hues[i][2]) then
recipevalue = "dye:"..huename
elseif (shadename=="pastel_" or shadename=="faint_") then
-- force light_dye for pastel and faint colors
recipevalue = "group:dye,unicolor_light_"..huename
else -- default case
recipevalue = "group:dye,unicolor_"..shadename..huename
end
for h = 1, 12 do
hues = HUES[h]
--nested loop for brightness
--starts at 3 to hopefully keep colors in order
for b = 3, 5 do
bright = BRIGHT[b]
--sub loop for saturation
--starts at 6 to keep colors in order
for s = 6, 7 do
sat = SAT[s]
--register recipes
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s) .." 3",
recipe = {
"unifieddyes:" .. bright .. hues .. sat,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
if shadename == "dark_" or shadename == "medium_" or shadename == "" then
stained_glass_define({
colorcode = huenumber.."_"..shadenumber.."_7",
colorname = shadename..huename,
recipe = recipevalue,
shade = shadename,
})
--register item attributes
stained_trapglass_define({
colorcode = huenumber.."_"..shadenumber.."_7",
colorname = shadename..huename,
recipe = recipevalue,
shade = shadename,
}) -- only defines something if the trap is enabled.
minetest.register_node("stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s), {
description = "Stained Glass - " .. bright .. hues .. sat,
drawtype = "glasslike_framed_optional",
tiles = {"stained_glass_" .. bright .. hues .. sat .. ".png", "stained_glass_" .. bright .. hues .. sat .. "_detail.png"},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
-- below is the automatic "half saturation" block
-- which was mentioned previously
-- this is unicolor only, so switch dyename
-- back to unicolor...
recipevalue="group:dye,unicolor_"..shadename..huename
stained_glass_define({
colorcode = huenumber.."_"..shadenumber.."_6",
colorname = shadename..huename.."_s50",
recipe = recipevalue.."_s50",
shade = shadename,
})
end --sat
stained_trapglass_define({
colorcode = huenumber.."_"..shadenumber.."_6",
colorname = shadename..huename.."_s50",
recipe = recipevalue.."_s50",
shade = shadename,
}) -- only defines something if the trap is enabled.
-- because we define two blocks inside this chunk of
-- code, we can't just define the relevant vars and
-- move the proc_call after the if-then loop.
end --bright
end --hues
--secondary loop for light blocks
--(as they don't have 50% saturation blocks to go along with 'em)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 8 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_8 3",
recipe = {
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
elseif shadename == "light_" or shadename == "pastel_" or shadename == "faint_" then
stained_glass_define({
colorcode = huenumber.."_"..shadenumber,
colorname = shadename..huename,
recipe = recipevalue,
shade = shadename,
})
stained_trapglass_define({
colorcode = huenumber.."_"..shadenumber,
colorname = shadename..huename,
recipe = recipevalue,
shade = shadename,
}) -- only defines something if the trap is enabled.
--register item attributes
end
minetest.register_node("stained_glass:" .. (h) .. "_8_", {
description = "Stained Glass - light_" .. hues,
drawtype = "glasslike_framed_optional",
tiles = {"stained_glass_light_" .. hues .. ".png", "stained_glass_light_" .. hues .. "_detail.png"},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
end
end
-- convert in-map static nodes to use param2 coloring
minetest.register_lbm({
name = "stained_glass:convert_glass",
label = "Convert static glass blocks to use param2 color",
run_at_every_load = false,
nodenames = stainedglass.old_static_nodes,
action = function(pos, node)
local name = node.name
name = string.gsub(name, "aqua", "spring")
name = string.gsub(name, "skyblue", "azure")
name = string.gsub(name, "redviolet", "rose")
local n = string.find(name, ":")
local color = string.sub(name, n + 1)
local h,s,v = unifieddyes.get_hsv(name)
if string.find(name, "trap") then
n = string.find(color, "_")
color = string.sub(color, n + 1)
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = "stained_glass:stained_trap_glass", param2 = paletteidx })
else
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = "stained_glass:stained_glass", param2 = paletteidx })
end
local meta = minetest.get_meta(pos)
meta:set_string("dye", "unifieddyes:"..v..h..s)
meta:set_string("palette", "ext")
end
})
end --hues
--third loop for pastel blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 9 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_9 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_9", {
description = "Stained Glass - pastel_" .. hues,
drawtype = "glasslike_framed_optional",
tiles = {"stained_glass_pastel_" .. hues .. ".png", "stained_glass_pastel_" .. hues .. "_detail.png"},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
--last loop for faint blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 91 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_91 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty 2'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_91", {
description = "Stained Glass - faint_" .. hues,
drawtype = "glasslike_framed_optional",
tiles = {"stained_glass_faint_" .. hues .. ".png", "stained_glass_faint_" .. hues .. "_detail.png"},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
minetest.log("action", "[stained_glass] Loaded!")
print("[stained_glass] Loaded!")

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = stained_glass
depends = default, moreblocks, unifieddyes

6
settings.txt Normal file
View File

@ -0,0 +1,6 @@
stained_glass.full_light = true
stained_glass.med_light = true
stained_glass.no_light = true
stained_glass.trap_full_light = true
stained_glass.trap_med_light = true
stained_glass.trap_no_light = true

BIN
textures/stained_glass.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 481 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Some files were not shown because too many files have changed in this diff Show More