diff --git a/mods/CORE/walkover/init.lua b/mods/CORE/walkover/init.lua index 4d712c3085..eb9de42186 100644 --- a/mods/CORE/walkover/init.lua +++ b/mods/CORE/walkover/init.lua @@ -2,47 +2,45 @@ local get_connected_players = minetest.get_connected_players local get_node = minetest.get_node -local vector_add = vector.add +local vector = vector local ceil = math.ceil local pairs = pairs walkover = {} -walkover.registered_globals = {} - -function walkover.register_global(func) - table.insert(walkover.registered_globals, func) -end local on_walk = {} local registered_globals = {} +walkover.registered_globals = registered_globals + +function walkover.register_global(func) + table.insert(registered_globals, func) +end + minetest.register_on_mods_loaded(function() for name,def in pairs(minetest.registered_nodes) do if def.on_walk_over then on_walk[name] = def.on_walk_over end end - for _,func in ipairs(walkover.registered_globals) do --cache registered globals - table.insert(registered_globals, func) - end end) local timer = 0 minetest.register_globalstep(function(dtime) - timer = timer + dtime; + timer = timer + dtime if timer >= 0.3 then - for _,player in pairs(get_connected_players()) do - local pp = player:get_pos() - pp.y = ceil(pp.y) - local loc = vector_add(pp, {x=0,y=-1,z=0}) - if loc then - local nodeiamon = get_node(loc) - if nodeiamon then - if on_walk[nodeiamon.name] then - on_walk[nodeiamon.name](loc, nodeiamon, player) + for _, player in pairs(get_connected_players()) do + local ppos = player:get_pos() + ppos.y = ceil(ppos.y) + local npos = vector.add(ppos, vector.new(0, -1, 0)) + if npos then + local node = get_node(npos) + if node then + if on_walk[node.name] then + on_walk[node.name](npos, node, player) end for i = 1, #registered_globals do - registered_globals[i](loc, nodeiamon, player) + registered_globals[i](npos, node, player) end end end diff --git a/mods/ITEMS/mcl_core/textures/default_glass_detail.png b/mods/ITEMS/mcl_core/textures/default_glass_detail.png index 791309817e..6205f84a58 100644 Binary files a/mods/ITEMS/mcl_core/textures/default_glass_detail.png and b/mods/ITEMS/mcl_core/textures/default_glass_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_black_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_black_detail.png index 48bcb54c48..9dac71149d 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_black_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_black_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_blue_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_blue_detail.png index 0d026ce7cc..13d0e83b2f 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_blue_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_blue_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_brown_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_brown_detail.png index e012b08f2d..d342045b14 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_brown_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_brown_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_cyan_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_cyan_detail.png index 92dedaa844..6b907f54d3 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_cyan_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_cyan_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_gray_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_gray_detail.png index f7daeba198..4dbc15680b 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_gray_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_gray_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_green_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_green_detail.png index fb54f942be..03b9943f12 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_green_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_green_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_light_blue_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_light_blue_detail.png index 5c7a34fcef..842441a2c6 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_light_blue_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_light_blue_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_lime_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_lime_detail.png index 9639335725..8b80407d3c 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_lime_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_lime_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_magenta_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_magenta_detail.png index 8a1ffeda80..cd2d234587 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_magenta_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_magenta_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_orange_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_orange_detail.png index 4894833f1f..930992769a 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_orange_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_orange_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_pink_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_pink_detail.png index 38bd3a8c3f..d06f90f6b5 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_pink_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_pink_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_purple_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_purple_detail.png index a312840943..a5685731ff 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_purple_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_purple_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_red_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_red_detail.png index db44333b23..587fbdbdd4 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_red_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_red_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_silver_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_silver_detail.png index 8ff77440aa..49d444b80f 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_silver_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_silver_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_white_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_white_detail.png index baddd95eb5..e7e0db92d0 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_white_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_white_detail.png differ diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_glass_yellow_detail.png b/mods/ITEMS/mcl_core/textures/mcl_core_glass_yellow_detail.png index 83eedf08ba..b3fc7c8933 100644 Binary files a/mods/ITEMS/mcl_core/textures/mcl_core_glass_yellow_detail.png and b/mods/ITEMS/mcl_core/textures/mcl_core_glass_yellow_detail.png differ