diff --git a/mods/CORE/walkover/init.lua b/mods/CORE/walkover/init.lua index 4d712c308..eb9de4218 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 791309817..6205f84a5 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 48bcb54c4..9dac71149 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 0d026ce7c..13d0e83b2 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 e012b08f2..d342045b1 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 92dedaa84..6b907f54d 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 f7daeba19..4dbc15680 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 fb54f942b..03b9943f1 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 5c7a34fce..842441a2c 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 963933572..8b80407d3 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 8a1ffeda8..cd2d23458 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 4894833f1..930992769 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 38bd3a8c3..d06f90f6b 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 a31284094..a5685731f 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 db44333b2..587fbdbdd 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 8ff77440a..49d444b80 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 baddd95eb..e7e0db92d 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 83eedf08b..b3fc7c893 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