diff --git a/mobtest/init.lua b/mobtest/init.lua index 692164c..bf20383 100644 --- a/mobtest/init.lua +++ b/mobtest/init.lua @@ -63,17 +63,17 @@ mcl_structures.register_structure("spawncircle",{ mcl_structures.register_structure("spawncircle_lit",{ place_func = function(pos,def,pr) - local p1 = vector.offset(pos,-33,-5,-33) - local p2 = vector.offset(pos,33,5,33) + local p1 = vector.offset(pos,-36,-5,-36) + local p2 = vector.offset(pos,36,5,36) local nn1 = minetest.find_nodes_in_area_under_air(p1,p2,{"group:solid","group:plant","group:leaves","group:tree","group:mushroom"}) local c1 = {} local c2 = {} for k,v in pairs(nn1) do local dst1=vector.distance(vector.round(vector.new(pos.x,0,pos.z)),vector.round(vector.new(v.x,0,v.z))) local dst2=vector.distance(vector.round(vector.new(pos.x,0,pos.z)),vector.round(vector.new(v.x,0,v.z))) - if dst1 > 23 and dst1 < 25 then + if dst1 > 20 and dst1 < 22 then table.insert(c1,v) - elseif dst2 > 31 and dst2 < 33 then + elseif dst2 > 33 and dst2 < 35 then table.insert(c2,v) end end diff --git a/orecount/init.lua b/orecount/init.lua new file mode 100644 index 0000000..3746435 --- /dev/null +++ b/orecount/init.lua @@ -0,0 +1,28 @@ + +local orenodes = { + "mcl_core:stone_with_diamond", + "mcl_core:stone_with_iron", + "mcl_core:stone_with_gold", + "mcl_core:stone_with_coal", + "mcl_core:stone_with_lapis", + "mcl_core:stone_with_emerald", + "mcl_core:stone_with_redstone", + "mcl_core:stone_with_redstone_lit", + "mcl_nether:ancient_debris", + "mcl_blackstone:blackstone_gilded", + "mcl_blackstone:nether_gold", +} + +mcl_info.register_debug_field("Ores near",{ + level = 4, + func = function(pl,pos) + local p1 = vector.offset(pos,-32,-32,-32) + local p2 = vector.offset(pos,32,32,32) + local ores, counts = minetest.find_nodes_in_area(p1,p2,orenodes) + local r = {} + for k,v in pairs(counts) do + if v > 0 then r[k]=v end + end + return dump(r) + end +}) diff --git a/orecount/mod.conf b/orecount/mod.conf new file mode 100644 index 0000000..b0fe4ce --- /dev/null +++ b/orecount/mod.conf @@ -0,0 +1,2 @@ +name = orecount +depends = mcl_info