- --add data to both maps
- if not r_index[i.x] then r_index[i.x] = {} end
- if not r_index[i.x][i.y] then r_index[i.x][i.y] = {} end
- r_index[i.x][i.y][i.z] = {dust = true,level = 0}
- --the data to the 3d array must be written to memory before this is executed
- --or a stack overflow occurs!!!
- localredstone.collector(i)
- return
+ if vector_distance(i,origin) <= 8 then
+ --add data to both maps
+ if not r_index[i.x] then r_index[i.x] = {} end
+ if not r_index[i.x][i.y] then r_index[i.x][i.y] = {} end
+ r_index[i.x][i.y][i.z] = {dust = true,level = 0}
+
+ if not check_table[i.x] then check_table[i.x] = {} end
+ if not check_table[i.x][i.y] then check_table[i.x][i.y] = {} end
+ check_table[i.x][i.y][i.z] = get_group(i,"redstone_power")
+
+ --the data to the 3d array must be written to memory before this is executed
+ --or a stack overflow occurs!!!
+ localredstone.collector(i,origin)
+ return
+ else
+ if not r_index[i.x] then r_index[i.x] = {} end
+ if not r_index[i.x][i.y] then r_index[i.x][i.y] = {} end
+ r_index[i.x][i.y][i.z] = {torch = true,power=get_group(i,"redstone_power")}
+ end