/advtrains_train_track/models/

ss="hl opt">.max(d.p1x, d.p2x), math.max(d.p1z, d.p2z) local form_x, form_z=10,10 local edge_x, edge_z = form_x/(maxx-minx), form_z/(maxz-minz) local len_x, len_z=math.max(edge_x, itm_conf_mindia), math.max(edge_z, itm_conf_mindia) local form="size["..(form_x+edge_x)..","..(form_z+edge_z).."]" local lbl={} for x,itx in pairs(itm_cache) do if x>=minx and x<=maxx then for z,y in pairs(itx) do if z>=minz and z<=maxz then local adn=advtrains.detector.get({x=x, y=y, z=z}) local color="gray" if adn then color="red" lbl[sid(adn)]={x=x, z=z} end form=form.."box["..(edge_x*(x-minx))..","..(form_z-(edge_z*(z-minz)))..";"..len_x..","..len_z..";"..color.."]" end end end end for t_id, xz in pairs(lbl) do form=form.."label["..(edge_x*(xz.x-minx))..","..(form_x-(edge_z*(xz.z-minz)))..";"..t_id.."]" end return form end local function cache_ndb() itm_cache={} local ndb_nodes=advtrains.ndb.get_nodes() for y, xzt in pairs(ndb_nodes) do for x, zt in pairs(xzt) do for z, _ in pairs(zt) do if not itm_cache[x] then itm_cache[x]={} end itm_cache[x][z]=y end end end end minetest.register_chatcommand("itm", { params="[x1 z1 x2 z2] or [mdef]",