mirror of
https://github.com/minetest-mods/stained_glass.git
synced 2025-07-22 08:00:23 +02:00
Compare commits
9 Commits
af425a67ea
...
fc371df620
Author | SHA1 | Date | |
---|---|---|---|
fc371df620 | |||
d1b0278c68 | |||
d1cdbbd5bc | |||
3d7ab900a0 | |||
827eb3e484 | |||
3c2ca3a606 | |||
5abcd8433f | |||
8fb5fa188e | |||
8cb21b1057 |
@ -1,3 +0,0 @@
|
|||||||
default
|
|
||||||
moreblocks
|
|
||||||
unifieddyes
|
|
74
init.lua
74
init.lua
@ -17,6 +17,7 @@ Email: doyousketch2 @ yahoo.com
|
|||||||
Unified Dyes was released under GNU-GPL 2.0, see LICENSE for info.
|
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.
|
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
|
Additional changes by VanessaEzekowitz in July 2013 to take all items
|
||||||
out of creative inventory.
|
out of creative inventory.
|
||||||
|
|
||||||
@ -33,6 +34,8 @@ January 2017 -- rewritten a bit more by Vanessa E. to use engine param2 coloriza
|
|||||||
some dye to re-color it (you have to dig and re-place if you want to
|
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.
|
darken it). Crafting is no longer used to create the colors.
|
||||||
|
|
||||||
|
August 2018 -- altered to use proper colored itemstacks with crafting
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
@ -48,7 +51,6 @@ minetest.register_node("stained_glass:stained_glass", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
place_param2 = 240,
|
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
light_source = myglow,
|
light_source = myglow,
|
||||||
@ -56,18 +58,14 @@ minetest.register_node("stained_glass:stained_glass", {
|
|||||||
walkable = true,
|
walkable = true,
|
||||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
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(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
drop = "moreblocks:super_glow_glass",
|
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
after_place_node = unifieddyes.recolor_on_place,
|
on_dig = unifieddyes.on_dig,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
|
||||||
drop = "moreblocks:super_glow_glass"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.override_item("moreblocks:super_glow_glass", {
|
minetest.override_item("moreblocks:super_glow_glass", {
|
||||||
palette = "unifieddyes_palette_extended.png",
|
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},
|
groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3, ud_param2_colorable = 1},
|
||||||
ud_replacement_node = "stained_glass:stained_glass",
|
|
||||||
after_place_node = unifieddyes.recolor_on_place
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- trap glass
|
-- trap glass
|
||||||
@ -79,7 +77,6 @@ minetest.register_node("stained_glass:stained_trap_glass", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "color",
|
paramtype2 = "color",
|
||||||
palette = "unifieddyes_palette_extended.png",
|
palette = "unifieddyes_palette_extended.png",
|
||||||
place_param2 = 240,
|
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
light_source = myglow,
|
light_source = myglow,
|
||||||
@ -87,20 +84,42 @@ minetest.register_node("stained_glass:stained_trap_glass", {
|
|||||||
walkable = false,
|
walkable = false,
|
||||||
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1, ud_param2_colorable = 1},
|
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(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
drop = "moreblocks:trap_super_glow_glass",
|
|
||||||
on_construct = unifieddyes.on_construct,
|
on_construct = unifieddyes.on_construct,
|
||||||
after_place_node = unifieddyes.recolor_on_place,
|
on_dig = unifieddyes.on_dig,
|
||||||
after_dig_node = unifieddyes.after_dig_node,
|
|
||||||
drop = "moreblocks:trap_super_glow_glass"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.override_item("moreblocks:trap_super_glow_glass", {
|
minetest.override_item("moreblocks:trap_super_glow_glass", {
|
||||||
palette = "unifieddyes_palette_extended.png",
|
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},
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, ud_param2_colorable = 1},
|
||||||
ud_replacement_node = "stained_glass:stained_trap_glass",
|
|
||||||
after_place_node = unifieddyes.recolor_on_place
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- 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 stainedglass.makenode(arg)
|
||||||
local name=arg.blockname
|
local name=arg.blockname
|
||||||
local myglow=arg.glow
|
local myglow=arg.glow
|
||||||
@ -387,32 +406,5 @@ minetest.register_lbm({
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_lbm({
|
|
||||||
name = "stained_glass:recolor_glass",
|
|
||||||
label = "Convert glass to use UD extended palette",
|
|
||||||
run_at_every_load = false,
|
|
||||||
nodenames = {
|
|
||||||
"stained_glass:stained_glass",
|
|
||||||
"stained_glass:stained_trap_glass",
|
|
||||||
"stained_glass:faint_stained_glass",
|
|
||||||
"stained_glass:faint_stained_trap_glass",
|
|
||||||
"stained_glass:pastel_stained_glass",
|
|
||||||
"stained_glass:pastel_stained_trap_glass"
|
|
||||||
},
|
|
||||||
action = function(pos, node)
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
if meta:get_string("palette") ~= "ext" then
|
|
||||||
|
|
||||||
local newcolor = unifieddyes.convert_classic_palette[node.param2]
|
|
||||||
if string.find(node.name, "faint") then
|
|
||||||
newcolor = newcolor - 4*24
|
|
||||||
elseif string.find(node.name, "pastel") then
|
|
||||||
newcolor = newcolor - 3*24
|
|
||||||
end
|
|
||||||
minetest.swap_node(pos, { name = "stained_glass:stained_glass", param2 = newcolor })
|
|
||||||
meta:set_string("palette", "ext")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
||||||
print("[stained_glass] Loaded!")
|
print("[stained_glass] Loaded!")
|
||||||
|
Reference in New Issue
Block a user