Compare commits
No commits in common. "master" and "variable_lightlevel" have entirely different histories.
master
...
variable_l
3
depends.txt
Normal file
@ -0,0 +1,3 @@
|
||||
default
|
||||
moreblocks
|
||||
unifieddyes
|
@ -1,16 +0,0 @@
|
||||
#!/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
|
210
init.lua
@ -17,7 +17,6 @@ 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.
|
||||
|
||||
@ -26,112 +25,78 @@ changes, and to resurrect the craft recipes. Still GPL'd as far as I'm concerned
|
||||
|
||||
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.
|
||||
==============================================================================
|
||||
|
||||
August 2018 -- altered to use proper colored itemstacks with crafting
|
||||
|
||||
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
|
||||
|
||||
recipe for low-glow-stained-glass:
|
||||
as above, but substitute 'glow glass' for super glow glass.
|
||||
|
||||
recipe for no-glow-stained-glass:
|
||||
as regular stained glass, but substitute plain 'glass' for super glow glass
|
||||
|
||||
|
||||
All recipes produce three stained glass blocks.
|
||||
|
||||
==============================================================================
|
||||
]]--
|
||||
|
||||
stainedglass = {}
|
||||
stainedglass.old_static_nodes = {}
|
||||
|
||||
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)
|
||||
function makenode(arg)
|
||||
local name=arg.blockname
|
||||
local myglow=arg.glow
|
||||
local myprefix=arg.prefix
|
||||
local imagename=arg.imagename
|
||||
local safe=arg.walkflag
|
||||
local Description
|
||||
|
||||
local function tchelper(first, rest)
|
||||
return first:upper()..rest:lower()
|
||||
end -- from lua-users.org/wiki/StringRecipes
|
||||
local function tchelper(first, rest)
|
||||
return first:upper()..rest:lower()
|
||||
end -- from lua-users.org/wiki/StringRecipes
|
||||
-- above function is used to turn red_violet_s50 to 'Red Violet S50'
|
||||
|
||||
table.insert(stainedglass.old_static_nodes, "stained_glass:"..name)
|
||||
--register item attributes
|
||||
|
||||
Description=string.gsub("Stained Glass - " ..myprefix..name, "_", " ")
|
||||
Description=Description:gsub("(%a)([%w_']*)", tchelper)
|
||||
|
||||
minetest.register_node("stained_glass:"..myprefix..name, {
|
||||
description = Description,
|
||||
drawtype = "glasslike",
|
||||
tiles = {"stained_glass_" .. imagename .. ".png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
light_source = myglow,
|
||||
is_ground_content = true,
|
||||
walkable=safe, -- if not safe, this is trapglass
|
||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
end
|
||||
|
||||
-- maybe someday, I can cleanly combine these two functions.
|
||||
@ -183,7 +148,13 @@ function stained_trapglass_define(arg)
|
||||
myrecipe[6] = "dye:white"
|
||||
end
|
||||
|
||||
stainedglass.makenode{blockname=name, glow=myglow, prefix=myprefix, imagename=imagename, walkflag=false}
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "stained_glass:"..myprefix..name.." 3",
|
||||
recipe = myrecipe,
|
||||
})
|
||||
|
||||
makenode{blockname=name, glow=myglow, prefix=myprefix, imagename=imagename, walkflag=false}
|
||||
end
|
||||
end
|
||||
|
||||
@ -233,13 +204,19 @@ function stained_glass_define(arg)
|
||||
myrecipe[6] = "dye:white"
|
||||
end
|
||||
|
||||
stainedglass.makenode{blockname=name, glow=myglow, prefix=myprefix, imagename=name, walkflag=true}
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "stained_glass:"..myprefix..name.." 3",
|
||||
recipe = myrecipe,
|
||||
})
|
||||
|
||||
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
|
||||
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
|
||||
@ -310,6 +287,7 @@ for i in ipairs(stained_glass_hues) do
|
||||
|
||||
recipevalue = "group:dye,unicolor_"..shadename..huename
|
||||
if (shadename == "" and stained_glass_hues[i][2]) then
|
||||
-- print(huename .. " is set to true -- substituting dye:huename ")
|
||||
recipevalue = "dye:"..huename
|
||||
elseif (shadename=="pastel_" or shadename=="faint_") then
|
||||
-- force light_dye for pastel and faint colors
|
||||
@ -373,38 +351,6 @@ for i in ipairs(stained_glass_hues) do
|
||||
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
|
||||
})
|
||||
|
||||
|
||||
print("[stained_glass] Loaded!")
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 291 B |
BIN
textures/stained_glass_aqua.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_aqua_s50.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
textures/stained_glass_blue.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_blue_s50.png
Normal file
After Width: | Height: | Size: 680 B |
BIN
textures/stained_glass_cyan.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_cyan_s50.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_dark_aqua.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_aqua_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_blue.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
textures/stained_glass_dark_blue_s50.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
textures/stained_glass_dark_cyan.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
textures/stained_glass_dark_cyan_s50.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
textures/stained_glass_dark_green.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
textures/stained_glass_dark_green_s50.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
textures/stained_glass_dark_lime.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_lime_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_magenta.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
textures/stained_glass_dark_magenta_s50.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
textures/stained_glass_dark_orange.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_orange_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_red.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
textures/stained_glass_dark_red_s50.png
Normal file
After Width: | Height: | Size: 515 B |
BIN
textures/stained_glass_dark_redviolet.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_redviolet_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_skyblue.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_skyblue_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_violet.png
Normal file
After Width: | Height: | Size: 585 B |
BIN
textures/stained_glass_dark_violet_s50.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
textures/stained_glass_dark_yellow.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
textures/stained_glass_dark_yellow_s50.png
Normal file
After Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 402 B |
BIN
textures/stained_glass_faint_aqua.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_blue.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_cyan.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_green.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_lime.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_magenta.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_orange.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_red.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_redviolet.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_skyblue.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_violet.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_faint_yellow.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_green.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_green_s50.png
Normal file
After Width: | Height: | Size: 680 B |
BIN
textures/stained_glass_light_aqua.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_blue.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_cyan.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_green.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_lime.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_magenta.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_orange.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_red.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_redviolet.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_skyblue.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_violet.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_light_yellow.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_lime.png
Normal file
After Width: | Height: | Size: 492 B |
BIN
textures/stained_glass_lime_s50.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_magenta.png
Normal file
After Width: | Height: | Size: 485 B |
BIN
textures/stained_glass_magenta_s50.png
Normal file
After Width: | Height: | Size: 705 B |
BIN
textures/stained_glass_medium_aqua.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_aqua_s50.png
Normal file
After Width: | Height: | Size: 638 B |
BIN
textures/stained_glass_medium_blue.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
textures/stained_glass_medium_blue_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_medium_cyan.png
Normal file
After Width: | Height: | Size: 642 B |
BIN
textures/stained_glass_medium_cyan_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_medium_green.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
textures/stained_glass_medium_green_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_medium_lime.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_lime_s50.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
textures/stained_glass_medium_magenta.png
Normal file
After Width: | Height: | Size: 642 B |
BIN
textures/stained_glass_medium_magenta_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_medium_orange.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_orange_s50.png
Normal file
After Width: | Height: | Size: 638 B |
BIN
textures/stained_glass_medium_red.png
Normal file
After Width: | Height: | Size: 636 B |
BIN
textures/stained_glass_medium_red_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_medium_redviolet.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_redviolet_s50.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
textures/stained_glass_medium_skyblue.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_skyblue_s50.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
textures/stained_glass_medium_violet.png
Normal file
After Width: | Height: | Size: 656 B |
BIN
textures/stained_glass_medium_violet_s50.png
Normal file
After Width: | Height: | Size: 638 B |
BIN
textures/stained_glass_medium_yellow.png
Normal file
After Width: | Height: | Size: 642 B |
BIN
textures/stained_glass_medium_yellow_s50.png
Normal file
After Width: | Height: | Size: 593 B |
BIN
textures/stained_glass_orange.png
Normal file
After Width: | Height: | Size: 701 B |
BIN
textures/stained_glass_orange_s50.png
Normal file
After Width: | Height: | Size: 685 B |
BIN
textures/stained_glass_pastel_aqua.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_blue.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_cyan.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_green.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_lime.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_magenta.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_orange.png
Normal file
After Width: | Height: | Size: 710 B |
BIN
textures/stained_glass_pastel_red.png
Normal file
After Width: | Height: | Size: 710 B |