Quiet things up

This commit is contained in:
teknomunk 2024-05-17 14:51:47 +00:00
parent 27d5387c36
commit 557371564d
2 changed files with 7 additions and 11 deletions

View File

@ -66,7 +66,7 @@ local function process_dirty_block()
-- Get the next index to process
if remaining_indexers == 0 then
-- Finished
print("Finished indexing "..vector.to_string(minetest.get_position_from_hash(processing_block)))
--print("Finished indexing "..vector.to_string(minetest.get_position_from_hash(processing_block)))
processing_block = nil
remaining_indexers = nil
block_data = nil
@ -93,7 +93,7 @@ local function process_dirty_block()
index_in_process = false
decompress_queue[#decompress_queue + 1] = {map_block_hash, indexer, result}
process_dirty_block()
end
-- Run the indexer
@ -121,7 +121,7 @@ function mod.flag_position_dirty(pos)
)
local hash = minetest.hash_node_position(map_block)
if not dirty_blocks[hash] then
print("Adding "..vector.to_string(map_block).." to dirty set")
--print("Adding "..vector.to_string(map_block).." to dirty set")
end
dirty_blocks[hash] = minetest.get_us_time()
end
@ -172,6 +172,9 @@ end)
minetest.register_on_dignode(function(pos, oldnode, placer)
mod.flag_position_dirty(pos)
end)
minetest.register_on_generated(function(minp, maxp, blockseed)
mod.flag_position_dirty(minp)
end)
--[[
minetest.register_on_mapblocks_changed(function(modified_blocks, modified_block_count)
@ -211,6 +214,7 @@ local function run_indexer()
if holdoff_time < holdoff_time_check then
processing_block = block_hash
dirty_blocks[block_hash] = nil
process_dirty_block()
return
end
end

View File

@ -93,17 +93,9 @@ minetest.register_node("mcl_lightning_rods:rod_powered", rod_def_a)
lightning.register_on_strike(function(pos, pos2, objects)
local start_time = minetest.get_us_time()
local lr = minetest.find_node_near(pos, 128, { "group:attracts_lightning" }, true)
print("Old Took "..(minetest.get_us_time()-start_time).." us")
local start_time = minetest.get_us_time()
local lr = vl_map_index.find_node_near(pos, 128, { "group:attracts_lightning" }, true)
print("New Took "..(minetest.get_us_time()-start_time).." us")
if lr then
print("distance="..tostring(vector.distance(pos,lr)))
local node = minetest.get_node(lr)
if node.name == "mcl_lightning_rods:rod" then