summaryrefslogtreecommitdiff
path: root/default.lua
diff options
context:
space:
mode:
authorBrandon Bohannon <brandon@bremaweb.com>2013-02-16 00:07:16 -0600
committerBrandon Bohannon <brandon@bremaweb.com>2013-02-16 00:07:16 -0600
commite83f5144665edafd80b5f99435cf12f66e37432d (patch)
tree1ff7d9dd7537d99980f4c57cbfe1a22900efea14 /default.lua
parent6537ff75ae31a13b5f9160127c484911477c0e6b (diff)
initial commit
Diffstat (limited to 'default.lua')
-rw-r--r--default.lua68
1 files changed, 68 insertions, 0 deletions
diff --git a/default.lua b/default.lua
new file mode 100644
index 0000000..6a074c5
--- /dev/null
+++ b/default.lua
@@ -0,0 +1,68 @@
+if minetest.get_modpath("default") then
+ if minetest.registered_items["default:mese_crystal"] then
+ minetest.register_craft({
+ output = 'landrush:landclaim_b',
+ recipe = {
+ {'default:cobble','default:mese_crystal','default:cobble'},
+ {'default:cobble','default:desert_stone','default:cobble'},
+ {'default:cobble','default:stone','default:cobble'}
+ }
+ })
+ minetest.register_alias("landclaim", "landrush:landclaim_b")
+ --minetest.registered_items["landrush:landclaim_b"].groups.not_in_creative_inventory = nil
+ else
+ minetest.register_craft({
+ output = 'landrush:landclaim',
+ recipe = {
+ {'default:cobble','default:cobble','default:cobble'},
+ {'default:cobble','default:mese','default:cobble'},
+ {'default:cobble','default:cobble','default:cobble'}
+ }
+ })
+ minetest.register_alias("landclaim", "landrush:landclaim")
+ minetest.registered_items["landrush:landclaim"].groups.not_in_creative_inventory = nil
+ end
+
+ minetest.register_node(":default:sign_wall", {
+ description = "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},
+ 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", "\"\"")
+ end,
+ on_receive_fields = function(pos, formname, fields, sender)
+ --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
+ local name = sender:get_player_name()
+ if landrush.can_interact(name, pos) then
+ local meta = minetest.env:get_meta(pos)
+ fields.text = fields.text or ""
+ print((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..'"')
+ else
+ local owner = landrush.get_owner(pos)
+ minetest.chat_send_player(name, "Area owned by "..owner)
+ end
+ end,
+ })
+end
+