1234567891011121314151617181920212223242526272829 |
- minetest.register_node('teleport:test', {
- description = 'Test teleport node',
- tiles = {'teleport_test.png'},
- floodable = true,
- groups = {oddly_breakable_by_hand=3},
- after_place_node = function(pos, placer)
- local player_name = placer:get_player_name()
- local meta = minetest.get_meta(pos)
- meta:set_string('infotext', 'Unconfigured station')
- meta:set_string('owner', player_name)
- local key = minetest.pos_to_string(pos)
- local data_table = {}
- data_table.owner = player_name
- data_table.name = 'Unconfigured station'
- data_table.desc = ''
- teleport.data[key] = data_table
- end,
- after_destruct = function(pos)
- local key = minetest.pos_to_string(pos)
- teleport.data[key] = nil
- end,
- on_rightclick = function(pos, node, clicker)
- local name = clicker:get_player_name()
- teleport.find_stations()
- teleport.local_pos[name] = pos
- minetest.show_formspec(name, 'teleport:formspec', teleport.formspec_overview(pos, name))
- end,
- })
|