diff --git a/init.lua b/init.lua index 11d2e33..f71c750 100644 --- a/init.lua +++ b/init.lua @@ -35,7 +35,8 @@ computers.execute_oscommand = function(cmdline, pos, player) local message = command..": command not found" local continue = false - print("pass command to computer : "..command) + --DEBUG info: + --print("pass command to computer : "..command) if computers.registered_commands[command] then local func = computers.registered_commands[command].exe if func then diff --git a/os.lua b/os.lua index 638912d..b1cfec5 100644 --- a/os.lua +++ b/os.lua @@ -170,12 +170,12 @@ end) -- funtion called when a "computers:laptop_connect" receive a field computers.oscommand_com_main = function(pos, formname, fields, sender) --get remote coordinates - local meta = minetest.env:get_meta(pos) + local meta = minetest.get_meta(pos) local remote_pos = {} remote_pos.x, remote_pos.y, remote_pos.z = string.match(meta:get_string("destination"), "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$") - local self = minetest.env:get_node(pos) - local node = minetest.env:get_node(remote_pos) + local self = minetest.get_node(pos) + local node = minetest.get_node(remote_pos) if fields.text == nil then return @@ -195,7 +195,7 @@ computers.oscommand_com_main = function(pos, formname, fields, sender) minetest.add_node(remote_pos, node) --set remote metadata - meta = minetest.env:get_meta(remote_pos) + meta = minetest.get_meta(remote_pos) meta:set_string("formspec", "field[text;;${text}]") meta:set_string("infotext", "END OF LINE\n* * * connection closed by remote host\n\n"..welcome_message) else @@ -235,4 +235,22 @@ function (cmdline, pos, player) print("[computers]: all computers restarted") return welcome_message, true -end) \ No newline at end of file +end) + + + +if technology ~= nil then + computers.register_oscommand("design", "generates a plan for the asked machine", "design [machin name]", + function (cmdline, pos, player) + local command, asked_name = string.match(cmdline, "^([^ ]+) *([^ ]+)") + + local plan = technology.registered_plans[asked_name] + if plan then + local inventory = player:get_inventory() + inventory:add_item("main", plan[1]) + return asked_name.." successfully computed.", true + else + return asked_name..": file not found.", false + end + end) +end diff --git a/textures/laptop_back.png b/textures/laptop_back.png old mode 100755 new mode 100644 diff --git a/textures/laptop_bottom.png b/textures/laptop_bottom.png old mode 100755 new mode 100644 diff --git a/textures/laptop_cover.png b/textures/laptop_cover.png old mode 100755 new mode 100644 diff --git a/textures/laptop_front_connect.png b/textures/laptop_front_connect.png old mode 100755 new mode 100644 diff --git a/textures/laptop_front_design.png b/textures/laptop_front_design.png new file mode 100644 index 0000000..e37306d Binary files /dev/null and b/textures/laptop_front_design.png differ diff --git a/textures/laptop_left.png b/textures/laptop_left.png old mode 100755 new mode 100644 diff --git a/textures/laptop_right.png b/textures/laptop_right.png old mode 100755 new mode 100644 diff --git a/textures/laptop_top.png b/textures/laptop_top.png old mode 100755 new mode 100644 diff --git a/textures/steel_armature_h_side.png b/textures/steel_armature_h_side.png deleted file mode 100755 index dc5f0b9..0000000 Binary files a/textures/steel_armature_h_side.png and /dev/null differ