1.12.2 Reading blocks data

Discussion in 'Spigot Plugin Development' started by Azim, Jan 20, 2020.

  1. What is the most efficient async way of reading large amounts of blocks in world?(i dont need to edit any of them)

    I havent worked with blocks yet, so kinda new at this field
     
  2. What do you mean exactly?
     
  3. In my plugin, there will be times when i will need to iterate thrue a lot of blocks (3x3 chunks to be precies), gathering such info as block's id and rotation and stuff
     
  4. Are you looking for a way to do this, or a way to improve what you have currently?
     
  5. You can use the aSync method that comes with the bukkit API, but it's not efficient as, let's say: you scan block X and then a second later you destroy it.

    Now, it's not a big deal if you loose one or two blocks, but with a big player base it's going to be inaccurate.
     
  6. Perhaps something more efficient than iterating all the blocks one by one via World#getBlockAt()
     
  7. z2y

    z2y

    Chunkshap shots its thread safe.
     
    • Agree Agree x 1