From 8f30e223e2d45c4ead2237196c13446d6b9cb1e3 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Tue, 16 Mar 2021 17:39:06 +0100 Subject: [PATCH] I hate reverting something xD --- mods/ITEMS/REDSTONE/mesecons/actionqueue.lua | 2 +- mods/ITEMS/REDSTONE/mesecons/init.lua | 4 ++-- mods/ITEMS/mcl_core/functions.lua | 2 +- mods/ITEMS/mcl_enchanting/init.lua | 4 ++-- mods/ITEMS/mcl_end/chorus_plant.lua | 2 +- mods/ITEMS/mcl_hoppers/init.lua | 2 +- mods/ITEMS/mcl_mobspawners/init.lua | 2 +- mods/ITEMS/mcl_portals/portal_end.lua | 2 +- mods/ITEMS/mcl_portals/portal_nether.lua | 4 ++-- mods/ITEMS/mcl_potions/functions.lua | 2 +- mods/MAPGEN/tsm_railcorridors/init.lua | 2 +- mods/PLAYER/mcl_hunger/init.lua | 2 +- mods/PLAYER/mcl_player/init.lua | 2 +- mods/PLAYER/mcl_playerinfo/init.lua | 2 +- mods/PLAYER/mcl_playerplus/init.lua | 4 ++-- mods/PLAYER/wieldview/init.lua | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua b/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua index f3479ce59..eabe73d1a 100644 --- a/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua +++ b/mods/ITEMS/REDSTONE/mesecons/actionqueue.lua @@ -22,7 +22,7 @@ function mesecon.queue:add_action(pos, func, params, time, overwritecheck, prior local toremove = nil -- Otherwise, add the action to the queue if overwritecheck then -- check if old action has to be overwritten / removed: - for i, ac in ipairs(mesecon.queue.actions) do + for i, ac in pairs(mesecon.queue.actions) do if(vector.equals(pos, ac.pos) and mesecon.cmpAny(overwritecheck, ac.owcheck)) then toremove = i diff --git a/mods/ITEMS/REDSTONE/mesecons/init.lua b/mods/ITEMS/REDSTONE/mesecons/init.lua index 93d299f06..18965287e 100644 --- a/mods/ITEMS/REDSTONE/mesecons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons/init.lua @@ -75,10 +75,10 @@ mesecon.queue:add_function("receptor_on", function (pos, rules) rules = rules or mesecon.rules.default -- Call turnon on all linking positions - for _, rule in ipairs(mesecon.flattenrules(rules)) do + for _, rule in pairs(mesecon.flattenrules(rules)) do local np = vector.add(pos, rule) local rulenames = mesecon.rules_link_rule_all(pos, rule) - for _, rulename in ipairs(rulenames) do + for _, rulename in pairs(rulenames) do mesecon.turnon(np, rulename) end end diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 3d47336f3..0c25de94f 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -1378,7 +1378,7 @@ minetest.register_abm({ if not do_preserve then -- Drop stuff other than the node itself local itemstacks = minetest.get_node_drops(n0.name) - for _, itemname in ipairs(itemstacks) do + for _, itemname in pairs(itemstacks) do local p_drop = { x = p0.x - 0.5 + math.random(), y = p0.y - 0.5 + math.random(), diff --git a/mods/ITEMS/mcl_enchanting/init.lua b/mods/ITEMS/mcl_enchanting/init.lua index a53350a70..4918e3776 100644 --- a/mods/ITEMS/mcl_enchanting/init.lua +++ b/mods/ITEMS/mcl_enchanting/init.lua @@ -191,7 +191,7 @@ minetest.register_entity("mcl_enchanting:book", { local old_player_near = self._player_near local player_near = false local player - for _, obj in ipairs(minetest.get_objects_inside_radius(vector.subtract(self.object:get_pos(), mcl_enchanting.book_offset), 2.5)) do + for _, obj in pairs(minetest.get_objects_inside_radius(vector.subtract(self.object:get_pos(), mcl_enchanting.book_offset), 2.5)) do if obj:is_player() then player_near = true player = obj @@ -308,7 +308,7 @@ minetest.register_abm({ nodenames = "mcl_enchanting:table", action = function(pos) local playernames = {} - for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 15)) do + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 15)) do if obj:is_player() then table.insert(playernames, obj:get_player_name()) end diff --git a/mods/ITEMS/mcl_end/chorus_plant.lua b/mods/ITEMS/mcl_end/chorus_plant.lua index 1363debf7..9622e618f 100644 --- a/mods/ITEMS/mcl_end/chorus_plant.lua +++ b/mods/ITEMS/mcl_end/chorus_plant.lua @@ -419,7 +419,7 @@ mcl_end.grow_chorus_plant_step = function(pos, node) end end - for _, f in ipairs(new_flowers) do + for _, f in pairs(new_flowers) do if age >= MAX_FLOWER_AGE then local nn = minetest.get_node(f).name if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 52cb60874..3ff549e4f 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -349,7 +349,7 @@ minetest.register_abm({ local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - for _,object in ipairs(minetest.get_objects_inside_radius(pos, 2)) do + for _,object in pairs(minetest.get_objects_inside_radius(pos, 2)) do if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then -- Item must get sucked in when the item just TOUCHES the block above the hopper diff --git a/mods/ITEMS/mcl_mobspawners/init.lua b/mods/ITEMS/mcl_mobspawners/init.lua index f12c893d9..d95395642 100644 --- a/mods/ITEMS/mcl_mobspawners/init.lua +++ b/mods/ITEMS/mcl_mobspawners/init.lua @@ -17,7 +17,7 @@ local function get_mob_textures(mob) end local function find_doll(pos) - for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 0.5)) do + for _,obj in pairs(minetest.get_objects_inside_radius(pos, 0.5)) do if not obj:is_player() then if obj ~= nil and obj:get_luaentity().name == "mcl_mobspawners:doll" then return obj diff --git a/mods/ITEMS/mcl_portals/portal_end.lua b/mods/ITEMS/mcl_portals/portal_end.lua index 045993530..0bc0ce57e 100644 --- a/mods/ITEMS/mcl_portals/portal_end.lua +++ b/mods/ITEMS/mcl_portals/portal_end.lua @@ -224,7 +224,7 @@ function mcl_portals.end_teleport(obj, pos) end function mcl_portals.end_portal_teleport(pos, node) - for _,obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do + for _,obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel if obj:is_player() or lua_entity then local objpos = obj:get_pos() diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 32a24e092..ff9df2b4d 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -798,7 +798,7 @@ minetest.register_abm({ end end distance = vector.subtract(pos, distance) - for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 15)) do + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 15)) do if obj:is_player() then minetest.add_particlespawner({ amount = node_particles_allowed_level + 1, @@ -818,7 +818,7 @@ minetest.register_abm({ }) end end - for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do --maikerumine added for objects to travel + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do --maikerumine added for objects to travel local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel if (obj:is_player() or lua_entity) and prevent_portal_chatter(obj) then teleport(obj, pos) diff --git a/mods/ITEMS/mcl_potions/functions.lua b/mods/ITEMS/mcl_potions/functions.lua index cd4939c2f..996637aa7 100644 --- a/mods/ITEMS/mcl_potions/functions.lua +++ b/mods/ITEMS/mcl_potions/functions.lua @@ -539,7 +539,7 @@ end) minetest.register_on_shutdown(function() -- save player effects on server shutdown - for _,player in ipairs(minetest.get_connected_players()) do + for _,player in pairs(minetest.get_connected_players()) do mcl_potions._save_player_effects(player) end diff --git a/mods/MAPGEN/tsm_railcorridors/init.lua b/mods/MAPGEN/tsm_railcorridors/init.lua index 982edcd0d..893f3d739 100644 --- a/mods/MAPGEN/tsm_railcorridors/init.lua +++ b/mods/MAPGEN/tsm_railcorridors/init.lua @@ -393,7 +393,7 @@ local function RecheckCartHack(params) local pos = params[1] local cart_id = params[2] -- Find cart - for _, obj in ipairs(minetest.get_objects_inside_radius(pos, 1)) do + for _, obj in pairs(minetest.get_objects_inside_radius(pos, 1)) do if obj ~= nil and obj:get_luaentity().name == cart_id then -- Cart found! We can now safely call the callback func. -- (calling it earlier has the danger of failing) diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 01d74a80d..5ae45591c 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -142,7 +142,7 @@ minetest.register_globalstep(function(dtime) timer = timer + dtime if main_timer > mcl_hunger.HUD_TICK or timer > 0.5 then if main_timer > mcl_hunger.HUD_TICK then main_timer = 0 end - for _,player in ipairs(minetest.get_connected_players()) do + for _,player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local h = tonumber(mcl_hunger.get_hunger(player)) diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 449b062c5..9e6790ea0 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -148,7 +148,7 @@ local player_attached = mcl_player.player_attached -- Check each player and apply animations minetest.register_globalstep(function(dtime) - for _, player in ipairs(minetest.get_connected_players()) do + for _, player in pairs(minetest.get_connected_players()) do local name = player:get_player_name() local model_name = player_model[name] local model = model_name and models[model_name] diff --git a/mods/PLAYER/mcl_playerinfo/init.lua b/mods/PLAYER/mcl_playerinfo/init.lua index 4c1454d95..5086f3195 100644 --- a/mods/PLAYER/mcl_playerinfo/init.lua +++ b/mods/PLAYER/mcl_playerinfo/init.lua @@ -52,7 +52,7 @@ minetest.register_globalstep(function(dtime) time = 0 -- check players - for _,player in ipairs(minetest.get_connected_players()) do + for _,player in pairs(minetest.get_connected_players()) do -- who am I? local name = player:get_player_name() diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index ab8487396..e376c0f0a 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -41,7 +41,7 @@ minetest.register_globalstep(function(dtime) -- Update jump status immediately since we need this info in real time. -- WARNING: This section is HACKY as hell since it is all just based on heuristics. - for _,player in ipairs(get_connected_players()) do + for _,player in pairs(get_connected_players()) do local controls = player:get_player_control() name = player:get_player_name() @@ -173,7 +173,7 @@ minetest.register_globalstep(function(dtime) time = 0 -- check players - for _,player in ipairs(get_connected_players()) do + for _,player in pairs(get_connected_players()) do -- who am I? local name = player:get_player_name() diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index 4514ca5e6..dea44b2a2 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -78,7 +78,7 @@ minetest.register_on_joinplayer(function(player) end) minetest.register_globalstep(function() - for _,player in ipairs(minetest.get_connected_players()) do + for _,player in pairs(minetest.get_connected_players()) do wieldview:update_wielded_item(player) end end)