I hate reverting something xD

This commit is contained in:
AFCMS 2021-03-16 17:39:06 +01:00
parent 5d17a6b699
commit 8f30e223e2
16 changed files with 20 additions and 20 deletions

@ -22,7 +22,7 @@ function mesecon.queue:add_action(pos, func, params, time, overwritecheck, prior
local toremove = nil local toremove = nil
-- Otherwise, add the action to the queue -- Otherwise, add the action to the queue
if overwritecheck then -- check if old action has to be overwritten / removed: 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) if(vector.equals(pos, ac.pos)
and mesecon.cmpAny(overwritecheck, ac.owcheck)) then and mesecon.cmpAny(overwritecheck, ac.owcheck)) then
toremove = i toremove = i

@ -75,10 +75,10 @@ mesecon.queue:add_function("receptor_on", function (pos, rules)
rules = rules or mesecon.rules.default rules = rules or mesecon.rules.default
-- Call turnon on all linking positions -- 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 np = vector.add(pos, rule)
local rulenames = mesecon.rules_link_rule_all(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) mesecon.turnon(np, rulename)
end end
end end

@ -1378,7 +1378,7 @@ minetest.register_abm({
if not do_preserve then if not do_preserve then
-- Drop stuff other than the node itself -- Drop stuff other than the node itself
local itemstacks = minetest.get_node_drops(n0.name) local itemstacks = minetest.get_node_drops(n0.name)
for _, itemname in ipairs(itemstacks) do for _, itemname in pairs(itemstacks) do
local p_drop = { local p_drop = {
x = p0.x - 0.5 + math.random(), x = p0.x - 0.5 + math.random(),
y = p0.y - 0.5 + math.random(), y = p0.y - 0.5 + math.random(),

@ -191,7 +191,7 @@ minetest.register_entity("mcl_enchanting:book", {
local old_player_near = self._player_near local old_player_near = self._player_near
local player_near = false local player_near = false
local player 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 if obj:is_player() then
player_near = true player_near = true
player = obj player = obj
@ -308,7 +308,7 @@ minetest.register_abm({
nodenames = "mcl_enchanting:table", nodenames = "mcl_enchanting:table",
action = function(pos) action = function(pos)
local playernames = {} 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 if obj:is_player() then
table.insert(playernames, obj:get_player_name()) table.insert(playernames, obj:get_player_name())
end end

@ -419,7 +419,7 @@ mcl_end.grow_chorus_plant_step = function(pos, node)
end end
end end
for _, f in ipairs(new_flowers) do for _, f in pairs(new_flowers) do
if age >= MAX_FLOWER_AGE then if age >= MAX_FLOWER_AGE then
local nn = minetest.get_node(f).name local nn = minetest.get_node(f).name
if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then

@ -349,7 +349,7 @@ minetest.register_abm({
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inv = meta:get_inventory() 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 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 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 -- Item must get sucked in when the item just TOUCHES the block above the hopper

@ -17,7 +17,7 @@ local function get_mob_textures(mob)
end end
local function find_doll(pos) 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 not obj:is_player() then
if obj ~= nil and obj:get_luaentity().name == "mcl_mobspawners:doll" then if obj ~= nil and obj:get_luaentity().name == "mcl_mobspawners:doll" then
return obj return obj

@ -224,7 +224,7 @@ function mcl_portals.end_teleport(obj, pos)
end end
function mcl_portals.end_portal_teleport(pos, node) 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 local lua_entity = obj:get_luaentity() --maikerumine added for objects to travel
if obj:is_player() or lua_entity then if obj:is_player() or lua_entity then
local objpos = obj:get_pos() local objpos = obj:get_pos()

@ -798,7 +798,7 @@ minetest.register_abm({
end end
end end
distance = vector.subtract(pos, distance) 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 if obj:is_player() then
minetest.add_particlespawner({ minetest.add_particlespawner({
amount = node_particles_allowed_level + 1, amount = node_particles_allowed_level + 1,
@ -818,7 +818,7 @@ minetest.register_abm({
}) })
end end
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 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 if (obj:is_player() or lua_entity) and prevent_portal_chatter(obj) then
teleport(obj, pos) teleport(obj, pos)

@ -539,7 +539,7 @@ end)
minetest.register_on_shutdown(function() minetest.register_on_shutdown(function()
-- save player effects on server shutdown -- 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) mcl_potions._save_player_effects(player)
end end

@ -393,7 +393,7 @@ local function RecheckCartHack(params)
local pos = params[1] local pos = params[1]
local cart_id = params[2] local cart_id = params[2]
-- Find cart -- 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 if obj ~= nil and obj:get_luaentity().name == cart_id then
-- Cart found! We can now safely call the callback func. -- Cart found! We can now safely call the callback func.
-- (calling it earlier has the danger of failing) -- (calling it earlier has the danger of failing)

@ -142,7 +142,7 @@ minetest.register_globalstep(function(dtime)
timer = timer + dtime timer = timer + dtime
if main_timer > mcl_hunger.HUD_TICK or timer > 0.5 then if main_timer > mcl_hunger.HUD_TICK or timer > 0.5 then
if main_timer > mcl_hunger.HUD_TICK then main_timer = 0 end 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 name = player:get_player_name()
local h = tonumber(mcl_hunger.get_hunger(player)) local h = tonumber(mcl_hunger.get_hunger(player))

@ -148,7 +148,7 @@ local player_attached = mcl_player.player_attached
-- Check each player and apply animations -- Check each player and apply animations
minetest.register_globalstep(function(dtime) 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 name = player:get_player_name()
local model_name = player_model[name] local model_name = player_model[name]
local model = model_name and models[model_name] local model = model_name and models[model_name]

@ -52,7 +52,7 @@ minetest.register_globalstep(function(dtime)
time = 0 time = 0
-- check players -- check players
for _,player in ipairs(minetest.get_connected_players()) do for _,player in pairs(minetest.get_connected_players()) do
-- who am I? -- who am I?
local name = player:get_player_name() local name = player:get_player_name()

@ -41,7 +41,7 @@ minetest.register_globalstep(function(dtime)
-- Update jump status immediately since we need this info in real time. -- 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. -- 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() local controls = player:get_player_control()
name = player:get_player_name() name = player:get_player_name()
@ -173,7 +173,7 @@ minetest.register_globalstep(function(dtime)
time = 0 time = 0
-- check players -- check players
for _,player in ipairs(get_connected_players()) do for _,player in pairs(get_connected_players()) do
-- who am I? -- who am I?
local name = player:get_player_name() local name = player:get_player_name()

@ -78,7 +78,7 @@ minetest.register_on_joinplayer(function(player)
end) end)
minetest.register_globalstep(function() 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) wieldview:update_wielded_item(player)
end end
end) end)