World Blender (Forge)

World Blender (Forge)

134k Downloads

code cleanup suggestions

TelepathicGrunt opened this issue ยท 3 comments

commented

replace worldBlenderBiomes.get(0).getGenerationSettings() with hashmap and try cleaning up code

if (worldBlenderBiomes.get(0).getGenerationSettings().getFeatures().get(stage.ordinal()).stream().noneMatch(addedConfigFeature -> FeatureGrouping.serializeAndCompareFeature(addedConfigFeature.get(), grassyFlowerFeature, true))) {

commented
  • use faster copy method to copy the hashmap to all biomes
commented

also possibly multithread blending?

commented

With old update and BYG on, it takes 12 seconds to blend.
With the new code done, it now takes 9 seconds. So about a 25% boost?

But if we are to get faster, multithreading seems to be the only way.
Question is, how should the threading be done?

Current idea I have is send a thread out for each worldgen stage (including decoration stages), have each thread loop over their own biome registries, and all add to their own list for that stage so they don't need any concurrency checks. When all threads closes, then have the main thread resume and put everything into World Blender's biomes.