Mark the legacy code to remove later
This commit is contained in:
parent
e2281dca39
commit
c479ec57da
@ -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 = {
|
local cauldron_cbox = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
|
@ -172,7 +172,6 @@ for _, tooldef in next, defs, 1 do
|
|||||||
for _, ench in pairs(tooldef[3]) do
|
for _, ench in pairs(tooldef[3]) do
|
||||||
local tool, group, material, enchant = tooldef[1], tooldef[2], mat, ench
|
local tool, group, material, enchant = tooldef[1], tooldef[2], mat, ench
|
||||||
local original_tool = minetest.registered_tools[mod..":"..tool.."_"..material]
|
local original_tool = minetest.registered_tools[mod..":"..tool.."_"..material]
|
||||||
local ceil = math.ceil
|
|
||||||
|
|
||||||
if original_tool then
|
if original_tool then
|
||||||
if mod == "default" 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
|
local max_drop_level = original_tool.tool_capabilities.max_drop_level
|
||||||
|
|
||||||
if enchant == "durable" then
|
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
|
elseif enchant == "fast" then
|
||||||
for i = 1, 3 do
|
for i = 1, 3 do
|
||||||
groupcaps[group].times[i] = original_groupcaps[group].times[i] - times_subtractor
|
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
|
for armor_group, value in pairs(original_armor_groups) do
|
||||||
if enchant == "strong" then
|
if enchant == "strong" then
|
||||||
armorcaps[armor_group] = ceil(value * strength_factor)
|
armorcaps[armor_group] = math.ceil(value * strength_factor)
|
||||||
elseif enchant == "speed" then
|
elseif enchant == "speed" then
|
||||||
armorcaps[armor_group] = value
|
armorcaps[armor_group] = value
|
||||||
armorcaps.physics_speed = speed_factor
|
armorcaps.physics_speed = speed_factor
|
||||||
@ -231,7 +230,8 @@ for _, ench in pairs(tooldef[3]) do
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
end
|
end
|
||||||
|
@ -373,7 +373,7 @@ xdecor.register("painting_1", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_alias("xdecor:painting", "xdecor:painting_1")
|
minetest.register_alias("xdecor:painting", "xdecor:painting_1") -- legacy code
|
||||||
|
|
||||||
for i = 2, 4 do
|
for i = 2, 4 do
|
||||||
xdecor.register("painting_"..i, {
|
xdecor.register("painting_"..i, {
|
||||||
|
@ -277,7 +277,7 @@ function worktable.fields(pos, _, fields, sender)
|
|||||||
end
|
end
|
||||||
worktable.crafting(pos)
|
worktable.crafting(pos)
|
||||||
elseif fields.craftguide then
|
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, "")
|
worktable.craft_output_recipe(pos, 0, 1, nil, "")
|
||||||
elseif fields.alternate then
|
elseif fields.alternate then
|
||||||
inv:set_list("craft_output_recipe", {})
|
inv:set_list("craft_output_recipe", {})
|
||||||
@ -488,7 +488,7 @@ for _, name in pairs(n) do
|
|||||||
on_place = minetest.rotate_node
|
on_place = minetest.rotate_node
|
||||||
})
|
})
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user