now tested with blocks created by previous versions of the mod. should be safe for worlds created before these changes.

superglowglass changed to super_glow_glass.
attempts at setting the hues and dyes and whatnot to fix the craft recipes, since changes to default dyes and unifieddyes broke them some time ago.

manual initialization for blocks and recipes. DON'T USE THIS YET, I'm still working on it.

WORKING:  craft recipes, most blocks, use of new color palette
UNTESTED:  mapping of old blocks to these new blocks
NOT WORKING:  faint, pastel type blocks

much cleaner code.  it LOOKS like the light/pastel blocks should be working perfectly, even when digging through the debug logs...however, they aren't craftable.  I'm not sure why this is.  hopefully, someone can point me in the right direction

dark green, magenta all sorted out now, thanks to vanessaE.
Still, this makes me wonder if I should be using exact dye names everywhere.
also, brown will no longer map to yellow stained glass.

uuuuugh, ugly hack -- had to define separate subs for pastel and faint blocks.  could be worse I suppose.
This is now working for new worlds, but be careful on existing worlds -- it isn't tested there yet, though it SHOULD work.

updates to copyright and usage of the mod.

changelog updated.

doyousketch2 has returned!  fixes to README file, since this is still his baby.

leftover temp file...didn't need to be here.
This commit is contained in:
andersje 2013-08-20 23:12:34 -05:00
parent 849513e165
commit 02ec406eb7
4 changed files with 236 additions and 520 deletions

View File

@ -1,12 +1,17 @@
Doyousketch2's Stained Glass mod Doyousketch2's Stained Glass mod
ver 1.3 ver 1.4
Image: http://oi47.tinypic.com/hst6s3.jpg Image: http://oi47.tinypic.com/hst6s3.jpg
With alpha enabled: http://oi44.tinypic.com/5vraxf.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 Dependencies: VanessaE's Unified Dyes, Calinou's More Blocks
@ -24,6 +29,14 @@ to simply read "stained_glass"
then move it into your Minetest mods folder. 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
============================================================================== ==============================================================================
@ -61,8 +74,6 @@ image: http://oi45.tinypic.com/2wbvkti.jpg
All recipes produce three glowing stained glass blocks. All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
============================================================================== ==============================================================================
@ -83,6 +94,19 @@ as well as light, pastel, and faint tints.
Misc. Notes 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
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, 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. and it would be tough to try to explain it.

View File

@ -3,6 +3,17 @@ Changelog
--------- ---------
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 ver 1.1
Sun 24 Feb 2013 05:26:29 AM EST Sun 24 Feb 2013 05:26:29 AM EST

416
init.lua
View File

