Solved BlockPopulator async ?


New member
Jan 11, 2024
Hey I have another issue with my world generator, when using BlockPopulators. When I'm reading or modifying blocks from a BlockPopulator I have either an infinite loop (for reading) or AsyncException (for modifying). The workarround I found is using a BukkitRunnable inside the BlockPopulator to get ride of the problem but it slows down significantly the process :
public void populate(WorldInfo worldInfo, Random random, int chunkX, int chunkZ, LimitedRegion limitedRegion) {
        new BukkitRunnable() {
            public void run() {
for(CacheObject object : objectsCaches) {
Location location = new Location(world, object.getCoordinates().getX(), object.getCoordinates().getY(), object.getCoordinates().getZ());
                    Chest chest = (Chest) location.getBlock().getState();
                    if(object.getObjectType() == CacheObjectType.DUNGEON_CHEST) populateDungeonChest(chest);

protected void populateDungeonChest(Chest chest) {
chest.getBlockInventory().addItem(new ItemStack(Material.CHEST));

Do you have any idea of where this could come from ?

EDIT : I found the problem, just used Location instead of Limited region with the new API
Last edited: