From fc1407feff1bf6875b4cd052d748efa04cf7cac8 Mon Sep 17 00:00:00 2001 From: CrazyladMT <247920740+CrazyladMT@users.noreply.github.com> Date: Thu, 19 Feb 2026 23:02:56 -0500 Subject: [PATCH] remove whitespaces (#12) --- mods/game/chatcommands/init.lua | 2 +- mods/game/functions/init.lua | 58 ++++++++++++++-------------- mods/game/main/init.lua | 15 +++---- mods/game/maps/init.lua | 7 ++-- mods/game/maps/maps/1v1/map.lua | 14 +++---- mods/game/maps/maps/forest-2/map.lua | 8 ++-- mods/game/maps/maps/forest-3/map.lua | 8 ++-- mods/game/maps/maps/forest-4/map.lua | 30 +++++++------- mods/game/maps/maps/forest/map.lua | 12 +++--- mods/game/maps/maps/mini-map/map.lua | 14 +++---- mods/game/maps/maps/pine/map.lua | 6 +-- mods/game/maps/maps/savanna/map.lua | 6 +-- 12 files changed, 90 insertions(+), 90 deletions(-) diff --git a/mods/game/chatcommands/init.lua b/mods/game/chatcommands/init.lua index 5286ec7..0450050 100644 --- a/mods/game/chatcommands/init.lua +++ b/mods/game/chatcommands/init.lua @@ -12,7 +12,7 @@ core.register_chatcommand("start", { if match_state == "pre_match" or match_state == "post_match" or match_state == "in_progress" then return false, "-!- Match is already in progress!" end - + local sucess = start_match(param) if not map_data then diff --git a/mods/game/functions/init.lua b/mods/game/functions/init.lua index 1e255c3..c8b7a5f 100644 --- a/mods/game/functions/init.lua +++ b/mods/game/functions/init.lua @@ -25,7 +25,7 @@ function give_player_items(player) -- Give the player their initial stuff for i = 1, #map_data.classes.class_2.initial_items do inv:add_item("main", map_data.classes.class_2.initial_items[i]) end - + elseif class == "3" then for i = 1, #map_data.classes.class_3.initial_items do inv:add_item("main", map_data.classes.class_3.initial_items[i]) @@ -50,17 +50,18 @@ function set_player_mode(player, mode) -- Set player mode (spectator, pre-match, playertag.set(player, playertag.TYPE_ENTITY, {a = 255, r = 255, g = 255, b = 255}) player:set_inventory_formspec([[ - size[8,4] - list[current_player;main;0,0;8,1;] - list[current_player;main;0,1.25;8,3;8] - listring[current_player;main] + size[8,4] + list[current_player;main;0,0;8,1;] + list[current_player;main;0,1.25;8,3;8] + listring[current_player;main] ]]) player:hud_set_flags({ hotbar = true, healthbar = true, breathbar = true, - }) + }) + elseif mode == "spectator" then privs.noclip, privs.fast, privs.fly, privs.interact, privs.debug = true, true, true, false, true @@ -69,10 +70,10 @@ function set_player_mode(player, mode) -- Set player mode (spectator, pre-match, core.chat_send_player(player_name, core.colorize("#0574fc", "You are now a spectator.")) player:set_inventory_formspec([[ - size[8,4] - list[current_player;main;0,0;8,1;] - list[current_player;main;0,1.25;8,3;8] - listring[current_player;main] + size[8,4] + list[current_player;main;0,0;8,1;] + list[current_player;main;0,1.25;8,3;8] + listring[current_player;main] ]]) player:hud_set_flags({ @@ -87,17 +88,17 @@ function set_player_mode(player, mode) -- Set player mode (spectator, pre-match, make_player_invisible(player) player:set_inventory_formspec([[ - size[8,6] + size[8,6] label[3,0.1;Change class:] - button[0.3,1;2.5,1;class_sniper;]] .. map_data.classes.class_1.name .. [[] + button[0.3,1;2.5,1;class_sniper;]] .. map_data.classes.class_1.name .. [[] button[2.8,1;2.5,1;class_assault;]] .. map_data.classes.class_2.name .. [[] button[5.3,1;2.5,1;class_shotgun;]] .. map_data.classes.class_3.name .. [[] - list[current_player;main;0,2;8,1;] - list[current_player;main;0,3.25;8,3;8] - listring[current_player;main] + list[current_player;main;0,2;8,1;] + list[current_player;main;0,3.25;8,3;8] + listring[current_player;main] ]]) player:hud_set_flags({ @@ -122,11 +123,11 @@ function start_match(map) -- Start the match end set_match_state("pre_match") - + local map_loading_images = {} for _, player in pairs(core.get_connected_players()) do set_player_mode(player, "pre_match") - + map_loading_images[player:get_player_name()] = player:hud_add({ type = "image", position = {x=0.5, y=0.5}, @@ -142,16 +143,16 @@ function start_match(map) -- Start the match player:set_hp(20) end - + core.after(3, function() for _, player in pairs(core.get_connected_players()) do player:set_pos({x = map_data.spawn_x, y = map_data.spawn_y, z = map_data.spawn_z}) player:hud_remove(map_loading_images[player:get_player_name()]) end - + assert(loadstring(map_data.scripts.on_start or ""))() - + core.chat_send_all(core.colorize("#b011f9", string.format("Match about to start in %d seconds!\nOpen inventory to change class!", map_data.start_time))) for i = 10, 1, -1 do -- count down from 10 to 1 (yes you are free to set me on fire for this horrible solution) @@ -163,7 +164,7 @@ function start_match(map) -- Start the match core.after(map_data.start_time, function() set_match_state("in_progress") core.chat_send_all(core.colorize("green", "Match started!")) - + remove_barrier() alive_players = {} @@ -195,13 +196,12 @@ function end_match() -- End the match player:get_inventory():set_list("main", {}) player:set_inventory_formspec([[ - size[8,4] - list[current_player;main;0,0;8,1;] - list[current_player;main;0,1.25;8,3;8] - listring[current_player;main] + size[8,4] + list[current_player;main;0,0;8,1;] + list[current_player;main;0,1.25;8,3;8] + listring[current_player;main] ]]) - player:set_properties({pointable = false}) set_player_mode(player, "normal") @@ -221,11 +221,11 @@ function save_player_data(player) -- Save the player's skin storing it in their if skins[1] == "blank.png" then return end - + player:get_meta():set_string("skin", core.serialize(skins)) end -function load_player_data(player) -- Load the player's skin stored in their metadata +function load_player_data(player) -- Load the player's skin stored in their metadata local skins = core.deserialize(player:get_meta():get_string("skin")) player:set_properties({ @@ -250,7 +250,7 @@ function kill_player(player, reason) -- Handle killed/disconnected players prope if #alive_player_names == 1 then local winner_name = alive_player_names[1] core.chat_send_all(core.colorize("green", winner_name .. " is the winner!")) - + assert(loadstring(map_data.scripts.on_end or ""))() set_match_state("post_match") diff --git a/mods/game/main/init.lua b/mods/game/main/init.lua index 5ef686e..a35df06 100644 --- a/mods/game/main/init.lua +++ b/mods/game/main/init.lua @@ -38,11 +38,12 @@ core.register_on_joinplayer(function(player) player:get_inventory():set_list("main", {}) player:set_inventory_formspec([[ - size[8,4] - list[current_player;main;0,0;8,1;] - list[current_player;main;0,1.25;8,3;8] - listring[current_player;main] + size[8,4] + list[current_player;main;0,0;8,1;] + list[current_player;main;0,1.25;8,3;8] + listring[current_player;main] ]]) + player:set_properties({pointable = false}) player:hud_set_flags({ @@ -59,13 +60,13 @@ end) core.register_on_leaveplayer(function(player) local player_name = player:get_player_name() - + kill_player(player, "left the game") end) core.register_on_dieplayer(function(player) local player_name = player:get_player_name() - + kill_player(player, "died") end) @@ -77,7 +78,7 @@ core.register_on_respawnplayer(function(player) player:set_pos({x = map_data.spawn_x, y = map_data.spawn_y, z = map_data.spawn_z}) player:get_inventory():set_list("main", {}) - + player:set_properties({pointable = false}) end diff --git a/mods/game/maps/init.lua b/mods/game/maps/init.lua index 8ad4878..47b8d6d 100644 --- a/mods/game/maps/init.lua +++ b/mods/game/maps/init.lua @@ -13,13 +13,13 @@ function place_map(map) local map_data = dofile(map_path .. map .. "/map.lua") core.place_schematic({x=0, y=0, z=0}, map_path .. map .. "/map.mts", 0, nil, true) - + if map_data.spawn_x == nil or map_data.spawn_y == nil or map_data.spawn_z == nil then -- set a default spawnpoint if not set map_data.spawn_x = map_data.size_x / 2 map_data.spawn_y = map_data.barrier_level + 1 map_data.spawn_z = map_data.size_z / 2 end - + if map_data.start_time == nil or map_data.start_time <= 0 then map_data.start_time = 30 end @@ -30,7 +30,7 @@ function place_map(map) map_data.classes.class_2 = {} map_data.classes.class_3 = {} end - + if map_data.classes.class_1.initial_items == nil or map_data.classes.class_1.name == nil then map_data.classes.class_1.initial_items = {"ctf_ranged:m200_loaded", "default:sword_stone", "ctf_ranged:ammo 99"} map_data.classes.class_1.name = "Long-range" @@ -46,7 +46,6 @@ function place_map(map) map_data.classes.class_3.name = "Short-range" end - return map_data end diff --git a/mods/game/maps/maps/1v1/map.lua b/mods/game/maps/maps/1v1/map.lua index d2af823..774d2ea 100644 --- a/mods/game/maps/maps/1v1/map.lua +++ b/mods/game/maps/maps/1v1/map.lua @@ -3,20 +3,20 @@ local map_data = { size_x = 41, size_y = 31, size_z = 38, - + barrier_level = 27, - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 15, - scripts = { + scripts = { on_start = "for x=0, 40 do\nfor y=0, 17 do\nfor z=0, 37 do\ncore.set_node({x=x,y=31+y,z=z}, {name=\"default:glass\"})\nend\nend\nend", - on_barrier_remove = "", - on_end = "" - } + on_barrier_remove = "", + on_end = "" + } } return map_data diff --git a/mods/game/maps/maps/forest-2/map.lua b/mods/game/maps/maps/forest-2/map.lua index 6022078..19f8e40 100644 --- a/mods/game/maps/maps/forest-2/map.lua +++ b/mods/game/maps/maps/forest-2/map.lua @@ -3,15 +3,15 @@ local map_data = { size_x = 189, size_y = 71, size_z = 102, - + barrier_level = 67, -- <- Y level of the barrier - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 45, - + scripts = { -- "temporary" hack to ensure there's nothing on top of the map on_start = "for x=0, 188 do\nfor y=0, 4 do\nfor z=0, 101 do\ncore.set_node({x=x,y=71+y,z=z}, {name=\"air\"})\nend\nend\nend", on_barrier_remove = "", diff --git a/mods/game/maps/maps/forest-3/map.lua b/mods/game/maps/maps/forest-3/map.lua index 4b90dd2..ccae2b2 100644 --- a/mods/game/maps/maps/forest-3/map.lua +++ b/mods/game/maps/maps/forest-3/map.lua @@ -3,15 +3,15 @@ local map_data = { size_x = 537, size_y = 117, size_z = 244, - + barrier_level = 113, -- <- Y level of the barrier - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 60, - + scripts = { on_start = "", on_barrier_remove = "", diff --git a/mods/game/maps/maps/forest-4/map.lua b/mods/game/maps/maps/forest-4/map.lua index aaaf5ac..900bceb 100644 --- a/mods/game/maps/maps/forest-4/map.lua +++ b/mods/game/maps/maps/forest-4/map.lua @@ -1,26 +1,26 @@ local map_data = { - name = "forest-4", - size_x = 190, - size_y = 69, - size_z = 155, + name = "forest-4", + size_x = 190, + size_y = 69, + size_z = 155, - barrier_level = 65, + barrier_level = 65, - spawn_x = nil, - spawn_y = nil, - spawn_z = nil, + spawn_x = nil, + spawn_y = nil, + spawn_z = nil, - start_time = 30, + start_time = 30, - scripts = { - on_start = "for x=0, 189 do\nfor y=0, 10 do\nfor z=0, 154 do\ncore.set_node({x=x,y=69+y,z=z}, {name=\"air\"})\nend\nend\nend", - on_barrier_remove = "", - on_end = "" - }, + scripts = { + on_start = "for x=0, 189 do\nfor y=0, 10 do\nfor z=0, 154 do\ncore.set_node({x=x,y=69+y,z=z}, {name=\"air\"})\nend\nend\nend", + on_barrier_remove = "", + on_end = "" + }, classes = { class_1 = { - name = "Long-range", + name = "Long-range", initial_items = {"ctf_ranged:m200_loaded", "default:sword_stone", "ctf_ranged:ammo 99", "default:torch 1"} }, diff --git a/mods/game/maps/maps/forest/map.lua b/mods/game/maps/maps/forest/map.lua index ffbbfcf..a7854f3 100644 --- a/mods/game/maps/maps/forest/map.lua +++ b/mods/game/maps/maps/forest/map.lua @@ -3,16 +3,16 @@ local map_data = { size_x = 155, size_y = 53, size_z = 147, - + barrier_level = 49, -- <- Y level of the barrier - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 30, - - scripts = { -- "temporary" hack to ensure there's nothing on top of the map + + scripts = { -- "temporary" hack to ensure there's nothing on top of the map on_start = "for x=0, 154 do\nfor y=0, 16 do\nfor z=0, 146 do\ncore.set_node({x=x,y=53+y,z=z}, {name=\"air\"})\nend\nend\nend", on_barrier_remove = "", on_end = "" @@ -20,7 +20,7 @@ local map_data = { classes = { class_1 = { - name = "Long-range", + name = "Long-range", initial_items = {"ctf_ranged:m200_loaded", "default:sword_stone", "ctf_ranged:ammo 99", "default:torch 1"} }, diff --git a/mods/game/maps/maps/mini-map/map.lua b/mods/game/maps/maps/mini-map/map.lua index 13b431b..7e72ce6 100644 --- a/mods/game/maps/maps/mini-map/map.lua +++ b/mods/game/maps/maps/mini-map/map.lua @@ -3,20 +3,20 @@ local map_data = { size_x = 8, size_y = 19, size_z = 8, - + barrier_level = 15, - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 15, - scripts = { + scripts = { on_start = "", - on_barrier_remove = "", - on_end = "" - } + on_barrier_remove = "", + on_end = "" + } } return map_data diff --git a/mods/game/maps/maps/pine/map.lua b/mods/game/maps/maps/pine/map.lua index 108fbb1..20d0a4e 100644 --- a/mods/game/maps/maps/pine/map.lua +++ b/mods/game/maps/maps/pine/map.lua @@ -3,13 +3,13 @@ local map_data = { size_x = 111, size_y = 64, size_z = 107, - + barrier_level = 60, -- <- Y level of the barrier - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 30, scripts = { diff --git a/mods/game/maps/maps/savanna/map.lua b/mods/game/maps/maps/savanna/map.lua index 1bb8814..b2f1dbb 100644 --- a/mods/game/maps/maps/savanna/map.lua +++ b/mods/game/maps/maps/savanna/map.lua @@ -3,13 +3,13 @@ local map_data = { size_x = 341, size_y = 83, size_z = 188, - + barrier_level = 79, -- <- Y level of the barrier - + spawn_x = nil, spawn_y = nil, spawn_z = nil, - + start_time = 45, scripts = {