-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Expected behavior
Cratblock.setBlockState()
if (applyPhysics) {
return world.setBlock(pos, newState, net.minecraft.world.level.block.Block.UPDATE_ALL);
} else {
boolean success = world.setBlock(pos, newState,
net.minecraft.world.level.block.Block.UPDATE_CLIENTS |
net.minecraft.world.level.block.Block.UPDATE_KNOWN_SHAPE |
net.minecraft.world.level.block.Block.UPDATE_SKIP_ON_PLACE);
if (success && world instanceof net.minecraft.world.level.Level) {
world.getMinecraftWorld().sendBlockUpdated(
pos,
oldState,
newState,
net.minecraft.world.level.block.Block.UPDATE_ALL
);
}
return success;
}
}
in setBlock it eventually checks for flag UPDATE_CLIENTS then runs sendBlockUpdated, so why do we run it again right after?
if ((flags & UPDATE_CLIENTS) != 0 && (!this.isClientSide || (flags & UPDATE_INVISIBLE) == 0) && (this.isClientSide || chunkAt == null || (chunkAt.getFullStatus() != null && chunkAt.getFullStatus().isOrAfter(FullChunkStatus.FULL)))) { // allow chunk to be null here as chunk.isReady() is false when we send our notification during block placement // Paper - rewrite chunk system - change from ticking to full
this.sendBlockUpdated(pos, blockState, state, flags);
}
if (success && world instanceof net.minecraft.world.level.Level) {
world.getMinecraftWorld().sendBlockUpdated(
pos,
oldState,
newState,
net.minecraft.world.level.block.Block.UPDATE_ALL
);
}
this only happens when applyPhysics=false
Paper version
Other
No response