#Level.setBlock sometimes doesn't update block for clients

1 messages · Page 1 of 1 (latest)

limber jungle
#

version: git-dbe52e2
code:

    public static void startRefill(Position startPos, Position endPos, RefillBlockTable table, Level level){
        if(!table.validate()){
            bs.main.logger.alert("RefillBlockTable is not valid! but I'm going to run this anyway. total: " + table.totalPercentage());
        }

        for(int x = (int) startPos.getX(); x <= endPos.getX(); x++){
            for(int y = (int) startPos.getY(); y <= endPos.getY(); y++){
                for(int z = (int) startPos.getZ(); z <= endPos.getZ(); z++){
                    String randomBlockId = table.getRandom().typeId;

                    Block block = Registries.BLOCK.get(randomBlockId);
                    if(block == null){
                        bs.main.logger.error("Block ID " + randomBlockId + " is not valid!");
                        continue;
                    }

                    Position placingPos = new Position();
                    placingPos.setLevel(level);
                    placingPos.setX(x);
                    placingPos.setY(y);
                    placingPos.setZ(z);

                    level.setBlock(placingPos, block);
                }
            }
        }

        for(int chunkX = startPos.getChunkX(); chunkX <= endPos.getChunkX(); chunkX++){
            for(int chunkZ = startPos.getChunkZ(); chunkZ <= endPos.getChunkZ(); chunkZ++){
                // System.world.unloadChunk(chunkX, chunkZ);
                // System.world.loadChunk(chunkX, chunkZ);

                // startPos.level.getChunk(chunkX, chunkZ).setChanged(true);
            }
        }
    }

video:

#

the terrain is fixed when i rejoin the world

fervent sundial
#

cant reproduce

limber jungle
#

also the second player(who joined the server after player 1st player) cannot see the terrain when it is teleported far away
maybe they have a relation

fervent sundial
limber jungle
#

i invited my phone to the world to test the issue for the other players

fervent sundial
#

ok

#

can you view voice

limber jungle
#

wait a min

#

ok

#

but somehow it looks like its fixed when i open it in windows os

#

ill test again

#

hmm

fervent sundial
#

emm

#

cant reproduce

limber jungle
#

can you fill it with air and try again?

#

ohhhh

#

my linux os's memory is so low so maybe it is the problem

#

somehow this happens

fervent sundial
#

switch input