forked from VoxeLibre/VoxeLibre
Quiet things up
This commit is contained in:
parent
27d5387c36
commit
557371564d
|
@ -66,7 +66,7 @@ local function process_dirty_block()
|
||||||
-- Get the next index to process
|
-- Get the next index to process
|
||||||
if remaining_indexers == 0 then
|
if remaining_indexers == 0 then
|
||||||
-- Finished
|
-- 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
|
processing_block = nil
|
||||||
remaining_indexers = nil
|
remaining_indexers = nil
|
||||||
block_data = nil
|
block_data = nil
|
||||||
|
@ -93,7 +93,7 @@ local function process_dirty_block()
|
||||||
|
|
||||||
index_in_process = false
|
index_in_process = false
|
||||||
decompress_queue[#decompress_queue + 1] = {map_block_hash, indexer, result}
|
decompress_queue[#decompress_queue + 1] = {map_block_hash, indexer, result}
|
||||||
|
process_dirty_block()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Run the indexer
|
-- Run the indexer
|
||||||
|
@ -121,7 +121,7 @@ function mod.flag_position_dirty(pos)
|
||||||
)
|
)
|
||||||
local hash = minetest.hash_node_position(map_block)
|
local hash = minetest.hash_node_position(map_block)
|
||||||
if not dirty_blocks[hash] then
|
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
|
end
|
||||||
dirty_blocks[hash] = minetest.get_us_time()
|
dirty_blocks[hash] = minetest.get_us_time()
|
||||||
end
|
end
|
||||||
|
@ -172,6 +172,9 @@ end)
|
||||||
minetest.register_on_dignode(function(pos, oldnode, placer)
|
minetest.register_on_dignode(function(pos, oldnode, placer)
|
||||||
mod.flag_position_dirty(pos)
|
mod.flag_position_dirty(pos)
|
||||||
end)
|
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)
|
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
|
if holdoff_time < holdoff_time_check then
|
||||||
processing_block = block_hash
|
processing_block = block_hash
|
||||||
dirty_blocks[block_hash] = nil
|
dirty_blocks[block_hash] = nil
|
||||||
|
process_dirty_block()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -93,17 +93,9 @@ minetest.register_node("mcl_lightning_rods:rod_powered", rod_def_a)
|
||||||
|
|
||||||
|
|
||||||
lightning.register_on_strike(function(pos, pos2, objects)
|
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)
|
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
|
if lr then
|
||||||
print("distance="..tostring(vector.distance(pos,lr)))
|
|
||||||
local node = minetest.get_node(lr)
|
local node = minetest.get_node(lr)
|
||||||
|
|
||||||
if node.name == "mcl_lightning_rods:rod" then
|
if node.name == "mcl_lightning_rods:rod" then
|
||||||
|
|
Loading…
Reference in New Issue