Commit 7c7dd900 authored by Vanessa Dannenberg's avatar Vanessa Dannenberg

remove old conversion LBMs

they aren't needed anymore, and rely on functions that don't exist anymore
parent 6d7184e9
......@@ -614,114 +614,5 @@ minetest.register_ore({
y_max = sea_level - 1,
})
-- Convert old static nodes to param2 color
blox.old_static_list = {}
for _, nodeclass in ipairs(NodeClass) do
if nodeclass ~= "colored" then
for _, color in ipairs(BloxColours) do
table.insert(blox.old_static_list, "blox:"..color..nodeclass)
table.insert(blox.old_static_list, "blox:"..color..nodeclass.."_cobble")
table.insert(blox.old_static_list, "blox:"..color..nodeclass.."_wood")
end
end
end
for _, color in ipairs(BloxColours) do
table.insert(blox.old_static_list, "blox:"..color.."square")
table.insert(blox.old_static_list, "blox:"..color.."stone")
table.insert(blox.old_static_list, "blox:"..color.."wood")
table.insert(blox.old_static_list, "blox:"..color.."cobble")
end
minetest.register_lbm({
name = "blox:convert",
label = "Convert blox blocks to use param2 color",
run_at_every_load = false,
nodenames = blox.old_static_list,
action = function(pos, node)
local basename = string.sub(node.name, 6)
local color = basename
local material = "stone"
local pattern = "tinted"
if string.find(basename, "_cobble") then
basename = string.sub(basename, 1, -8)
material = "cobble"
elseif string.find(basename, "cobble") then
basename = string.sub(basename, 1, -7)
material = "cobble"
elseif string.find(basename, "_wood") then
basename = string.sub(basename, 1, -6)
material = "wood"
elseif string.find(basename, "wood") then
basename = string.sub(basename, 1, -5)
material = "wood"
elseif string.find(basename, "square") then
basename = string.sub(basename, 1, -7)
pattern = "square"
elseif string.find(basename, "stone") then
basename = string.sub(basename, 1, -6)
end
-- at this point, the material type has been deleted from `basename`.
if string.find(basename, "quarter") then
basename = string.sub(basename, 1, -8)
pattern = "quarter"
elseif string.find(basename, "cross") then
basename = string.sub(basename, 1, -6)
pattern = "cross"
elseif string.find(basename, "corner") then
basename = string.sub(basename, 1, -7)
pattern = "corner"
elseif string.find(basename, "diamond") then
basename = string.sub(basename, 1, -8)
pattern = "diamond"
elseif string.find(basename, "loop") then
basename = string.sub(basename, 1, -5)
pattern = "loop"
elseif string.find(basename, "checker") then
basename = string.sub(basename, 1, -8)
pattern = "checker"
end
-- all that's left in `basename` now is the color.
color = basename
if color == "purple" then
color = "violet"
elseif color == "blue" then
color = "skyblue"
elseif color == "pink" then
color = "magenta"
elseif color == "black" and
( pattern == "square" or
pattern == "tinted" ) then
color = "dark_grey"
end
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
minetest.set_node(pos, { name = "blox:"..material.."_"..pattern, param2 = paletteidx })
local meta = minetest.get_meta(pos)
meta:set_string("dye", "unifieddyes:"..color)
meta:set_string("palette", "ext")
end
})
minetest.register_lbm({
name = "blox:recolor_stuff",
label = "Convert 89-color blocks to use UD extended palette",
run_at_every_load = false,
nodenames = blox.old_89_color_nodes,
action = function(pos, node)
local meta = minetest.get_meta(pos)
if meta:get_string("palette") ~= "ext" then
minetest.swap_node(pos, { name = node.name, param2 = unifieddyes.convert_classic_palette[node.param2] })
meta:set_string("palette", "ext")
end
end
})
print("Blox Mod [" ..version.. "] Loaded!")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment