mirror of
https://github.com/minetest-mods/stained_glass.git
synced 2025-07-22 16:10:22 +02:00
Compare commits
13 Commits
af425a67ea
...
master
Author | SHA1 | Date | |
---|---|---|---|
e7988d5867 | |||
aa9e57ebc3 | |||
aee34845cb | |||
a68dfa502c | |||
fc371df620 | |||
d1b0278c68 | |||
d1cdbbd5bc | |||
3d7ab900a0 | |||
827eb3e484 | |||
3c2ca3a606 | |||
5abcd8433f | |||
8fb5fa188e | |||
8cb21b1057 |
@ -1,3 +0,0 @@
|
||||
default
|
||||
moreblocks
|
||||
unifieddyes
|
90
init.lua
90
init.lua
@ -17,6 +17,7 @@ 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.
|
||||
|
||||
@ -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
|
||||
darken it). Crafting is no longer used to create the colors.
|
||||
|
||||
August 2018 -- altered to use proper colored itemstacks with crafting
|
||||
|
||||
==============================================================================
|
||||
]]--
|
||||
|
||||
@ -43,64 +46,80 @@ local myglow = LIGHT_MAX-3
|
||||
|
||||
minetest.register_node("stained_glass:stained_glass", {
|
||||
description = "Stained Glass",
|
||||
drawtype = "glasslike",
|
||||
tiles = { "stained_glass.png" },
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = { "stained_glass.png", "stained_glass_detail.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
use_texture_alpha = "blend",
|
||||
light_source = myglow,
|
||||
is_ground_content = true,
|
||||
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(),
|
||||
drop = "moreblocks:super_glow_glass",
|
||||
on_construct = unifieddyes.on_construct,
|
||||
after_place_node = unifieddyes.recolor_on_place,
|
||||
after_dig_node = unifieddyes.after_dig_node,
|
||||
drop = "moreblocks:super_glow_glass"
|
||||
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},
|
||||
ud_replacement_node = "stained_glass:stained_glass",
|
||||
after_place_node = unifieddyes.recolor_on_place
|
||||
})
|
||||
|
||||
-- trap glass
|
||||
|
||||
minetest.register_node("stained_glass:stained_trap_glass", {
|
||||
description = "Stained Trap-glass",
|
||||
drawtype = "glasslike",
|
||||
tiles = { "stained_glass.png" },
|
||||
drawtype = "glasslike_framed_optional",
|
||||
tiles = { "stained_glass.png", "stained_glass_detail.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "color",
|
||||
palette = "unifieddyes_palette_extended.png",
|
||||
place_param2 = 240,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
use_texture_alpha = "blend",
|
||||
light_source = myglow,
|
||||
is_ground_content = true,
|
||||
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(),
|
||||
drop = "moreblocks:trap_super_glow_glass",
|
||||
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"
|
||||
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},
|
||||
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)
|
||||
local name=arg.blockname
|
||||
local myglow=arg.glow
|
||||
@ -387,32 +406,5 @@ minetest.register_lbm({
|
||||
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!")
|
||||
|
2
mod.conf
Normal file
2
mod.conf
Normal file
@ -0,0 +1,2 @@
|
||||
name = stained_glass
|
||||
depends = default, moreblocks, unifieddyes
|
BIN
textures/stained_glass_detail.png
Normal file
BIN
textures/stained_glass_detail.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 402 B |
Reference in New Issue
Block a user