What's the fastest way to set blocks in a chunk?

Discussion in 'Plugin Development' started by zhuowei, Apr 3, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    zhuowei

    I'm currently trying to revive SphereWorld. It's basically a plugin that randomly generates some locations when the world generates, and then set all blocks to air except those around the locations, creating spheres.

    The original version uses net.minecraft.server code to set blocks directly in the block data array. My version uses the standard Bukkit Block object to set the block, but it is very slow - So slow that, if you teleport to a part of the world that had not been generated, the server would freeze due to the lag of generating the world. I believe that it may be caused by the difference in the method of setting blocks to air in the chunks. Perhaps the Bukkit Block.setTypeIdAndData runs lighting and block updates when direct array accesses do not.

    Does anyone know of any faster way of setting blocks in a chunk, preferably using the Bukkit API?
     
Thread Status:
Not open for further replies.

Share This Page