From 93c28b1e6d7cd82c91bc8b8353837b5e88928f8c Mon Sep 17 00:00:00 2001 From: James David Clarke Date: Sun, 15 Oct 2023 15:56:36 +0100 Subject: [PATCH] Fixed some formatting issue --- src/items/motherboards/items.lua | 132 +++++++++++++++---------------- src/nodes/computer.lua | 28 +++---- 2 files changed, 79 insertions(+), 81 deletions(-) diff --git a/src/items/motherboards/items.lua b/src/items/motherboards/items.lua index 43c207c..7e4a96c 100644 --- a/src/items/motherboards/items.lua +++ b/src/items/motherboards/items.lua @@ -1,76 +1,76 @@ modular_computers.register_motherboard("tier_1", "Tier 1", nil, { { - {"default", "basic_materials"}, { - { - "default:steel_ingot", "basic_materials:copper_wire", - "default:steel_ingot" - }, { - "basic_materials:copper_wire", "basic_materials:ic", - "basic_materials:copper_wire" - }, - { - "default:steel_ingot", "basic_materials:copper_wire", - "default:steel_ingot" - } + { "default", "basic_materials" }, { + { + "default:steel_ingot", "basic_materials:copper_wire", + "default:steel_ingot" + }, { + "basic_materials:copper_wire", "basic_materials:ic", + "basic_materials:copper_wire" + }, + { + "default:steel_ingot", "basic_materials:copper_wire", + "default:steel_ingot" } + } }, { - {"default", "mesecons"}, { - { - "default:steel_ingot", "default:copper_ingot", - "default:steel_ingot" - }, { - "default:copper_ingot", - "mesecons_luacontroller:luacontroller0000", - "default:copper_ingot" - }, - { - "default:steel_ingot", "default:copper_ingot", - "default:steel_ingot" - } - } + { "default", "mesecons" }, { + { + "default:steel_ingot", "default:copper_ingot", + "default:steel_ingot" }, { - {"default"}, { - { - "default:steel_ingot", "default:steel_ingot", - "default:steel_ingot" - }, - { - "default:steel_ingot", "default:mese_crystal", - "default:steel_ingot" - }, - { - "default:steel_ingot", "default:steel_ingot", - "default:steel_ingot" - } - } + "default:copper_ingot", + "mesecons_luacontroller:luacontroller0000", + "default:copper_ingot" +}, + { + "default:steel_ingot", "default:copper_ingot", + "default:steel_ingot" + } +} +}, { + { "default" }, { + { + "default:steel_ingot", "default:steel_ingot", + "default:steel_ingot" + }, + { + "default:steel_ingot", "default:mese_crystal", + "default:steel_ingot" + }, + { + "default:steel_ingot", "default:steel_ingot", + "default:steel_ingot" + } +} +}, { + { "mcl_core" }, { + { + "mcl_core:iron_ingot", "mcl_copper:copper_ingot", + "mcl_core:iron_ingot" }, { - {"mcl_core"}, { - { - "mcl_core:iron_ingot", "mcl_copper:copper_ingot", - "mcl_core:iron_ingot" - }, { - "mcl_copper:copper_ingot", "mesecons_torch:redstoneblock", - "mcl_copper:copper_ingot" - }, - { - "mcl_core:iron_ingot", "mcl_copper:copper_ingot", - "mcl_core:iron_ingot" - } - } + "mcl_copper:copper_ingot", "mesecons_torch:redstoneblock", + "mcl_copper:copper_ingot" +}, + { + "mcl_core:iron_ingot", "mcl_copper:copper_ingot", + "mcl_core:iron_ingot" } +} +} }, function(id) return - "size[9,10]" .. "label[3.5,0;" .. modular_computers.S("Motherboard") .. - "]" .. "label[0,1;" .. modular_computers.S("CPU") .. "]" .. - "list[detached:modular_computers:motherboard_inventory_" .. id .. - ";cpu;3,1;1,1;]" .. "label[0,2;" .. modular_computers.S("GPU") .. - "]" .. "list[detached:modular_computers:motherboard_inventory_" .. - id .. ";gpu;3,2;1,1;]" .. "label[0,3;" .. - modular_computers.S("Hard Drive") .. "]" .. - "list[detached:modular_computers:motherboard_inventory_" .. id .. - ";hdd;3,3;1,1;]" .. "label[0,4;" .. modular_computers.S("USB") .. - "]" .. "list[detached:modular_computers:motherboard_inventory_" .. - id .. ";usb;3,4;1,1;]" .. "list[current_player;main;0,5;9,1;]" .. - "list[current_player;main;0,6.2;9,3;9]" .. "listring[]" - + "size[9,10]" .. + "label[3.5,0;" .. modular_computers.S("Motherboard") .. "]" .. + "label[0,1;" .. modular_computers.S("CPU") .. "]" .. + "list[detached:modular_computers:motherboard_inventory_" .. id .. ";cpu;3,1;1,1;]" .. + "label[0,2;" .. modular_computers.S("GPU") .. "]" .. + "list[detached:modular_computers:motherboard_inventory_" .. id .. ";gpu;3,2;1,1;]" .. + "label[0,3;" .. modular_computers.S("Hard Drive") .. "]" .. + "list[detached:modular_computers:motherboard_inventory_" .. id .. ";hdd;3,3;1,1;]" .. + "label[0,4;" .. modular_computers.S("USB") .. "]" .. + "list[detached:modular_computers:motherboard_inventory_" .. id .. ";usb;3,4;1,1;]" .. + "list[current_player;main;0,5;9,1;]" .. + "list[current_player;main;0,6.2;9,3;9]" .. + "listring[]" end, 1) diff --git a/src/nodes/computer.lua b/src/nodes/computer.lua index 6ba0199..fd033e2 100644 --- a/src/nodes/computer.lua +++ b/src/nodes/computer.lua @@ -8,14 +8,13 @@ local terminal_text = "" local function formspec(terminal_text) - return "size[16,10]" .. "textarea[0.5,0.5;15,8;terminal_out;" .. - modular_computers.S("Terminal") .. ":;" .. - minetest.formspec_escape(terminal_text) .. "]" .. - "button[6,9.5;4,1;execute;" .. modular_computers.S("Execute") .. - "]" .. "field_close_on_enter[terminal_out;false]" .. - "field_close_on_enter[terminal_in;false]" .. - "set_focus[terminal_in;true]" .. "field[0.5,9;15,1;terminal_in;" .. - modular_computers.S("Input Command") .. ":;]" + return "size[16,10]" .. + "textarea[0.5,0.5;15,8;terminal_out;" .. modular_computers.S("Terminal") .. ":;" .. minetest.formspec_escape(terminal_text) .. "]" .. + "button[6,9.5;4,1;execute;" .. modular_computers.S("Execute") .. "]" .. + "field_close_on_enter[terminal_out;false]" .. + "field_close_on_enter[terminal_in;false]" .. + "set_focus[terminal_in;true]" .. + "field[0.5,9;15,1;terminal_in;" .. modular_computers.S("Input Command") .. ":;]" end -- register the computer node @@ -65,11 +64,7 @@ minetest.register_on_player_receive_fields( local args = string.split(command, "%s+", false, -1, true) local def = modular_computers.registered_commands[args[1]] if def ~= nil then - local stdin, stdout, stderr, exit_code = def.func(player, - #args - 1, - unpack( - args, - 2)) + local stdin, stdout, stderr, exit_code = def.func(player,#args - 1,unpack(args,2)) if stderr ~= "" then terminal_text = terminal_text .. stderr elseif stdout ~= "" then @@ -113,9 +108,12 @@ if not stone or not core or not glass then modular_computers:err("could not find a crafting recipe") else minetest.register_craft({ - output = "computertest_redo:computer", + output = "modular_computers:computer", recipe = { - {stone, glass, stone}, {stone, core, stone}, {stone, stone, stone} + {stone, glass, stone}, + {stone, core, stone}, + {stone, stone, stone} } }) + modular_computers:act("registered crafting recipe") end