CloudburstMC / Cloudburst

Cloudburst Server is a Bedrock first server software. Originally forked from Cloudburst Nukkit.
178 stars 70 forks source link

Breaking blocks doesn't add break sound & particles #150

Open Poswn opened 2 years ago

Poswn commented 2 years ago

Expected Behavior

Breaking a block will play a sound and show particles of where block was broken.

Actual Behavior

No sound played or particles shown.

Steps to Reproduce

Go into creative mode (can't break any blocks in survival for some reason) and break a block.

Debug information

I dug into this a bit myself and it seems be from this piece of code (or look at code I copied below) where chunk.getPlayerLoaders() in fact is empty.

This code snippet is taken from here.

if (createParticles) {
    Chunk chunk = this.getLoadedChunk(target.getPosition());
    if (chunk != null) {
        this.addParticle(new DestroyBlockParticle(target.getPosition().toFloat().add(0.5, 0.5, 0.5), target.getState()), (Collection<Player>) chunk.getPlayerLoaders());
    }
}