From 10f81dbf0cfdcf60a9a86888e6ba1ae37e15d752 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 18:41:10 +0200 Subject: [PATCH 1/5] Change max mcl_bossbars default to 5 (Minecraft value) --- settingtypes.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settingtypes.txt b/settingtypes.txt index bfda9b3ba..c5968a4c0 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -98,7 +98,7 @@ animated_chests (Animated chests) bool true 3d_player_preview (3D Player preview) bool true # The maximum number of boss bars to simultaniously display on the screen -max_bossbars (Maximum Boss bars) int 4 +max_bossbars (Maximum Boss bars) int 5 [Experimental] # Whether ice is translucent. If disabled, ice is fully opaque. From bd3c08d367fc454aecf9ddd6954d0a81cf2a9514 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 16 Apr 2021 19:50:56 +0200 Subject: [PATCH 2/5] Improve mcl_burning player performance --- mods/ENTITIES/mcl_burning/init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index 672036c78..6f1b0ef0d 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -15,7 +15,7 @@ minetest.register_entity("mcl_burning:fire", { pointable = false, glow = -1, }, - + animation_frame = 0, animation_timer = 0, on_step = mcl_burning.fire_entity_step, @@ -23,7 +23,9 @@ minetest.register_entity("mcl_burning:fire", { minetest.register_globalstep(function(dtime) for _, player in pairs(minetest.get_connected_players()) do - mcl_burning.tick(player, dtime) + if player:get_meta():get_float("mcl_burning:burn_time") > 0 then + mcl_burning.tick(player, dtime) + end end end) From 22a2fdbf5fca5bee14ac5ee23fa325610853ab37 Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sat, 17 Apr 2021 07:46:24 +0200 Subject: [PATCH 3/5] fix more codestyle --- mods/MAPGEN/mcl_structures/init.lua | 13 ++++++------- mods/MAPGEN/mcl_villages/buildings.lua | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mods/MAPGEN/mcl_structures/init.lua b/mods/MAPGEN/mcl_structures/init.lua index b7afd18bb..e3f6b4829 100644 --- a/mods/MAPGEN/mcl_structures/init.lua +++ b/mods/MAPGEN/mcl_structures/init.lua @@ -110,7 +110,8 @@ mcl_structures.generate_igloo = function(pos, rotation, pr) if r == 1 then -- Select basement depth local dim = mcl_worlds.pos_to_dimension(pos) - local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + --local buffer = pos.y - (mcl_vars.mg_lava_overworld_max + 10) + local buffer if dim == "nether" then buffer = pos.y - (mcl_vars.mg_lava_nether_max + 10) elseif dim == "end" then @@ -219,7 +220,7 @@ local function igloo_placement_callback(p1, p2, size, orientation, pr) else return end - local size = {x=9,y=5,z=7} + --local size = {x=9,y=5,z=7} local lootitems = mcl_loot.get_multi_loot({ { stacks_min = 1, @@ -335,7 +336,7 @@ local function shrine_placement_callback(p1, p2, size, rotation, pr) -- Find and setup spawner with silverfish local spawners = minetest.find_nodes_in_area(p1, p2, "mcl_mobspawners:spawner") for s=1, #spawners do - local meta = minetest.get_meta(spawners[s]) + --local meta = minetest.get_meta(spawners[s]) mcl_mobspawners.setup_spawner(spawners[s], "mobs_mc:silverfish") end @@ -411,7 +412,7 @@ end mcl_structures.generate_end_portal_shrine = function(pos, rotation, pr) local offset = {x=6, y=4, z=6} - local size = {x=13, y=8, z=13} + --local size = {x=13, y=8, z=13} local newpos = { x = pos.x - offset.x, y = pos.y, z = pos.z - offset.z } local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_end_portal_room_simple.mts" @@ -471,8 +472,6 @@ local function temple_placement_callback(p1, p2, size, rotation, pr) { itemstring = "mcl_mobitems:string", weight = 10, amount_min = 1, amount_max = 8 }, } }}, pr) - - local meta = minetest.get_meta(chests[c]) init_node_construct(chests[c]) local meta = minetest.get_meta(chests[c]) local inv = meta:get_inventory() @@ -498,7 +497,7 @@ mcl_structures.generate_desert_temple = function(pos, rotation, pr) -- No Generating for the temple ... Why using it ? No Change local path = minetest.get_modpath("mcl_structures").."/schematics/mcl_structures_desert_temple.mts" local newpos = {x=pos.x,y=pos.y-12,z=pos.z} - local size = {x=22, y=24, z=22} + --local size = {x=22, y=24, z=22} if newpos == nil then return end diff --git a/mods/MAPGEN/mcl_villages/buildings.lua b/mods/MAPGEN/mcl_villages/buildings.lua index e917638db..9d8e7580f 100644 --- a/mods/MAPGEN/mcl_villages/buildings.lua +++ b/mods/MAPGEN/mcl_villages/buildings.lua @@ -84,7 +84,7 @@ function settlements.create_site_plan(maxp, minp, pr) x=math.floor((minp.x+maxp.x)/2), y=maxp.y, z=math.floor((minp.z+maxp.z)/2) - } + } -- find center_surface of chunk local center_surface , surface_material = settlements.find_surface(center, true) local chunks = {} From 02f393998ff6893f958f9a9e5034f74ff35c9bad Mon Sep 17 00:00:00 2001 From: AFCMS Date: Sat, 17 Apr 2021 09:26:37 +0200 Subject: [PATCH 4/5] fix many warnings (644 remaining) --- .luacheckrc | 2 +- mods/ITEMS/mcl_potions/init.lua | 13 ++++--------- mods/ITEMS/mcl_potions/potions.lua | 4 ++-- mods/ITEMS/mcl_potions/splash.lua | 4 ++-- mods/ITEMS/mcl_potions/tipped_arrow.lua | 7 +++---- mods/ITEMS/mcl_signs/init.lua | 6 +++--- mods/ITEMS/mcl_stairs/api.lua | 6 ++++-- mods/ITEMS/mcl_throwing/register.lua | 2 +- mods/ITEMS/mcl_torches/api.lua | 2 +- mods/MAPGEN/mcl_dungeons/init.lua | 12 +++++------- mods/MAPGEN/mcl_mapgen_core/init.lua | 24 ++++++++++++------------ 11 files changed, 38 insertions(+), 44 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index f36a4a37b..556b2e8f0 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -12,7 +12,7 @@ read_globals = { "dump", "dump2", "vector", "VoxelManip", "VoxelArea", - "PseudoRandom", "PcgRandom", "PerlinNoise", + "PseudoRandom", "PcgRandom", "PerlinNoise", "PerlinNoiseMap", "ItemStack", "Settings", "unpack", diff --git a/mods/ITEMS/mcl_potions/init.lua b/mods/ITEMS/mcl_potions/init.lua index 65bb0d4de..6cfa0dc50 100644 --- a/mods/ITEMS/mcl_potions/init.lua +++ b/mods/ITEMS/mcl_potions/init.lua @@ -25,11 +25,9 @@ dofile(modpath .. "/lingering.lua") dofile(modpath .. "/tipped_arrow.lua") dofile(modpath .. "/potions.lua") -local brewhelp = S("Try different combinations to create potions.") - minetest.register_craftitem("mcl_potions:fermented_spider_eye", { description = S("Fermented Spider Eye"), - _doc_items_longdesc = brewhelp, + _doc_items_longdesc = S("Try different combinations to create potions."), wield_image = "mcl_potions_spider_eye_fermented.png", inventory_image = "mcl_potions_spider_eye_fermented.png", groups = { brewitem = 1, }, @@ -65,14 +63,12 @@ minetest.register_craftitem("mcl_potions:glass_bottle", { -- Try to fill glass bottle with water local get_water = false - local from_liquid_source = false + --local from_liquid_source = false local river_water = false - if not def then - -- Unknown node: no-op - elseif def.groups and def.groups.water and def.liquidtype == "source" then + if def and def.groups and def.groups.water and def.liquidtype == "source" then -- Water source get_water = true - from_liquid_source = true + --from_liquid_source = true river_water = node.name == "mclx_core:river_water_source" -- Or reduce water level of cauldron by 1 elseif string.sub(node.name, 1, 14) == "mcl_cauldrons:" then @@ -440,7 +436,6 @@ function mcl_potions.get_alchemy(ingr, pot) if brew_table[ingr] ~= nil then return brew_table[ingr] end - end if mod_table[ingr] ~= nil then diff --git a/mods/ITEMS/mcl_potions/potions.lua b/mods/ITEMS/mcl_potions/potions.lua index 4a82348e5..2d76a217b 100644 --- a/mods/ITEMS/mcl_potions/potions.lua +++ b/mods/ITEMS/mcl_potions/potions.lua @@ -1,5 +1,5 @@ local S = minetest.get_translator("mcl_potions") -local brewhelp = S("Try different combinations to create potions.") +--local brewhelp = S("Try different combinations to create potions.") local potion_image = function(colorstring, opacity) if not opacity then @@ -98,7 +98,7 @@ local function register_potion(def) end elseif def.name == "healing" or def.name == "harming" then _tt = S("@1 HP", effect) - else + else _tt = tt or time_string(dur) or S("No effect") end return _tt diff --git a/mods/ITEMS/mcl_potions/splash.lua b/mods/ITEMS/mcl_potions/splash.lua index bea07b8cf..f986134d6 100644 --- a/mods/ITEMS/mcl_potions/splash.lua +++ b/mods/ITEMS/mcl_potions/splash.lua @@ -123,6 +123,6 @@ function mcl_potions.register_splash(name, descr, color, def) }) end -local function time_string(dur) +--[[local function time_string(dur) return math.floor(dur/60)..string.format(":%02d",math.floor(dur % 60)) -end +end]] diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index 860019e8a..abeae8106 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -4,12 +4,12 @@ local ARROW_TIMEOUT = 60 -- Time after which stuck arrow is rechecked for being stuck local STUCK_RECHECK_TIME = 5 -local GRAVITY = 9.81 +--local GRAVITY = 9.81 local YAW_OFFSET = -math.pi/2 local dir_to_pitch = function(dir) - local dir2 = vector.normalize(dir) + --local dir2 = vector.normalize(dir) local xz = math.abs(dir.x) + math.abs(dir.z) return -math.atan2(-dir.y, xz) end @@ -197,7 +197,6 @@ function mcl_potions.register_arrow(name, desc, color, def) glow = 1, }) end - -- We just check for any hurtable objects nearby. -- The radius of 3 is fairly liberal, but anything lower than than will cause -- arrow to hilariously go through mobs often. @@ -360,7 +359,7 @@ function mcl_potions.register_arrow(name, desc, color, def) if not v then v = 0 end - local old_v = self._viscosity + --local old_v = self._viscosity self._viscosity = v local vpenalty = math.max(0.1, 0.98 - 0.1 * v) if math.abs(vel.x) > 0.001 then diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index e053c6e82..be9db2fee 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -93,7 +93,7 @@ local generate_line = function(s, ypos) local chars = 0 local printed_char_width = CHAR_WIDTH + 1 while chars < LINE_LENGTH and i <= #s do - local file = nil + local file -- Get and render character if charmap[s:sub(i, i)] ~= nil then file = charmap[s:sub(i, i)] @@ -185,7 +185,7 @@ local function get_wall_signtext_info(param2, nodename) end end -local sign_groups = {handy=1,axey=1, flammable=1, deco_block=1, material_wood=1, attached_node=1, dig_by_piston=1, flammable=-1} +local sign_groups = {handy=1,axey=1, deco_block=1, material_wood=1, attached_node=1, dig_by_piston=1, flammable=-1} local destruct_sign = function(pos) local objects = minetest.get_objects_inside_radius(pos, 0.5) @@ -322,7 +322,7 @@ minetest.register_node("mcl_signs:wall_sign", { local wdir = minetest.dir_to_wallmounted(dir) - local placer_pos = placer:get_pos() + --local placer_pos = placer:get_pos() local fdir = minetest.dir_to_facedir(dir) diff --git a/mods/ITEMS/mcl_stairs/api.lua b/mods/ITEMS/mcl_stairs/api.lua index aecf10836..cca54226f 100644 --- a/mods/ITEMS/mcl_stairs/api.lua +++ b/mods/ITEMS/mcl_stairs/api.lua @@ -20,7 +20,7 @@ local function place_slab_normal(itemstack, placer, pointed_thing) local p0 = pointed_thing.under local p1 = pointed_thing.above - local placer_pos = placer:get_pos() + --local placer_pos = placer:get_pos() local fpos = get_fpos(placer, pointed_thing) @@ -179,7 +179,7 @@ end -- Slab facedir to placement 6d matching table -local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} +--local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} -- Register slabs. -- Node will be called mcl_stairs:slab_ @@ -268,6 +268,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti end end, _mcl_hardness = hardness, + _mcl_blast_resistance = blast_resistance, _mcl_other_slab_half = upper_slab, on_rotate = function(pos, node, user, mode, param2) -- Flip slab @@ -331,6 +332,7 @@ function mcl_stairs.register_slab(subname, recipeitem, groups, images, descripti sounds = sounds, drop = lower_slab .. " 2", _mcl_hardness = hardness, + _mcl_blast_resistance = blast_resistance, }) if recipeitem then diff --git a/mods/ITEMS/mcl_throwing/register.lua b/mods/ITEMS/mcl_throwing/register.lua index 3d8cc94cf..c2af9717f 100644 --- a/mods/ITEMS/mcl_throwing/register.lua +++ b/mods/ITEMS/mcl_throwing/register.lua @@ -224,7 +224,7 @@ local pearl_on_step = function(self, dtime) lv, ld = math.abs(vc.x), "x" end if math.abs(vc.z) > lv then - lv, ld = math.abs(vc.z), "z" + ld = "z" --math.abs(vc.z) end if ld ~= "x" then vc.x = 0 end if ld ~= "y" then vc.y = 0 end diff --git a/mods/ITEMS/mcl_torches/api.lua b/mods/ITEMS/mcl_torches/api.lua index 304488805..c98bda3d9 100644 --- a/mods/ITEMS/mcl_torches/api.lua +++ b/mods/ITEMS/mcl_torches/api.lua @@ -30,7 +30,7 @@ local spawn_flames_floor = function(pos) end local spawn_flames_wall = function(pos) - local minrelpos, maxrelpos + --local minrelpos, maxrelpos local node = minetest.get_node(pos) local dir = minetest.wallmounted_to_dir(node.param2) diff --git a/mods/MAPGEN/mcl_dungeons/init.lua b/mods/MAPGEN/mcl_dungeons/init.lua index 928faaa11..58e23b12e 100644 --- a/mods/MAPGEN/mcl_dungeons/init.lua +++ b/mods/MAPGEN/mcl_dungeons/init.lua @@ -49,12 +49,12 @@ local dungeonsizes = { { x=7, y=4, z=7}, } -local dirs = { +--[[local dirs = { { x= 1, y=0, z= 0 }, { x= 0, y=0, z= 1 }, { x=-1, y=0, z= 0 }, { x= 0, y=0, z=-1 }, -} +}]] local surround_vectors = { { x=-1, y=0, z=0 }, @@ -66,7 +66,7 @@ local surround_vectors = { local function ecb_spawn_dungeon(blockpos, action, calls_remaining, param) if calls_remaining >= 1 then return end - local p1, p2, dim, pr = param.p1, param.p2, param.dim, param.pr + local p1, _, dim, pr = param.p1, param.p2, param.dim, param.pr local x, y, z = p1.x, p1.y, p1.z local check = not (param.dontcheck or false) @@ -404,8 +404,7 @@ local function dungeons_nodes(minp, maxp, blockseed) local p1 = {x=x,y=y,z=z} local p2 = {x = x+dim.x+1, y = y+dim.y+1, z = z+dim.z+1} minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - local param = {p1=p1, p2=p2, dim=dim, pr=pr} - emerge_area(p1, p2, ecb_spawn_dungeon, param) + emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr}) end end @@ -414,8 +413,7 @@ function mcl_dungeons.spawn_dungeon(p1, _, pr) local dim = dungeonsizes[pr:next(1, #dungeonsizes)] local p2 = {x = p1.x+dim.x+1, y = p1.y+dim.y+1, z = p1.z+dim.z+1} minetest.log("verbose","[mcl_dungeons] size=" ..minetest.pos_to_string(dim) .. ", emerge from "..minetest.pos_to_string(p1) .. " to " .. minetest.pos_to_string(p2)) - local param = {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true} - emerge_area(p1, p2, ecb_spawn_dungeon, param) + emerge_area(p1, p2, ecb_spawn_dungeon, {p1=p1, p2=p2, dim=dim, pr=pr, dontcheck=true}) end mcl_mapgen_core.register_generator("dungeons", nil, dungeons_nodes, 999999) diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 1ee861e4a..90b272506 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -65,21 +65,21 @@ local c_dirt = minetest.get_content_id("mcl_core:dirt") local c_dirt_with_grass = minetest.get_content_id("mcl_core:dirt_with_grass") local c_dirt_with_grass_snow = minetest.get_content_id("mcl_core:dirt_with_grass_snow") local c_sand = minetest.get_content_id("mcl_core:sand") -local c_sandstone = minetest.get_content_id("mcl_core:sandstone") +--local c_sandstone = minetest.get_content_id("mcl_core:sandstone") local c_void = minetest.get_content_id("mcl_core:void") local c_lava = minetest.get_content_id("mcl_core:lava_source") local c_water = minetest.get_content_id("mcl_core:water_source") local c_soul_sand = minetest.get_content_id("mcl_nether:soul_sand") local c_netherrack = minetest.get_content_id("mcl_nether:netherrack") local c_nether_lava = minetest.get_content_id("mcl_nether:nether_lava_source") -local c_end_stone = minetest.get_content_id("mcl_end:end_stone") +--local c_end_stone = minetest.get_content_id("mcl_end:end_stone") local c_realm_barrier = minetest.get_content_id("mcl_core:realm_barrier") local c_top_snow = minetest.get_content_id("mcl_core:snow") local c_snow_block = minetest.get_content_id("mcl_core:snowblock") local c_clay = minetest.get_content_id("mcl_core:clay") local c_leaves = minetest.get_content_id("mcl_core:leaves") local c_jungleleaves = minetest.get_content_id("mcl_core:jungleleaves") -local c_jungletree = minetest.get_content_id("mcl_core:jungletree") +--local c_jungletree = minetest.get_content_id("mcl_core:jungletree") local c_cocoa_1 = minetest.get_content_id("mcl_cocoas:cocoa_1") local c_cocoa_2 = minetest.get_content_id("mcl_cocoas:cocoa_2") local c_cocoa_3 = minetest.get_content_id("mcl_cocoas:cocoa_3") @@ -1169,13 +1169,13 @@ end -- minp and maxp (from an on_generated callback) and returns the real world coordinates -- as X, Z. -- Inverse function of xz_to_biomemap -local biomemap_to_xz = function(index, minp, maxp) +--[[local biomemap_to_xz = function(index, minp, maxp) local xwidth = maxp.x - minp.x + 1 local zwidth = maxp.z - minp.z + 1 local x = ((index-1) % xwidth) + minp.x local z = ((index-1) / zwidth) + minp.z return x, z -end +end]] -- Takes x and z coordinates and minp and maxp of a generated chunk -- (in on_generated callback) and returns a biomemap index) @@ -1897,7 +1897,7 @@ function mcl_mapgen_core.unregister_generator(id) local rec = registered_generators[id] registered_generators[id] = nil if rec.vf then lvm = lvm - 1 end - if rev.nf then nodes = nodes - 1 end + if rec.nf then nodes = nodes - 1 end if rec.needs_param2 then param2 = param2 - 1 end if rec.needs_level0 then level0 = level0 - 1 end end @@ -1979,7 +1979,7 @@ end -- Below the bedrock, generate air/void local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) - local biomemap, ymin, ymax + local biomemap --ymin, ymax local lvm_used = false local pr = PseudoRandom(blockseed) @@ -2077,7 +2077,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) local n = nodes[n] local p_pos = area:index(n.x, n.y, n.z) local p_pos_above = area:index(n.x, n.y+1, n.z) - local p_pos_below = area:index(n.x, n.y-1, n.z) + --local p_pos_below = area:index(n.x, n.y-1, n.z) local b_pos = aream:index(n.x, 0, n.z) local bn = minetest.get_biome_name(biomemap[b_pos]) if bn then @@ -2126,7 +2126,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) -- * Remove stone, sand, dirt in v6 so our End map generator works in v6. -- * Generate spawn platform (End portal destination) elseif minp.y <= mcl_vars.mg_end_max and maxp.y >= mcl_vars.mg_end_min then - local nodes, n + local nodes if mg_name == "v6" then nodes = minetest.find_nodes_in_area(emin, emax, {"mcl_core:water_source", "mcl_core:stone", "mcl_core:sand", "mcl_core:dirt"}) else @@ -2134,7 +2134,7 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) end if #nodes > 0 then lvm_used = true - for _, n in pairs(nodes) do + for _,n in pairs(nodes) do data[area:index(n.x, n.y, n.z)] = c_air end end @@ -2144,8 +2144,8 @@ local function basic(vm, data, data2, emin, emax, area, minp, maxp, blockseed) minp.x <= mcl_vars.mg_end_platform_pos.x and maxp.x >= mcl_vars.mg_end_platform_pos.z and minp.z <= mcl_vars.mg_end_platform_pos.z and maxp.z >= mcl_vars.mg_end_platform_pos.z then - local pos1 = {x = math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), y = math.max(minp.y, mcl_vars.mg_end_platform_pos.y), z = math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2)} - local pos2 = {x = math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2), y = math.min(maxp.y, mcl_vars.mg_end_platform_pos.y+2), z = math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2)} + --local pos1 = {x = math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), y = math.max(minp.y, mcl_vars.mg_end_platform_pos.y), z = math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2)} + --local pos2 = {x = math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2), y = math.min(maxp.y, mcl_vars.mg_end_platform_pos.y+2), z = math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2)} for x=math.max(minp.x, mcl_vars.mg_end_platform_pos.x-2), math.min(maxp.x, mcl_vars.mg_end_platform_pos.x+2) do for z=math.max(minp.z, mcl_vars.mg_end_platform_pos.z-2), math.min(maxp.z, mcl_vars.mg_end_platform_pos.z+2) do From 5c928575f87980c20a0403033acae373d3ef7857 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 17 Apr 2021 18:15:45 +0200 Subject: [PATCH 5/5] Fix #1572, server crash during login --- mods/PLAYER/mcl_playerplus/init.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 8dad7b2c5..b14d34824 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -183,10 +183,11 @@ minetest.register_globalstep(function(dtime) player_vel_yaw = limit_vel_yaw(player_vel_yaw, yaw) player_vel_yaws[name] = player_vel_yaw - if minetest.get_node_or_nil({x=player:get_pos().x, y=player:get_pos().y - 0.5, z=player:get_pos().z}) then - node_stand_return = minetest.get_node_or_nil({x=player:get_pos().x, y=player:get_pos().y - 0.1, z=player:get_pos().z}).name - else - minetest.log("action", "somehow player got of loaded areas") + local pos = player:get_pos() + local node = minetest.get_node_or_nil({x = pos.x, y = pos.y - 0.5, z = pos.z}) + + if node then + node_stand_return = node.name end local chestplate = player:get_inventory():get_stack("armor", 3)