Oil Explorer: Mark mapblock after dig

This allows to find the next mapblock more easily
This commit is contained in:
Thomas--S 2021-09-26 12:24:55 +02:00
parent 05027a3ae0
commit 24a3df1127

View File

@ -253,6 +253,12 @@ minetest.register_node("techage:oilexplorer", {
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
techage.unmark_region(digger:get_player_name()) techage.unmark_region(digger:get_player_name())
local xpos = (math.floor(pos.x / 16) * 16)
local ypos = (math.floor(pos.y / 16) * 16)
local zpos = (math.floor(pos.z / 16) * 16)
local pos1 = {x=xpos, y=ypos, z=zpos}
local pos2 = {x=xpos+15, y=ypos+15, z=zpos+15}
techage.mark_region(digger:get_player_name(), pos1, pos2)
end, end,
is_ground_content = false, is_ground_content = false,
groups = {snappy=2,cracky=2,oddly_breakable_by_hand=2}, groups = {snappy=2,cracky=2,oddly_breakable_by_hand=2},