]> git.lizzy.rs Git - xdecor.git/commitdiff
Display itemstring in itemframes (#116)
authorNiwla23 <46248939+Niwla23@users.noreply.github.com>
Sat, 12 Oct 2019 11:23:04 +0000 (13:23 +0200)
committerJean-Patrick Guerrero <kilbith@users.noreply.github.com>
Sat, 12 Oct 2019 11:23:04 +0000 (13:23 +0200)
Itemframe patch

src/itemframe.lua

index 0843b452019666f0cd8c2880f8fff3e90c8724f5..a79d56e8c344cebfa30ac4d97e86ce42cbd760e0 100644 (file)
@@ -85,7 +85,11 @@ function itemframe.rightclick(pos, node, clicker, itemstack)
        local itemstring = itemstack:take_item():to_string()
        meta:set_string("item", itemstring)
        update_item(pos, node)
-
+       if itemstring == "" then
+               meta:set_string("infotext", "Item Frame (owned by " .. owner .. ")")
+       else
+               meta:set_string("infotext", itemstring.." (owned by " .. owner .. ")")
+       end
        return itemstack
 end