Random node metadata things
authorPerttu Ahola <celeron55@gmail.com>
Fri, 1 Jun 2012 16:03:09 +0000 (19:03 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sun, 3 Jun 2012 19:31:00 +0000 (22:31 +0300)
builtin/item.lua
doc/lua_api.txt
games/minimal/mods/default/init.lua

index 129a12cf87e034358973caa49a7a6dc30bd991e4..d30b439aa53f1ff485c761d110300b954dd42b08 100644 (file)
@@ -158,11 +158,6 @@ function minetest.item_place_node(itemstack, placer, pointed_thing)
                -- Add node and update
                minetest.env:add_node(pos, newnode)
 
-               -- Set metadata owner
-               if def.metadata_name ~= "" then
-                       minetest.env:get_meta(pos):set_owner(placer:get_player_name())
-               end
-
                -- Run script hook
                local _, callback
                for _, callback in ipairs(minetest.registered_on_placenodes) do
@@ -319,7 +314,6 @@ minetest.nodedef_default = {
        diggable = true,
        climbable = false,
        buildable_to = false,
-       metadata_name = "",
        liquidtype = "none",
        liquid_alternative_flowing = "",
        liquid_alternative_source = "",
index 734171d07683fdc2c3c241926b0710618d5c9d61..58c260425b361f65ae91c5f16a6903397073eaa0 100644 (file)
@@ -1009,7 +1009,6 @@ Node definition (register_node)
     buildable_to = false,
     drop = "",
     -- alternatively drop = { max_items = ..., items = { ... } }
-    metadata_name = "",
     liquidtype = "none",
     liquid_alternative_flowing = "",
     liquid_alternative_source = "",
index 516968f384e0b072a6cf055eead5f41f567c6398..ed16e6a3702c1b15881bc600e075fd424e2cbe7a 100644 (file)
@@ -1112,6 +1112,12 @@ minetest.register_node("default:sign_wall", {
        groups = {choppy=2,dig_immediate=2},
        legacy_wallmounted = true,
        sounds = default.node_sound_defaults(),
+       on_construct = function(pos)
+               --local n = minetest.env:get_node(pos)
+               local meta = minetest.env:get_meta(pos)
+               meta:set_string("formspec", "hack:sign_text_input")
+               meta:set_string("infotext", "\"${text}\"")
+       end,
 })
 
 minetest.register_node("default:chest", {