summaryrefslogtreecommitdiff
path: root/sign.lua
diff options
context:
space:
mode:
authorBremaWeb <brandon@bremaweb.com>2013-11-30 13:23:50 -0600
committerBremaWeb <brandon@bremaweb.com>2013-11-30 13:23:50 -0600
commit81a12e3d38c83eacfce4a3eeaec14724dcdb4c8f (patch)
tree58701772bd01e4ab332a0699cdcf0a3e0bf8e432 /sign.lua
parent6b22f3d60f1b942485ccbb6dc5417fbe65119db9 (diff)
restructured, use Settings interface for config, use protection API
Diffstat (limited to 'sign.lua')
-rw-r--r--sign.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/sign.lua b/sign.lua
new file mode 100644
index 0000000..83b33d6
--- /dev/null
+++ b/sign.lua
@@ -0,0 +1,45 @@
+-- create a new type of sign that is not protected by landrush mod
+minetest.register_node("landrush:unlocked_sign", {
+ description = "Unprotected Sign",
+ drawtype = "signlike",
+ tiles = {"default_sign_wall.png"},
+ inventory_image = "default_sign_wall.png",
+ wield_image = "default_sign_wall.png",
+ paramtype = "light",
+ paramtype2 = "wallmounted",
+ sunlight_propagates = true,
+ walkable = false,
+ selection_box = {
+ type = "wallmounted",
+ --wall_top = <default>
+ --wall_bottom = <default>
+ --wall_side = <default>
+ },
+ groups = {choppy=2,dig_immediate=2,attached_node=1},
+ legacy_wallmounted = true,
+ sounds = default.node_sound_defaults(),
+ on_construct = function(pos)
+ --local n = minetest.get_node(pos)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec", "field[text;;${text}]")
+ meta:set_string("infotext", "\"\"")
+ end,
+ on_receive_fields = function(pos, formname, fields, sender)
+ local meta = minetest.get_meta(pos)
+ fields.text = fields.text or ""
+ print((sender:get_player_name() or "").." wrote \""..fields.text..
+ "\" to sign at "..minetest.pos_to_string(pos))
+ meta:set_string("text", fields.text)
+ meta:set_string("infotext", '"'..fields.text..'"')
+ end,
+})
+
+
+minetest.register_craft({
+ output = 'landrush:unlocked_sign 6',
+ recipe = {
+ {'default:wood','default:wood','default:wood'},
+ {'default:wood','default:wood','landrush:landclaim'},
+ {'','default:stick',''}
+ }
+})