switch to colored itemstacks

with full crafting recipes
(requires Unified Dyes commit 2a816534 or later)
This commit is contained in:
Vanessa Dannenberg 2018-08-22 20:52:20 -04:00
parent af425a67ea
commit 8cb21b1057

View File

@ -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,12 @@ 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,
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",
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 +75,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 +82,40 @@ 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,
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",
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