1.15.2 POI Data Mismatch when setting blocks

Discussion in 'Spigot Plugin Development' started by tcklpl, Feb 21, 2020.

  1. So, I made a method to replace blocks and if requested transform them into fallingblock entities however, it seems that if the block being replaced have any type of inventory the server will accuse a POI Data Mismatch, how can I fix this?
    code:
    Code (Java):
    public void bufferedReplaceBlocks(List<Block> blocks, List<Material> replacement, int buffer, boolean fallingBlock) {

            if (blocks.size() == 0) return;

            AtomicInteger currentBlockIndex = new AtomicInteger(0);

            int bufferCycles = 1 + Math.floorDiv(blocks.size(), buffer);
            for (int currentCycle = 0; currentCycle < bufferCycles; currentCycle++) {

                Bukkit.getScheduler().scheduleSyncDelayedTask(main, () -> {
                    int max = Math.min(buffer, blocks.size() - currentBlockIndex.get());
                    for (int i = 0; i < max; i++) {
                        Block b = blocks.get(currentBlockIndex.get());
                        if (b.getType() != Material.AIR && fallingBlock) {
                            FallingBlock fb = getWorld().spawnFallingBlock(b.getLocation().add(0.5, 0, 0.5), b.getBlockData());
                            fb.setHurtEntities(true);
                            fb.setDropItem(false);
                        }
                        b.setType(replacement.get(r.nextInt(replacement.size())), false);
                        if (currentBlockIndex.get() < blocks.size() - 1)
                            currentBlockIndex.incrementAndGet();
                    }
                }, currentCycle + 1);

            }
        }
    log:
    Code (Text):
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=-6, y=4, z=17}                                                                        [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=10, y=4, z=9}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=11, y=4, z=9}
    [12:23:33 ERROR]: Block at 13, 4, 27 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=13, y=4, z=27}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=14, y=4, z=9}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=14, y=4, z=20}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=14, y=4, z=22}
    [12:23:33 ERROR]: Block at 14, 4, 27 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=14, y=4, z=27}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=15, y=4, z=21}
    [12:23:33 ERROR]: Block at 15, 4, 27 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=15, y=4, z=27}
    [12:23:33 ERROR]: Block at 16, 4, 5 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=16, y=4, z=5}
    [12:23:33 ERROR]: Block at 16, 4, 27 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=16, y=4, z=27}
    [12:23:33 ERROR]: Block at 17, 4, 4 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=17, y=4, z=4}
    [12:23:33 ERROR]: Block at 17, 4, 5 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=17, y=4, z=5}
    [12:23:33 ERROR]: Block at 22, 4, 4 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=22, y=4, z=4}
    [12:23:33 ERROR]: Block at 28, 4, 25 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=28, y=4, z=25}
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=28, y=4, z=28}
    [12:23:33 ERROR]: Block at 29, 4, 25 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=29, y=4, z=25}
    [12:23:33 ERROR]: Block at 29, 4, 26 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:33 ERROR]: POI data mismatch: never registered at BlockPosition{x=29, y=4, z=26}
    [12:23:36 ERROR]: POI data mismatch: never registered at BlockPosition{x=12, y=5, z=19}
    [12:23:36 ERROR]: Block at 29, 5, 25 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:36 ERROR]: POI data mismatch: never registered at BlockPosition{x=29, y=5, z=25}
    [12:23:36 ERROR]: Block at 29, 5, 26 is Block{minecraft:water} but has [email protected] Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
    [12:23:36 ERROR]: POI data mismatch: never registered at BlockPosition{x=29, y=5, z=26}