From 335d9a3eddcb590c3ca5de9cba9b152e5e560af1 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 13 Feb 2018 14:05:34 -0500 Subject: removed boost_cart and carbone_mobs -- too many crashes updated blox, homedecor, plantlifed, cottages, farming_redo, framedglass, gloopblocks, mesecons, moreblocks, moretrees, pipeworks, player_textures, replacer, signs_lib, stained_glass, technic, travelnet, unified_inventory, unifieddyes, and worldedit. --- travelnet/travelnet.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'travelnet/travelnet.lua') diff --git a/travelnet/travelnet.lua b/travelnet/travelnet.lua index 5d6f284..aee7f64 100644 --- a/travelnet/travelnet.lua +++ b/travelnet/travelnet.lua @@ -2,10 +2,12 @@ -- further travelnets can only be installed by the owner or by people with the travelnet_attach priv -- digging of such a travelnet is limited to the owner and to people with the travelnet_remove priv (useful for admins to clean up) -- (this can be overrided in config.lua) --- Autor: Sokomine +-- Author: Sokomine +local S = travelnet.S; + minetest.register_node("travelnet:travelnet", { - description = "Travelnet box", + description = S("Travelnet-Box"), drawtype = "mesh", mesh = "travelnet.obj", @@ -52,22 +54,15 @@ minetest.register_node("travelnet:travelnet", { after_place_node = function(pos, placer, itemstack) local meta = minetest.get_meta(pos); - meta:set_string("infotext", "Travelnet-box (unconfigured)"); - meta:set_string("station_name", ""); - meta:set_string("station_network",""); + travelnet.reset_formspec( meta ); meta:set_string("owner", placer:get_player_name() ); - -- request initinal data - meta:set_string("formspec", - "size[12,10]".. - "field[0.3,5.6;6,0.7;station_name;Name of this station:;]".. - "field[0.3,6.6;6,0.7;station_network;Assign to Network:;]".. - "field[0.3,7.6;6,0.7;owner_name;(optional) owned by:;]".. - "button_exit[6.3,6.2;1.7,0.7;station_set;Store]" ); end, on_receive_fields = travelnet.on_receive_fields, on_punch = function(pos, node, puncher) - travelnet.update_formspec(pos, puncher:get_player_name()) + if( not( travelnet.check_if_trying_to_dig( puncher, node ))) then + travelnet.update_formspec(pos, puncher:get_player_name(), nil) + end end, can_dig = function( pos, player ) @@ -78,13 +73,17 @@ minetest.register_node("travelnet:travelnet", { travelnet.remove_box( pos, oldnode, oldmetadata, digger ) end, + -- TNT and overenthusiastic DMs do not destroy travelnets + on_blast = function(pos, intensity) + end, + -- taken from VanessaEs homedecor fridge on_place = function(itemstack, placer, pointed_thing) local pos = pointed_thing.above; if( minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" ) then - minetest.chat_send_player( placer:get_player_name(), 'Not enough vertical space to place the travelnet box!' ) + minetest.chat_send_player( placer:get_player_name(), S('Not enough vertical space to place the travelnet box!')) return; end return minetest.item_place(itemstack, placer, pointed_thing); -- cgit v1.2.3