forked from Bremaweb/landrush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign.lua
25 lines (20 loc) · 811 Bytes
/
sign.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- create a new type of sign that is not protected by landrush mod
local signdef = table.copy(minetest.registered_nodes["default:sign_wall"])
signdef.description = "Unprotected Sign"
signdef.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_node("landrush:unlocked_sign", signdef)
minetest.register_craft({
output = 'landrush:unlocked_sign 6',
recipe = {
{'default:wood','default:wood','default:wood'},
{'default:wood','default:wood','landrush:landclaim'},
{'','default:stick',''}
}
})