Add check to update pre 0.84.0 Ominous Banners

This commit is contained in:
PrairieWind 2023-05-19 19:29:58 -06:00
parent 739a894856
commit 37fe58ab45
2 changed files with 11 additions and 0 deletions

@ -493,6 +493,16 @@ for colorid, colortab in pairs(mcl_banners.colors) do
end
end
-- Update old pre 0.84.0 Ominous Banners with correct description.
local stackmeta = itemstack:get_meta()
if stackmeta:get_string("name"):find("Ominous Banner") then
local oban_layers = minetest.deserialize(stackmeta:get_string("layers"))
local banner_description = string.gsub(itemstack:get_definition().description, "White Banner", "Ominous Banner")
local description = mcl_banners.make_advanced_banner_description(banner_description, oban_layers)
stackmeta:set_string("description", description)
stackmeta:set_string("name", nil)
end
-- Place the node!
local hanging = false

@ -76,3 +76,4 @@ You can copy the pattern of a banner by placing two banners of the same color in
And one additional layer=
And @1 additional layers=
Paintable decoration=
Ominous Banner=