…t of code inside of the loops, and doing cheap checks before more expensive ones.
Using large (150x150x200) greenhouses has been causing ~2s ticks when the plugin runs the block conversion.
While some lag is a given when manipulating this many blocks, rewriting the methods to do as little as possible inside of the loops has allowed me to bring the block conversion ticks down to ~300ms.
As far as I can tell most of the lag came from running gh.getBiomeRecipe() for every non air block inside of the greenhouse and also some mysterious lag from the convertBlock method even if conversionBlocks.get(bType) returns an empty collection. I suspect it's because it has to create the collection?
…t of code inside of the loops, and doing cheap checks before more expensive ones.
Using large (150x150x200) greenhouses has been causing ~2s ticks when the plugin runs the block conversion. While some lag is a given when manipulating this many blocks, rewriting the methods to do as little as possible inside of the loops has allowed me to bring the block conversion ticks down to ~300ms.
As far as I can tell most of the lag came from running gh.getBiomeRecipe() for every non air block inside of the greenhouse and also some mysterious lag from the convertBlock method even if conversionBlocks.get(bType) returns an empty collection. I suspect it's because it has to create the collection?