]> git.lizzy.rs Git - xdecor.git/commitdiff
Ensure compatibility with older clients (<= 0.4.14)
authorJPG <jeanpatrick.guerrero@gmail.com>
Fri, 16 Dec 2016 11:49:25 +0000 (12:49 +0100)
committerJPG <jeanpatrick.guerrero@gmail.com>
Fri, 16 Dec 2016 11:49:25 +0000 (12:49 +0100)
src/enchanting.lua
src/mailbox.lua

index 117861f0a0ebc25bb89344dfaa083a2289fc0000..5d1d44a6e0a78edc24f2d26462063045b7348fa6 100644 (file)
@@ -42,7 +42,10 @@ function enchanting:get_tooltip(enchant, orig_caps, fleshy)
                strong  = {"#ff3d3d", ""},
                speed   = {"#fd5eff", ""}
        }
-       return minetest.colorize(specs[enchant][1], "\n"..cap(enchant)..specs[enchant][2])
+       return minetest.colorize and
+               minetest.colorize(specs[enchant][1],
+                                 "\n"..cap(enchant)..specs[enchant][2]) or
+               "\n"..cap(enchant)..specs[enchant][2]
 end
 
 local enchant_buttons = {
index edcbbfcc91a9c5f5ccb4cc14fbf8d0e1d0de1e96..c1b330b74596dce0dd3e175cf3b5f4f51c9564f5 100644 (file)
@@ -44,7 +44,8 @@ function mailbox:formspec(pos, owner, is_owner)
 
                                giver = giver.."#FFFF00,"..giver_name..","..i..
                                        ",#FFFFFF,x "..stack_count..","
-                               img = img..i.."="..img_col(stack_name).."^\\[resize:16x16,"
+                               img = img..i.."="..
+                                       img_col(stack_name).."^\\[resize:16x16,"
                        end
                end
 
@@ -63,7 +64,9 @@ function mailbox:formspec(pos, owner, is_owner)
        end
        return [[ size[8,5]
                list[current_player;main;0,1.25;8,4;] ]]..
-               "label[0,0;Send your goods to\n"..minetest.colorize("#FFFF00", owner).."]"..
+               "label[0,0;Send your goods to\n"..
+                       (minetest.colorize and
+                        minetest.colorize("#FFFF00", owner) or owner).."]"..
                "list[nodemeta:"..spos..";drop;3.5,0;1,1;]"..
                xbg..default.get_hotbar_bg(0,1.25)
 end