1
0
mirror of https://codeberg.org/minenux/minetest-mod-xdecor synced 2023-10-20 21:43:39 -07:00

Mark the legacy code to remove later

This commit is contained in:
jp 2015-12-23 11:50:38 +01:00
parent e2281dca39
commit c479ec57da
4 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
minetest.register_alias("xdecor:cauldron", "xdecor:cauldron_empty")
minetest.register_alias("xdecor:cauldron", "xdecor:cauldron_empty") -- legacy code
local cauldron_cbox = {
type = "fixed",

View File

@ -172,7 +172,6 @@ for _, tooldef in next, defs, 1 do
for _, ench in pairs(tooldef[3]) do
local tool, group, material, enchant = tooldef[1], tooldef[2], mat, ench
local original_tool = minetest.registered_tools[mod..":"..tool.."_"..material]
local ceil = math.ceil
if original_tool then
if mod == "default" then
@ -184,7 +183,7 @@ for _, ench in pairs(tooldef[3]) do
local max_drop_level = original_tool.tool_capabilities.max_drop_level
if enchant == "durable" then
groupcaps[group].uses = ceil(original_groupcaps[group].uses * use_factor)
groupcaps[group].uses = math.ceil(original_groupcaps[group].uses * use_factor)
elseif enchant == "fast" then
for i = 1, 3 do
groupcaps[group].times[i] = original_groupcaps[group].times[i] - times_subtractor
@ -213,7 +212,7 @@ for _, ench in pairs(tooldef[3]) do
for armor_group, value in pairs(original_armor_groups) do
if enchant == "strong" then
armorcaps[armor_group] = ceil(value * strength_factor)
armorcaps[armor_group] = math.ceil(value * strength_factor)
elseif enchant == "speed" then
armorcaps[armor_group] = value
armorcaps.physics_speed = speed_factor
@ -231,7 +230,8 @@ for _, ench in pairs(tooldef[3]) do
})
end
end
minetest.register_alias("xdecor:enchanted_"..tool.."_"..material.."_"..enchant, mod..":enchanted_"..tool.."_"..material.."_"..enchant)
minetest.register_alias("xdecor:enchanted_"..tool.."_"..material.."_"..enchant, mod..
":enchanted_"..tool.."_"..material.."_"..enchant) -- legacy code
end
end
end

View File

@ -373,7 +373,7 @@ xdecor.register("painting_1", {
end
})
minetest.register_alias("xdecor:painting", "xdecor:painting_1")
minetest.register_alias("xdecor:painting", "xdecor:painting_1") -- legacy code
for i = 2, 4 do
xdecor.register("painting_"..i, {

View File

@ -277,7 +277,7 @@ function worktable.fields(pos, _, fields, sender)
end
worktable.crafting(pos)
elseif fields.craftguide then
if not meta:to_table().inventory.inv_items_list then return end
if not meta:to_table().inventory.inv_items_list then return end -- legacy code
worktable.craft_output_recipe(pos, 0, 1, nil, "")
elseif fields.alternate then
inv:set_list("craft_output_recipe", {})
@ -488,7 +488,7 @@ for _, name in pairs(n) do
on_place = minetest.rotate_node
})
end
minetest.register_alias("xdecor:"..d[1].."_"..name, mod..":"..name.."_"..d[1])
minetest.register_alias("xdecor:"..d[1].."_"..name, mod..":"..name.."_"..d[1]) -- legacy code
end
end
end