@ -1,6 +1,6 @@
--[[ --[[
Stained Glass 1.3 Stained Glass 1.4
This mod provides luminescent stained glass blocks for Minetest 0.4.x. This mod provides luminescent stained glass blocks for Minetest 0.4.x.
@ -20,6 +20,9 @@ More Blocks was released under zlib/libpng for code and CC BY-SA 3.0 Unported fo
Additional changes by VanessaEzekowitz in July 2013 to take all items Additional changes by VanessaEzekowitz in July 2013 to take all items
out of creative inventory. out of creative inventory.
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.
============================================================================== ==============================================================================
@ -51,248 +54,225 @@ super glow glass
All recipes produce three glowing stained glass blocks. All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
============================================================================== ==============================================================================
]]-- ]]--
function makenode(arg)
name=arg.blockname
--register item attributes
-- HUES includes all colors for the various shades minetest.register_node("stained_glass:" .. name, {
-- I'm trying to get it to sort by color in the game, tho it sorts alpha-numerically... description = "Stained Glass - " .. name,
-- so with 12 colors, it's sorting 10, 11, 12, 1, 2, 3, 4... drawtype = "glasslike",
tiles = {"stained_glass_" .. name .. ".png"},
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = LIGHT_MAX,
-- now using light_max, so we're always as bright as possible.
-- future possibility is to allow gentle glow bricks.
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults()
})
HUES = { end
"yellow",
"lime",
"green",
"aqua",
"cyan",
"skyblue",
"blue",
"violet",
"magenta",
"redviolet",
"red",
"orange"
}
function defineregular (arg)
code=arg.colorcode
name=arg.colorname
mydye=arg.recipe
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"), -- the purpose of this is to abstract out all the registration
-- 100% ("full"), 150% ("light"), 200% ("pastel"). -- stuff - duplicated code is bad mmmmmkay? At least where one can avoid it
-- 1x and 2x are simply placeholders to fill in so numbers start at 3.
BRIGHT = { -- so, instead of 4 loops that each have craft registrations,
"1x", -- we'll have one block that does registrations, and just call
"2x", -- the procedure repeatedly
"dark_", --
"medium_", minetest.register_craft({
"", --(full) type = "shapeless",
} output = "stained_glass:" .. name .." 3",
recipe = {
mydye,
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
},
})
makenode{blockname=name}
-- Saturation - "s50" in a file/item name means "saturation: 50%". minetest.register_alias( "stained_glass:" .. code, "stained_glass:" .. name)
-- 1x - 5x are simply placeholders so numbers start at 6. -- 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.
end
SAT = { function definelight(arg)
"1x", code=arg.colorcode
"2x", name=arg.colorname
"3x", mydye=arg.recipe
"4x",
"5x",
"_s50",
"" --(full)
}
makenode{blockname=name}
--main loop for all 12 hues minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. name .." 3",
recipe = {
mydye,
"dye:white",
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
},
})
minetest.register_alias( "stained_glass:" .. code, "stained_glass:" .. name)
end
for h = 1, 12 do function definepastel (arg)
code=arg.colorcode
name=arg.colorname
mydye=arg.recipe
hues = HUES[h] minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. name .." 3",
recipe = {
mydye,
"dye:white",
"dye:white",
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
"moreblocks:super_glow_glass",
},
})
--register item attributes
--
makenode{blockname=name}
minetest.register_alias( "stained_glass:" .. code, "stained_glass:" .. name)
--nested loop for brightness end
--starts at 3 to hopefully keep colors in order
for b = 3, 5 do defineregular{colorcode="1_3_6", colorname="dark_yellow_s50", recipe="group:dye,unicolor_dark_yellow_s50"} -- works
defineregular{colorcode="1_3_7", colorname="dark_yellow", recipe="group:dye,unicolor_dark_yellow"} -- works
defineregular{colorcode="1_4_6", colorname="medium_yellow_s50", recipe="group:dye,unicolor_medium_yellow_s50"} -- works
defineregular{colorcode="1_4_7", colorname="medium_yellow", recipe="group:dye,unicolor_medium_yellow"} -- works
defineregular{colorcode="1_5_6", colorname="yellow_s50", recipe="group:dye,unicolor_yellow_s50"} -- works
defineregular{colorcode="1_5_7", colorname="yellow", recipe="dye:yellow"} -- works
defineregular{colorcode="2_3_6", colorname="dark_lime_s50", recipe="group:dye,unicolor_dark_lime_s50"} -- works
defineregular{colorcode="2_3_7", colorname="dark_lime", recipe="group:dye,unicolor_dark_lime"} -- works
defineregular{colorcode="2_4_6", colorname="medium_lime_s50", recipe="group:dye,unicolor_medium_lime_s50"} -- works
defineregular{colorcode="2_4_7", colorname="medium_lime", recipe="group:dye,unicolor_medium_lime"} -- works
defineregular{colorcode="2_5_6", colorname="lime_s50", recipe="group:dye,unicolor_lime_s50"} -- works
defineregular{colorcode="2_5_7", colorname="lime", recipe="group:dye,excolor_lime"} -- works
defineregular{colorcode="3_3_6", colorname="dark_green_s50", recipe="group:dye,unicolor_dark_green_s50"} -- works
defineregular{colorcode="3_3_7", colorname="dark_green", recipe="dye:dark_green"} -- seems to be the same as regular green; PROBLEM
defineregular{colorcode="3_4_6", colorname="medium_green_s50", recipe="group:dye,unicolor_medium_green_s50"} -- works
defineregular{colorcode="3_4_7", colorname="medium_green", recipe="group:dye,unicolor_medium_green"} -- works
defineregular{colorcode="3_5_6", colorname="green_s50", recipe="group:dye,unicolor_green_s50"} -- works
defineregular{colorcode="3_5_7", colorname="green", recipe="dye:green"} --works -- do not change to group, or you'll break the darkgreen blocks
defineregular{colorcode="4_3_6", colorname="dark_aqua_s50", recipe="group:dye,unicolor_dark_aqua_s50"} -- works
defineregular{colorcode="4_3_7", colorname="dark_aqua", recipe="group:dye,unicolor_dark_aqua"} -- works
defineregular{colorcode="4_4_6", colorname="medium_aqua_s50", recipe="group:dye,unicolor_medium_aqua_s50"} -- works
defineregular{colorcode="4_4_7", colorname="medium_aqua", recipe="group:dye,unicolor_medium_aqua"} -- works
defineregular{colorcode="4_5_6", colorname="aqua_s50", recipe="group:dye,unicolor_aqua_s50"} -- works
defineregular{colorcode="4_5_7", colorname="aqua", recipe="group:dye,unicolor_aqua"} -- works
defineregular{colorcode="5_3_6", colorname="dark_cyan_s50", recipe="group:dye,unicolor_dark_cyan_s50"} -- works
defineregular{colorcode="5_3_7", colorname="dark_cyan", recipe="group:dye,unicolor_dark_cyan"} -- works
defineregular{colorcode="5_4_6", colorname="medium_cyan_s50", recipe="group:dye,unicolor_medium_cyan_s50"} -- works
defineregular{colorcode="5_4_7", colorname="medium_cyan", recipe="group:dye,unicolor_medium_cyan"} -- works
defineregular{colorcode="5_5_6", colorname="cyan_s50", recipe="group:dye,unicolor_cyan_s50"} -- works
defineregular{colorcode="5_5_7", colorname="cyan", recipe="group:dye,basecolor_cyan"} -- works
defineregular{colorcode="6_3_6", colorname="dark_skyblue_s50", recipe="group:dye,unicolor_dark_skyblue_s50"} -- works
defineregular{colorcode="6_3_7", colorname="dark_skyblue", recipe="group:dye,unicolor_dark_skyblue"} -- works
defineregular{colorcode="6_4_6", colorname="medium_skyblue_s50", recipe="group:dye,unicolor_medium_skyblue_s50"} -- works
defineregular{colorcode="6_4_7", colorname="medium_skyblue", recipe="group:dye,unicolor_medium_skyblue"} -- works
defineregular{colorcode="6_5_6", colorname="skyblue_s50", recipe="group:dye,unicolor_skyblue_s50"} -- works
defineregular{colorcode="6_5_7", colorname="skyblue", recipe="group:dye,excolor_sky_blue"} -- works
defineregular{colorcode="7_3_6", colorname="dark_blue_s50", recipe="group:dye,unicolor_dark_blue_s50"} -- works
defineregular{colorcode="7_3_7", colorname="dark_blue", recipe="group:dye,unicolor_dark_blue"} -- works
defineregular{colorcode="7_4_6", colorname="medium_blue_s50", recipe="group:dye,unicolor_medium_blue_s50"} -- works
defineregular{colorcode="7_4_7", colorname="medium_blue", recipe="group:dye,unicolor_medium_blue"} -- works
defineregular{colorcode="7_5_6", colorname="blue_s50", recipe="group:dye,unicolor_blue_s50"} -- works
defineregular{colorcode="7_5_7", colorname="blue", recipe="group:dye,basecolor_blue"} -- works
defineregular{colorcode="8_3_6", colorname="dark_violet_s50", recipe="group:dye,unicolor_dark_violet_s50"} -- works
defineregular{colorcode="8_3_7", colorname="dark_violet", recipe="group:dye,unicolor_dark_violet"} -- works
defineregular{colorcode="8_4_6", colorname="medium_violet_s50", recipe="group:dye,unicolor_medium_violet_s50"} -- works
defineregular{colorcode="8_4_7", colorname="medium_violet", recipe="group:dye,unicolor_medium_violet"} -- works
defineregular{colorcode="8_5_6", colorname="violet_s50", recipe="group:dye,unicolor_violet_s50"} -- works
defineregular{colorcode="8_5_7", colorname="violet", recipe="group:dye,excolor_violet"} -- works
defineregular{colorcode="9_3_6", colorname="dark_magenta_s50", recipe="group:dye,unicolor_dark_magenta_s50"} -- works
defineregular{colorcode="9_3_7", colorname="dark_magenta", recipe="group:dye,unicolor_dark_magenta"} -- works
defineregular{colorcode="9_4_6", colorname="medium_magenta_s50", recipe="group:dye,unicolor_medium_magenta_s50"} -- works
defineregular{colorcode="9_4_7", colorname="medium_magenta", recipe="group:dye,unicolor_medium_magenta"} -- works
defineregular{colorcode="9_5_6", colorname="magenta_s50", recipe="group:dye,unicolor_magenta_s50"} -- works
defineregular{colorcode="9_5_7", colorname="magenta", recipe="dye:magenta"} -- have to use exact dye name to get right color
defineregular{colorcode="10_3_6", colorname="dark_redviolet_s50", recipe="group:dye,unicolor_dark_redviolet_s50"} -- works
defineregular{colorcode="10_3_7", colorname="dark_redviolet", recipe="group:dye,unicolor_dark_redviolet"} -- works
defineregular{colorcode="10_4_6", colorname="medium_redviolet_s50", recipe="group:dye,unicolor_medium_redviolet_s50"} -- works
defineregular{colorcode="10_4_7", colorname="medium_redviolet", recipe="group:dye,unicolor_medium_redviolet"} -- works
defineregular{colorcode="10_5_6", colorname="redviolet_s50", recipe="group:dye,unicolor_redviolet_s50"} -- works
defineregular{colorcode="10_5_7", colorname="redviolet", recipe="dye:redviolet"} -- works now -- have to use exact dye name on this oone. -- looks broken again
defineregular{colorcode="11_3_6", colorname="dark_red_s50", recipe="group:dye,unicolor_dark_red_s50"} -- works
defineregular{colorcode="11_3_7", colorname="dark_red", recipe="group:dye,unicolor_dark_red"} -- works
defineregular{colorcode="11_4_6", colorname="medium_red_s50", recipe="group:dye,unicolor_medium_red_s50"} -- works
defineregular{colorcode="11_4_7", colorname="medium_red", recipe="group:dye,unicolor_medium_red"} -- works
defineregular{colorcode="11_5_6", colorname="red_s50", recipe="group:dye,unicolor_red_s50"} -- works
defineregular{colorcode="11_5_7", colorname="red", recipe="group:dye,basecolor_red"} -- works
defineregular{colorcode="12_3_6", colorname="dark_orange_s50", recipe="group:dye,unicolor_dark_orange_s50"} --works
defineregular{colorcode="12_3_7", colorname="dark_orange", recipe="group:dye,unicolor_dark_orange"} -- works
defineregular{colorcode="12_4_6", colorname="medium_orange_s50", recipe="group:dye,unicolor_medium_orange_s50"} -- works
defineregular{colorcode="12_4_7", colorname="medium_orange", recipe="group:dye,unicolor_medium_orange"} -- works
defineregular{colorcode="12_5_6", colorname="orange_s50", recipe="group:dye,unicolor_orange_s50"} -- works
defineregular{colorcode="12_5_7", colorname="orange", recipe="group:dye,basecolor_orange"} -- works
bright = BRIGHT[b] --if i could've figured out a way to pass multiple items in on recipe, I wouldn't have had to make
-- definelight or definepastel
definelight{colorcode="1_8", colorname="light_yellow", recipe="group:dye,unicolor_light_yellow"} -- works
definelight{colorcode="2_8", colorname="light_lime", recipe="group:dye,unicolor_light_lime"} -- works
definelight{colorcode="3_8", colorname="light_green", recipe="group:dye,unicolor_light_green"} -- works
definelight{colorcode="4_8", colorname="light_aqua", recipe="group:dye,unicolor_light_aqua"} -- works
definelight{colorcode="5_8", colorname="light_cyan", recipe="group:dye,unicolor_light_cyan"} -- works
definelight{colorcode="6_8", colorname="light_skyblue", recipe="group:dye,unicolor_light_skyblue"} -- works
definelight{colorcode="7_8", colorname="light_blue", recipe="group:dye,unicolor_light_blue"} -- works
definelight{colorcode="8_8", colorname="light_violet", recipe="group:dye,unicolor_light_violet"} -- works
definelight{colorcode="9_8", colorname="light_magenta", recipe="group:dye,unicolor_light_magenta"} --works
definelight{colorcode="10_8", colorname="light_redviolet", recipe="group:dye,unicolor_light_redviolet"} -- works
definelight{colorcode="11_8", colorname="light_red", recipe="group:dye,unicolor_light_red"} -- works (with pink, too!)
definelight{colorcode="12_8", colorname="light_orange", recipe="group:dye,unicolor_light_orange"} --works
--sub loop for saturation definepastel{colorcode="1_9", colorname="pastel_yellow", recipe="group:dye,unicolor_light_yellow"}
--starts at 6 to keep colors in order defineregular{colorcode="2_9", colorname="pastel_lime", recipe="group:dye,unicolor_light_lime"}
for s = 6, 7 do defineregular{colorcode="3_9", colorname="pastel_green", recipe="group:dye,unicolor_light_green"}
defineregular{colorcode="4_9", colorname="pastel_aqua", recipe="group:dye,excolor_light_aqua"}
sat = SAT[s] defineregular{colorcode="5_9", colorname="pastel_cyan", recipe="group:dye,unicolor_light_cyan"}
defineregular{colorcode="6_9", colorname="pastel_skyblue", recipe="group:dye,unicolor_light_skyblue"}
defineregular{colorcode="7_9", colorname="pastel_blue", recipe="group:dye,unicolor_light_blue"}
--register recipes defineregular{colorcode="8_9", colorname="pastel_violet", recipe="group:dye,unicolor_light_violet"}
defineregular{colorcode="9_9", colorname="pastel_magenta", recipe="\"group:dye,unicolor_light_magenta"}
minetest.register_craft({ defineregular{colorcode="10_9", colorname="pastel_redviolet", recipe="group:dye,unicolor_light_redviolet"}
type = "shapeless", defineregular{colorcode="11_9", colorname="pastel_red", recipe="group:dye,unicolor_light_red"}
output = "stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s) .." 3", defineregular{colorcode="12_9", colorname="pastel_orange", recipe="group:dye,unicolor_light_orange"}
recipe = { defineregular{colorcode="1_91", colorname="faint_yellow", recipe="group:dye,unicolor_light_yellow"}
"unifieddyes:" .. bright .. hues .. sat, defineregular{colorcode="2_91", colorname="faint_lime", recipe="group:dye,unicolor_light_lime"}
"moreblocks:superglowglass", defineregular{colorcode="3_91", colorname="faint_green", recipe="group:dye,unicolor_light_green"}
"moreblocks:superglowglass", defineregular{colorcode="4_91", colorname="faint_aqua", recipe="group:dye,unicolor_light_aqua"}
"moreblocks:superglowglass", defineregular{colorcode="5_91", colorname="faint_cyan", recipe="group:dye,unicolor_light_cyan"}
}, defineregular{colorcode="6_91", colorname="faint_skyblue", recipe="group:dye,unicolor_light_skyblue"}
}) defineregular{colorcode="7_91", colorname="faint_blue", recipe="group:dye,unicolor_light_blue"}
defineregular{colorcode="8_91", colorname="faint_violet", recipe="group:dye,unicolor_light_violet"}
--register item attributes defineregular{colorcode="9_91", colorname="faint_magenta", recipe="group:dye,unicolor_light_magenta"}
defineregular{colorcode="10_91", colorname="faint_redviolet", recipe="group:dye,unicolor_light_redviolet"}
minetest.register_node("stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s), { defineregular{colorcode="11_91", colorname="faint_red", recipe="group:dye,unicolor_light_red"}
description = "Stained Glass - " .. bright .. hues .. sat, defineregular{colorcode="12_91", colorname="faint_orange", recipe="group:dye,unicolor_light_orange"}
drawtype = "glasslike",
tiles = {"stained_glass_" .. bright .. hues .. sat .. ".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, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults()
})
end --sat
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",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_8_", {
description = "Stained Glass - light_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_light_" .. hues .. ".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, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults()
})
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",
tiles = {"stained_glass_pastel_" .. hues .. ".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, not_in_creative_inventory=1},
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",
tiles = {"stained_glass_faint_" .. hues .. ".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, not_in_creative_inventory=1},
sounds = default.node_sound_glass_defaults()
})
end --hues
-- END JDA
print("[stained_glass] Loaded!") print("[stained_glass] Loaded!")

299
init.lua~
View File

@ -1,299 +0,0 @@
--[[
Stained Glass 1.1
This mod provides luminescent stained glass blocks for Minetest 0.4.x.
Depends:
[moreblocks] by Calinou
[unifieddyes] by VanessaE
==============================================================================
Sun 24 Feb 2013 11:52:27 AM EST
Copyright (C) 2013, Eli Innis
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.
==============================================================================
Recipe for standard colors:
dye
super glow glass
super glow glass
super glow glass
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.
==============================================================================
]]--
-- 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...
HUES = {
"yellow",
"lime",
"green",
"aqua",
"cyan",
"skyblue",
"blue",
"violet",
"magenta",
"redviolet",
"red",
"orange"
}
-- 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)
}
-- Saturation - "s50" in a file/item name means "saturation: 50%".
-- 1x - 5x are simply placeholders so numbers start at 6.
SAT = {
"1x",
"2x",
"3x",
"4x",
"5x",
"_s50",
"" --(full)
}
--main loop for all 12 hues
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",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s), {
description = "Stained Glass - " .. bright .. hues .. sat,
drawtype = "glasslike",
tiles = {"stained_glass_" .. bright .. hues .. sat .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_" .. bright .. hues .. sat .. ".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 --sat
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",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_8_", {
description = "Stained Glass - light_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_light_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_light_" .. hues .. ".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
--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",
tiles = {"stained_glass_pastel_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_pastel_" .. hues .. ".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",
tiles = {"stained_glass_faint_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_faint_" .. hues .. ".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
print("[stained_glass] Loaded!")